Ask Your Question
0

costmap_2d local into image

asked 2015-02-24 10:34:26 -0500

Marcus gravatar image

Hello everyone,

I was wondering if there is already a function to convert the costmap_2d data into a image (or other kind of matrix, so that it is easier to search through).

I have managed to subscribe to the local costmap_2d and wanted to check particular areas by myself now. Unfortunately the format that I receive the costmap in is not very intuitive (at least for me). I was wondering if there is a simple conversion. If not, where can I find the convention on how the information is stored (columns, rows, height, width)?

here I saw it must be possible, just that I don t know how.

I am running ros hydro

Kind regards, Marcus

edit retag flag offensive close merge delete

Comments

You asked in my question to help u- I can give you the code (it basically uses openCV, hope it will help) http://pastebin.com/cspN42jv It is not a fully answer so i post it in comments

BP gravatar imageBP ( 2015-03-01 10:29:31 -0500 )edit

2 Answers

Sort by » oldest newest most voted
0

answered 2015-03-02 02:46:42 -0500

Procópio gravatar image

you can use the saveMap method from costmap_2D

edit flag offensive delete link more
0

answered 2015-03-01 19:20:34 -0500

David Lu gravatar image

You can visualize the costmap with rviz by adding a Map element. The description here mentions that its in row-major order. If map.info.width is X, the first X elements of the data array are the first row, and then the second X elements are the second row, etc.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-02-24 10:34:26 -0500

Seen: 232 times

Last updated: Mar 02 '15