Get cost value of a point in local costmap
Hi everyone, I want to get cost value of a specific point in local costmap. For example, i have a point and the position of this point is taken relative to map tf frame. Can you tell me how to check cost value of the point in local costmap of robot ?
Thank you and happy new year !
Nice, thank you @Mike Scheutzow and @osilva for your explanations. So I understand as the following steps:
/move_base/local_costmap/costmap
getCost()
function as @osilva said.So is the procedure I said above right ? And how can I do the transformation ? Can I use worldtomap to do the transformation?
Take a look at the
nav_msgs/OccupancyGrid
message. It has all the info you need to calculate an index into the cell grid. (0,0) is the lower left corner of the grid. Since each cell value is anint8
, cost probably scaled down to range 0-100 - you should verify that.