0
$\begingroup$

Rosanswers logo

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.


Originally posted by Ken_in_JAPAN on ROS Answers with karma: 894 on 2014-06-29

Post score: 0


Original comments

Comment by Ken_in_JAPAN on 2014-07-01:
I think I should set 0.01[m/pixel] as a resolution, if I follow the map that has 312X512 pixels.

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

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.


Originally posted by dornhege with karma: 31395 on 2014-08-13

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by Ken_in_JAPAN on 2014-08-13:
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.

Comment by dornhege on 2014-08-13:
Exactly. The resolution is part of the map and was generated when building it.

$\endgroup$
0
$\begingroup$

Rosanswers logo

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. image description

If you understand above article, you can change origin.


Originally posted by Ken_in_JAPAN with karma: 894 on 2014-08-13

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by jxl on 2015-03-07:
@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??

Comment by Ken_in_JAPAN on 2015-03-08:
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.

Comment by jxl on 2015-03-08:
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

Comment by Ken_in_JAPAN on 2015-03-09:
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.

Comment by jxl on 2015-03-09:
Ok,thank you Ken, i understand

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.