ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
You can use octomap_msgs/conversions.h just include this file and then you can use all the fuctions for example:
octomap_msgs::binaryMsgToMap(), to get the map from the octomap_binary, then you can iterate on the leafs of the tree as follows:
for (octomap::OcTree::leaf_iterator it = map->begin_leafs(); it != map->end_leafs(); ++it)
{ std::cout<< "Node center: " << it.getCoordinate();
std::cout<< " value: " << it->getValue()<< "\n"; }
check this slide could be helpfull
2 | No.2 Revision |
You can use octomap_msgs/conversions.h just include this file and then you can use all the fuctions for example:
octomap_msgs::binaryMsgToMap(), to get the map from the octomap_binary, then you can iterate on the leafs of the tree as follows:
for (octomap::OcTree::leaf_iterator it = map->begin_leafs(); it != map->end_leafs(); ++it) check this slide could be helpfull