# about resolution on yaml

My question:
As hokuyo laser URG-04LX has 1mm resolution, I should set 0.001 as resolution on global_costmap_params.yaml?
Because the resolution of hokuyo laser URG-04LX is 1mm. or Should I edit this parameter to match unit [m/pixel] in case that pgm has 312X512 pixels and actual map size has 2.7m wide and 5.3m height?
Could anybody tell me your experience?

Next article says more detailed information. I have a laser3.yaml and laser3.pgm like this. laser3.png
laser3.yaml

image: /home/turtlebot/laser3.pgm
resolution: 0.050000
origin: [-1.000000, -12.200000, 0.000000]
negate: 0
occupied_thresh: 0.65
free_thresh: 0.196


So, I'm editing my code like this.

map_upperboud = costmap_->getSizeInMetersX() -costmap_->getOriginX();
map_lowerbound = costmap_->getOriginX();
ROS_WARN("Setting upper bound and lower bound of map x-coordinate to (%f, %f).", map_upperbound, map_lowerbound);


When I execute this program, I get a next message.
[ WARN] [1404074825.515283246]: Setting upper bound and lower bound of map x-coordinate to (16.975000, -1.000000). 
[ WARN] [1404074825.515418641]: Setting upper bound and lower bound of map y-coordinate to (37.775000, -12.200000).  I think getOriginX() reads laser3.yaml. Actually, The map have 2.7m in X-axis and 5.3m in Y-axis. But, The result has 16.95 in X-axis and 37.775 in Y-axis. laser3.png that actually is laser3.pgm has 320X512 pixels. If calculating pixels, origin data and resolution in yaml with getSizeInMetersX(), I get 16.975 and 37.775.
So, resolution of parameter is written on laser3.yaml after reading a resolution in global_costmap_params.yaml.

edit retag close merge delete

I think I should set 0.01[m/pixel] as a resolution, if I follow the map that has 312X512 pixels.

( 2014-07-01 12:14:14 -0500 )edit

Sort by » oldest newest most voted

Do NOT do this. The resolution in the map's yaml file is the map's resolution, not the laser's. Those are two completely different things and manually changing the map resolution will almost surely make the map unusable.

more

Thanks @dornhege! Do you mean that you don't change a resolution of yaml? I also think that I should not change the resolution after building a map.

( 2014-08-13 09:31:21 -0500 )edit

Exactly. The resolution is part of the map and was generated when building it.

( 2014-08-13 09:37:42 -0500 )edit

I want to explain the relationship between *.yaml and *.pgm.

kinectF1.yaml.

image: /home/turtlebot/kinectF1.pgm
resolution: 0.050000
origin: [-100.000000, -100.000000, 0.000000]
negate: 0
occupied_thresh: 0.65
free_thresh: 0.196


If you open kinectF1.pgm(4000x4000) with Gimp Image Editor, you will understand the relationship. resolution in kinectF1.yaml means m/pixel. 0 on x-axis, 0 on y-axis and 0 theta is origin. you can calculate origin in kinectF1.yaml by dividing -100.000000 by 0.05. The result is -2000. As the upper-right corner on kinectF1.pgm is origin, 2000 on Gimp is located at -2000 from origin.

If you understand above article, you can change origin.

more

@Ken,i think the map resolution 0.05 represents 0.05m/cell,how to use gimp to change the map resolution is 0.025? in my case,my map.pgm is (576,512),does change the map.pgm size (1152,1024) can change the resolution??

( 2015-03-07 03:33:52 -0500 )edit

dornhege also says that map resolution shouldn't be changed. By the way, How do you make your map? With Kinect or URG-04LX? I recommend you follow the information the device got.

( 2015-03-08 08:16:44 -0500 )edit

i saw the similar question ,does it mean that once you get map ,you shouldn't change the resolution of the map by some software,i got map by this

( 2015-03-08 09:00:09 -0500 )edit

As having shown the picture at this page,I made a map clean with Gimp. But, I don't change the resolution of map with gedit.

( 2015-03-09 08:55:08 -0500 )edit

Ok,thank you Ken, i understand

( 2015-03-09 20:20:57 -0500 )edit