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 !
Post score: 0
Comment by N.N.Huy on 2022-01-04:
Nice, thank you @Mike Scheutzow and @Osilva for your explanations. So I understand as the following steps:
- I have to subscribe the
- Then I have to transform the frame of the input coordination to the frame of costmap right ? Because my input is a coordination of map tf frame, but in the local costmap, I think it uses robot fame or something else, i am not sure.
- Then I can use
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?
Comment by Mike Scheutzow on 2022-01-04:
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 an
int8, cost probably scaled down to range 0-100 - you should verify that.