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

questions about 2d map structure ?

asked 2014-10-07 04:37:33 -0600

jxl gravatar image

updated 2014-10-07 06:01:58 -0600

hello everyone,

i did the turtlebot gmapping tutorial,got a map(width=768,height=512,resolution=0.05). does it mean that the actual size of the environment is (768 multiply by 0.05,512 multiply by0.05) ,the grid map of X from [0,767],Y from [ 0,511] or maybe X-Y axes reverse,the [0,0]cell is the lower left corner of the grid map,am i right?

then i saw the OccupancyGrid andMapMetaData , and when i saw the link1,link2and link3,There are few points unclear.

  1. when gmapping over with the turtlebot stop ,but the node slam_gmapping not kill, then i want to see the map data,sorosrun echo /map > map_data.txt,but the data are only three type: 0,100 and -1.But the Image_format said the "occupancy is represented as an integer in the range [0,100]",why?
  2. from the experiment ,i got the[-12.2,-12.2,0] ,[0,0,0,1],it suggest that there is no orientation between the grid map frame coordinate and the /map frame coordinate,am i right ?how does the map_server make the grid map 's X-Y axes parallel to the /map frame's X-Y? if i do experiment in a rectangular totally free room ,i let the initial pose of turtlebot located in the diagonal of the environment ,facing to another diagonal corner,the /map frame's axes-X isn't parallel to the future build grid map frame's axes-X, the /map frame's axes-Y is also not parallel to map frame's axes-Y,can i understand like this ?

Thanks for your time and attention.sorry,my english is poor ,i hope i will not confuse you .your any ideas will be appreciated,thank you very much !!


edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2014-10-07 08:03:45 -0600

dornhege gravatar image

First, your interpretations are correct.

  1. It's still correct as per the definition. My guess is that it's easier for later algorithm to work with binary data than make the thresholding themselves as like this everyone is working on the same representation.

  2. Yes this is correct. gmapping always uses 0 orientation. In principle you can use maps with other orientation, but I would not recommend that as as far as I known neither amcl nor the static map currently support that.

edit flag offensive delete link more



Addendum on 1: Map data is represented by an unsigned char, with 255 (or -1 after conversion to signed) being a special value to represent unknown space. link

paulbovbel gravatar image paulbovbel  ( 2014-10-07 08:29:04 -0600 )edit

Yes, this is also in the message spec:

dornhege gravatar image dornhege  ( 2014-10-07 08:43:43 -0600 )edit

hello @dornhege,you mean the value of the grid map published by /slam_gmapping node is only have three values,there is no value is (0,100),such as 87,18 and so on ?

jxl gravatar image jxl  ( 2014-10-07 08:53:57 -0600 )edit

It probably is internally, but is thresholed before publishing.

dornhege gravatar image dornhege  ( 2014-10-07 09:30:06 -0600 )edit

sorry for late reply ,thank you .in other place i see the origin.position of the /map in the /world can be set by yaml file which initialize map_server,where is it ? i only rosrun map_server map_saver -f /tmp/map.yaml,not set the origin ,does the origin get the fault value ?how can i set it?

jxl gravatar image jxl  ( 2014-10-07 22:14:43 -0600 )edit

answered 2014-10-08 08:41:42 -0600

jxl gravatar image

sorry ,i mistake the origin of the map .In the gmapping processing, while the robot is moving ,the origin of the map is changing,also the map size is changing .Only while the robot is not moving ,the origin and the map size are not changeable.The final origin and the map size are set by something automatically,anybody agree? when gmapping ,in rviz,we can see the /map frame,it doesn't change in the whole process,is it namely the fixed world frame ,the origin of the map is said relative to it ?

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2014-10-07 04:37:33 -0600

Seen: 929 times

Last updated: Oct 08 '14