How to get egocentric global maps in HouseExpo

By Bolun Dai | Jan 4th 2021

HouseExpo is a nice environment for active SLAM research; it provides a simulation environment that enables a robot to move around in a 2D world and draw maps of the environment. The default output of the simulation is an egocentric (the agent centered in the image) local map. A recent work provides a nice framework for learning-based exploration tasks. It uses egocentric local maps and global maps as the input to the learning-based controller. To implement an approach like on HouseExpo, we would need to code it up ourselves. This blog is going to talk about how to get an egocentric global map in HouseExpo.

Before we do anything, we need to first figure out the coordinate system used in HouseExpo. For any map, the origin \((0, 0)\) is at the upper left corner. If we use a Cartesian coordinate system as comparison, the positive \(x\)-axis in HouseExpo is along the negative \(y\)-axis, and the positive \(y\)-axis co-aligns with the positive \(x\)-axis of the Cartesian coordinates. As for the orientation, going from the positive \(x\)-axis in the Cartesian coordinates to the negative \(x\)-axis counterclockwise is going from \(0^\circ\) to \(180^\circ\); if going clockwise, then it is from \(0^\circ\) to \(-180^\circ\) in HouseExpo.

The following can be dissected into two steps: centering the agent and rotating the map. To do this, we need to know the size of the background canvas \((h, w)\), the position of the agent in the global map \((p_x, p_y)\), and the size of the global map \((g_x, g_y)\). Then we can assign the corresponding cells in the canvas to have values equal to those in the global map.

The next step is to rotate the canvas. If the current orientation of the robot is \(+\theta\), then we would need to rotate the canvas by \(-\theta\). After this, we have the rotated image where the robot is heading right; if we want the robot to face up, we would need to rotate the canvas by \(90^\circ\). We use the following image to illustrate this process.

Powered by Powered by MathJax