problem publishing octomap msg from an octomap file

asked 2016-12-07 09:10:01 -0600

Tenrampi gravatar image

Hello, I have a .bt file and would like to publish an octomap_msg that you can visualize in rviz.

i wrote the following node:

ros::Publisher octomap_pub = n.advertise<octomap_msgs::Octomap>("octomap_loaded", 1);
octomap_msgs::Octomap octomap;
octomap::OcTree myOctomap("fr_079.bt");
octomap_msgs::binaryMapToMsg(myOctomap, octomap);
pub_octomap.publish(octomap);

and i can visualize the topic "octomap_loaded" but when i try to visualize it in rviz using the occupancygrid under "status" i have the following message:

0 binary octomap messages received

What am I doing wrong? The message contains the publish octomap because I tried to save the contents to a file using myOctomap.writeBinary("map.bt"); and actually I create the same amount .bt file.

Thank You

edit retag flag offensive close merge delete

Comments

Did you manage to solve this problem? In my case, I actually am receiving the message but Rviz tells me that the octomap "type" is wrong, which is I believe the id of the message. This is set to "OcTree" which is a valid type as far as I know

HououinKyouma gravatar imageHououinKyouma ( 2017-09-29 03:11:18 -0600 )edit

Did you find a fix for this? This file has some related code. I am curious if there is an easier route.

balakumar-s gravatar imagebalakumar-s ( 2018-02-27 18:06:07 -0600 )edit