Getting a 2D matrix from nav_msg/OccupancyGrid
Hello there! I am trying to "extract" a 2D matrix from OccupancyGrid data, so that i can create some random points for a pathfinding algorithm i am working on for my University Thesis, but i cant seem to find any good documentation on the subject. I am relatively new to ROS and i was wondering there are any suggestions on where i could look it up.
I running the hectorquadrotordemo package,on ROS Indigo for Ubuntu 14.04 Trusty, and trying to get the data from the /map topic (hector_mapping package).
Any help would be greatly appreciated!
Asked by GrimTS on 2017-06-16 17:43:58 UTC
Comments
You reviewed the message documentation here: http://docs.ros.org/kinetic/api/nav_msgs/html/msg/OccupancyGrid.html ?
Asked by BrannonKing on 2017-06-18 19:46:22 UTC
Yes i did, but i couldnt find a way to turn it from its data type into something closer to a 2D matrix. Sorry if i am missing something here, but i was under the impression i needed to manage the data in a certain way so i could generate the random points i need?
Asked by GrimTS on 2017-06-20 12:30:12 UTC
It sounds like you need some basic programming instruction: https://www.gamedev.net/forums/topic/631602-convert-1d-array-to-2d-array-c/
Asked by BrannonKing on 2017-06-20 17:41:37 UTC
Great! I'll give it a look! Thanks!
Asked by GrimTS on 2017-06-20 18:38:56 UTC