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

Static Map corner at origin for Navigation Stack

asked 2018-03-15 20:36:07 -0500

hni19 gravatar image

Going through the tutorials for the ROS Navigation stack, using a static map generated through gmapping.

This is done on a simulation. When to robot is initialized, it is located at the origin. I perform gmapping and the map is generated, centered around origin.

However, after launching the navigation stack, following the tutorial, the static map seems to have the corner located at origin, and thus leads to

[ WARN] [1521163803.387421877, 5297.630000000]: The origin for the sensor at (-0.10, 0.03) is out of map bounds. So, the costmap cannot raytrace for it.

image description image description

Note: If i add the map through map_server, and visualize it through RVIZ, then the map is properly centered with the center of the map on origin. I am vaguely aware about the ability to add offsets to the static map. But not too clear on how, and I feel as though static offsets arn't an ideal solution, if the size of the map can change.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-03-15 22:35:50 -0500

hni19 gravatar image

Just solved the issue. The navigation tutorial directs you to use the pgm (image file) of the map. Using the YAML file instead provides resolution as well as the correct origin offsets.

edit flag offensive delete link more

Comments

I had the same problem and solved the issue with this answer. Thank you! I did this change below in my move_base.launch(Refer to Section 2.5)

Previously:

<node name="map_server" pkg="map_server" type="map_server" args="$(find my_map_package)/my_map.pgm my_map_resolution"/>

For starting the map on origin of RvizGrid:

  <node name="map_server" pkg="map_server" type="map_server" args="$(find my_map_package)/my_map.yaml"/>
serhat gravatar image serhat  ( 2021-10-15 01:18:52 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2018-03-15 20:36:07 -0500

Seen: 921 times

Last updated: Mar 15 '18