ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
If you are talking about the orign as the coordinates (0;0)
then the origin is set to the position of the robot at the beginning of your simulation (you can verify that by looking at the position of the frame map
and odom
).
Also, if you look at the information of mapmetadata
there is an attribute origin
that is always on the bottom right corner of the map but it's not a frame, it's just the origin (not (0;0)
but the pose of the first cell of the occupancygrid
) of the map created accordingly to have your robot centered at the beginning.
With that in mind, to answer your questions :
gmapping
it creates the frame map
. gmapping
can locate the robot according to sensors data and odometry
so the frame is created at the same pose as the frame odom
. So your origin
when you launch gmapping is odom
.ROS
, you can look at the REP103. The x
axis is for the movements forward/backwards. So if you move by 1
meter to the left you are at (0;1;0)
(if you were at (0;0;0)
).occupancygrid
. So if you have a resolution of 0.01
it means your map will be created with cells of side 1cm
. (e.g. if you have a map of 10
meters by 10
meters with that resolution you would have 10⁶
cells in the map : calculated with the formula map_width/resolution * map_length/resolution
). But that doesn't means that all the coordinates are rounded to the resolution, the coordinates depends of the movement of base_link
accroding to odom
(thanks to the tf
) and cells with simply keep a value if there is an obstacle or not (and if it's unknown). So you simply have to tell ROS
the coordinates you want.