Ask Your Question
0

Rezise of the map necessary?

asked 2014-10-08 04:55:19 -0500

Andromeda gravatar image

updated 2014-10-08 07:58:25 -0500

Hi, I m trying to load a blank map with a defined dimension of [width, height] = [20, 20] but still it displays in Rviz just a small white square of constant dimension 6x6. I read this tutorial here and I put the right parameter in the costmap file:

global_costmap:
   global_frame: /map
   robot_base_frame: /base_link
   update_frequency: 3.0
   publish_frequency: 0.0  # For a static global map, there is generally no need to continually publish it
   static_map: true        # This parameter and the next are always set to opposite values. The global map is usually static so we set static_map to true
   rolling_window: false   # The global map is generally not updated as the robot moves to we set this parameter to false
   resolution: 0.01
   transform_tolerance: 1.0
   map_type: costmap
   width:  20
   height: 20

and

local_costmap:
   global_frame: /odom
   robot_base_frame: /base_link
   update_frequency: 3.0
   publish_frequency: 2.0
   static_map: false
   rolling_window: true
   width:  16
   height: 16
   resolution: 0.01
   transform_tolerance: 1.0

and here my map yaml file:

image: blank_map.pgm
resolution: 0.01
origin: [0, 0, 0]
occupied_thresh: 0.65
free_thresh: 0.196 # Taken from the Willow Garage map in the turtlebot_navigation package
negate: 0
width:  20
height: 20

Anyway I after many tries I foudn that the map is going to be resized every time I start the corresponding node:

[ INFO] [1412758776.217404554]: Using plugin "static_layer"
[ INFO] [1412758776.420654688]: Requesting the map...
[ INFO] [1412758776.643031834]: Resizing costmap to 600 X 600 at 0.010000 m/pix
[ INFO] [1412758776.741877357]: Received a 600 X 600 map at 0.010000 m/pix
[ INFO] [1412758776.769172167]: Using plugin "obstacle_layer"

and I m quite sure that causes the problem. Here and here I found similar problem but not the right solution.

How to solve this annoying problem?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2014-10-09 15:34:12 -0500

Andromeda gravatar image

updated 2014-10-09 15:35:48 -0500

I must say that the answer given by David was very helpful and works. But I should admit that as a simple workaround I've created a bigger map using Gimp. Just create a brand new plane with the dimension you want, the above reported map dimension is the dimension in pixel of the image. So if you want to create a map 20x20 [meter], just create with Gimp a page 2000x2000, save it as .pgm file and you are done. The big vantage is that you don t need to play too much with your global and local_costmap files. The map is going to be visualized in RViz very nicely.

The second thing that I discovered is that the origin of your map must be integer, since double doesn't work. So if you have let's say:

image: my_map.pgm
resolution: 0.01
origin: [-10, -10, 0]
occupied_thresh: 0.65
free_thresh: 0.196 # Taken from the Willow Garage map in the turtlebot_navigation package
negate: 0
width:  20  # m   Don't forget to create a file with 2000 pixel width
height: 20  # m   Don't forget to create a file with 2000 pixel height

then put origin [-10,-10,0] as int and not as double or float.

I hope that it helps

edit flag offensive delete link more
2

answered 2014-10-08 10:06:18 -0500

David Lu gravatar image

If you use a static costmap layer, the global costmap is automatically set to the size of that costmap.

edit flag offensive delete link more

Comments

Hello David. Since ths static costmap layer is something new for me, do you mean that the following link could help me? Am I pointing to the right direction?

Andromeda gravatar image Andromeda  ( 2014-10-08 11:31:44 -0500 )edit

That's probably not what you want. I would set static_map to false in your global costmap.

David Lu gravatar image David Lu  ( 2014-10-08 12:04:56 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-10-08 04:55:19 -0500

Seen: 921 times

Last updated: Oct 09 '14