Robotics StackExchange | Archived questions

costmap_2d_ros,costmap values problem

hi. i have created a costmap2d::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.
thanks.

Asked by babaksn on 2015-03-22 07:36:06 UTC

Comments

Answers

255 is the unsigned equivalent of -1. The OccupancyGrid message (http://docs.ros.org/indigo/api/nav_msgs/html/msg/OccupancyGrid.html) stores values as signed 8 bit ints - int8, while the Costmap2D object uses the char type internally (equivalent to unsigned 8 bit ints - uint8).

Asked by paulbovbel on 2015-03-22 11:45:06 UTC

Comments

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.

Asked by babaksn on 2015-03-22 12:34:30 UTC

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.

Asked by paulbovbel on 2015-03-31 17:02:59 UTC