Read OctoMap file with Robotics System Toolbox

조회 수: 4 (최근 30일)
Sebastian
Sebastian 2018년 8월 16일
댓글: changcheng qiu 2018년 9월 29일
Hello,
I am trying to read OctoMap files like the ones that can be found here: OctoMap datasets
I have the Robotics System Toolbox which comes with the OccupancyMap3D class, but the documentation only shows how to read an OctoMap ROS message. In general, it seems that everything related to occupancy maps is restricted to be used with ROS. Alternatively, I could create a ROS message and fill the data field with the content of the file, however I lack understanding of the OctoMap file format (resolution, additional rgb data, octree).
Does anybody know how to import an OctoMap from file into Matlab?
Thank you in advance

채택된 답변

Sebastian Castro
Sebastian Castro 2018년 8월 17일
편집: Sebastian Castro 2018년 9월 11일
I don't think there's a direct way to read unless you parse the file yourself. As you said, you can either create your own file reader in MATLAB...
... or you can use the octomap_server package to publish a ROS message directly from the file, assuming it's a .bt file, and then subscribe to it from MATLAB.
rosrun octomap_server filename.bt
If it's a one-time thing, I'd recommend saving the OccupancyMap3D object as a .mat file in MATLAB so you can easily reload it later. Else, if the map is dynamically changing, you may as well use ROS pub-sub.
- Sebastian
  댓글 수: 7
changcheng qiu
changcheng qiu 2018년 9월 12일
Thanks for your help.When I type mapMsg = receive(mapSub), matlab will get into the loop and there will be no result for a long time.The error is as follows
changcheng qiu
changcheng qiu 2018년 9월 29일
I think I may know the reason of it.I was wrong at the beginning. The topic did not post a message when I rosrun octomap_server filename.what do you think about it?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Specialized Messages에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by