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
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
Did you find a fix for this? This file has some related code. I am curious if there is an easier route.