Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

problem publishing octomap msg from an octomap file

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