# Object Semantic Grid Mapping with 2D LiDAR and RGB-D Camera for Domestic Robot Navigation
## 4 Back-End
### Object Goal Space Generation  
The dominant direction \(\phi_{\rm m1}\) is used as the orientation of the object. Let us assume that a point \(\mathbf{P}_{i}=[x_{i},\ y_{i},z_{i}]^{\mathsf{T}}\) belongs to an object instance. According to the dominant direction, the rotated point \(\mathbf{P}^{\prime}_{i}\) can be computed as follows:  
\[\mathbf{P}^{\prime}_{i}=\mathbf{R}(-\phi_{\rm m1})\mathbf{P}_{i}. \tag{15}\]  
Then, the MBR can be computed as follows:  
\[\left\{ \begin{array}{c}x^{\prime}_{\rm min}=\min[x_{i}]\\ y^{\prime}_{\rm min}=\min[y_{i}]\\ x^{\prime}_{\rm max}=\max[x_{i}]\\ y^{\prime}_{\rm max}=\max[y_{i}]\\ \end{array} \right., \tag{16}\]  
\[\left\{ \begin{array}{c}\mathbf{P}^{\prime}_{\rm ld}=\left[x^{\prime}_{\rm min },\ y^{\prime}_{\rm min},1\right]^{\mathsf{T}}\\ \mathbf{P}^{\prime}_{\rm lu}=\left[x^{\prime}_{\rm min},y^{\prime}_{\rm max}, 1\right]^{\mathsf{T}}\\ \mathbf{P}^{\prime}_{\rm rd}=\left[x^{\prime}_{\rm max},y^{\prime}_{\rm min}, 1\right]^{\mathsf{T}}\\ \mathbf{P}^{\prime}_{\rm ru}=\left[x^{\prime}_{\rm max},y^{\prime}_{\rm max}, 1\right]^{\mathsf{T}}\\ \end{array} \right., \tag{17}\]  
where \(\mathbf{P}^{\prime}_{\rm ld}\) is the lower left point of the rectangle, \(\mathbf{P}^{\prime}_{\rm ld}\) is the upper left, \(\mathbf{P}^{\prime}_{\rm rd}\) is the lower right, and \(\mathbf{P}^{\prime}_{\rm ru}\) is the upper right. Then, we transform the rectangle in the rotated coordinate system to the map coordinate system:  
\[\left\{ \begin{array}{c}\mathbf{P}_{\rm ld}=\mathbf{R}(-\phi_{\rm m1})\ \mathbf{P}^{ \prime}_{\rm ld}\\ \mathbf{P}_{\rm lu}=\mathbf{R}(-\phi_{\rm m1})\ \mathbf{P}^{\prime}_{\rm ru}\\ \mathbf{P}_{\rm rd}=\mathbf{R}(-\phi_{\rm m1})\ \mathbf{P}^{\prime}_{\rm rd}\\ \mathbf{P}_{\rm ru}=\mathbf{R}(-\phi_{\rm m1})\ \mathbf{P}^{\prime}_{\rm ru}\\ \end{array} \right.. \tag{18}\]  
Based on the four vertex points of the rectangle, the OOMBR can be generated, as shown in Figure 10.  
Figure 9: The result of room dominant direction detection. The navigation goal point is located on a free grid, but the object is located on the occupied or unknown grids. In order to help the robot select goals and make its behavior more in-line with social norms, the object goal space is established. It describes the affordance and nonaffordance space (NAS) of an object. According to the definition in [43], affordance space is related to human activities and is a social space provided by the environment, which is of great significance to realize the navigation behavior accepted by humans. For example, Figure 11 defines the affordance space for a couch, and Figure 11 shows that a FABO robot is in this space. The rationality of this goal needs further discussion. If a human orders the robot to take the cushion on the couch to the bedroom, the point is reasonable, as it is convenient for the robot to execute the next action. On the contrary, if the human just orders the robot to stop nearby the couch, the point is unreasonable, as the affordance space is the potential space for human activities. When people want to sit down, the robot will become an obstacle. Therefore, the robot should stop in the nonaffordance space, in this case. Figure 11: Affordance space: (**a**) the affordance space of a couch, and (**b**) a FABO robot parked in the space. Figure 10: Object point cloud with object-orientated minimum bounding rectangles. To formally define these spaces, we first introduce the concepts of 4-connected and 8-connected pixels. The 4-connected pixels are shown in Figure 11(a) and are defined as follows:  
\[\mathcal{N}_{4}(i,\ j)\ =\ \{(i,\ j-1),(i-1,\ j),\ (i,\ j+1),\ (i+1,\ j)\}. \tag{19}\]  
The 8-connected pixels are shown in Figure 11(b) and are defined as follows:  
\[\mathcal{N}_{8}(i,j)=\mathcal{N}_{4}(i,j)\cup\{(i-1,\ j-1),(i-1,\ j+1),\ (i+1,\ j-1),\ (i+1,\ j+1)\}. \tag{20}\]  
The theoretical model of the goal space is shown in Figure 11(c).