skasperski / navigation_2d

ROS nodes to navigate a mobile robot in a planar environment
GNU General Public License v3.0
123 stars 65 forks source link

How to create a fixed origin map at the beginning map-building when I use the Exploration #23

Closed jiangxinyu closed 8 years ago

jiangxinyu commented 8 years ago

I want to create a fix-origin position map when use the exploration at the beginning of map build. However the origin position of the map changed everytime when I restart the node(the map position in rviz).How should do? I mean: I want to fix the origin at the (0,0) of the world in rviz at the beginning of map build when use the auto-exploration to build map. Please help me, thank you very much (Please excuse for my poor English……).

skasperski commented 8 years ago

I don't think that I really understand your question. When you start the mapping, the robot will always start at (0,0) in world coordinates. So if you want to build a similar map again, you have to start the robot in the same place where you started before.

The "origin" value of the OccupancyGrid however will change during the mapping process. (Not only when restarting the mapping) This is because the map grows over time, but the map origin always marks the lower left edge of the map. But you can always use this origin to translate from world coordinates to map coordinates.

jiangxinyu commented 8 years ago

OK, I have got it, thank you very much