ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I found the reason, the reason is I ignored the resolution of the map data.

I thought the origin.position both represented the coordinates of the lower left and upper right corners. So If I get x:-5, y:-4 of the map origin's position data, I just thought the right and top coordinate is (5,4). This is wrong.

The position of the origin just represented the coordinates of the lower left. The real width of the map in ros is info.resolution * info.width . In the above question, it's 0.0500000007451 * 100. So the width of the map is about 5. It means the right coordinate is 0 instead of 5 ( width of the ros map + origin.position = right coordinate)