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

costmap_2d_ros,costmap values problem

asked 2015-03-22 07:36:06 -0600

babaksn gravatar image

hi. i have created a costmap_2d::Costmap2DROS object , but it's values is only between 0 and 100.
when i visualized the 0 values on the rviz it shows the spaces that the robot doesnt have any conflit with obstacles which seems to be correct.
it doesnt have for example 255 values ( NO_INFORMATION ) while my /map topic has -1 (unknown space) values and also rviz shows the unknown spaces correctly from /map topic.
i am using hector slam for map building.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-03-22 11:45:06 -0600

paulbovbel gravatar image

255 is the unsigned equivalent of -1. The OccupancyGrid message ( ) stores values as signed 8 bit ints - int8, while the Costmap2D object uses the char type internally (equivalent to unsigned 8 bit ints - uint8).

edit flag offensive delete link more


in nav_msgs/OccupancyGrid Message ( the link you have given ) it says that The map data, in row-major order, starting with (0,0). Occupancy probabilities are in the range [0,100]. Unknown is -1. but in my message , there is no any -1 value while my /map topic has -1 values.

babaksn gravatar image babaksn  ( 2015-03-22 12:34:30 -0600 )edit

I'm not 100% on what you mean by 'my message', however, if you set a grid inside of Costmap2D, which is represented as a member of an array of chars, to 255, it will show up as -1 in the outgoing message.

paulbovbel gravatar image paulbovbel  ( 2015-03-31 17:02:59 -0600 )edit

Question Tools

1 follower


Asked: 2015-03-22 07:36:06 -0600

Seen: 545 times

Last updated: Mar 22 '15