Update: I implemented the following piece of code (I hope you will forgive the bad organisation and the lack of imagination for the names):
void cloud_cb(const moveit_msgs::PlanningScenePtr& input)
{
moveit_msgs::PlanningScene::Ptr my_planning_scene(new moveit_msgs::PlanningScene);
*my_planning_scene = *input;
moveit_msgs::PlanningSceneWorld my_world = (*my_planning_scene).world;
moveit_msgs::PlanningSceneWorld::Ptr real_map(&my_world);
octomap_msgs::OctomapWithPose octomap_pose_content = (*real_map).octomap;
octomap_msgs::OctomapWithPose::Ptr octomap_pose(&octomap_pose_content);
octomap_msgs::Octomap octomap_content = (*octomap_pose).octomap;
octomap_msgs::Octomap::Ptr octomap(&octomap_content);
octomap::AbstractOcTree* my_map = octomap_msgs::binaryMsgToMap(octomap_content);
}
It works, or at least until before the conversion to AbstractOcTree, because when I build it, I need to include the header <octomap/AbstractOcTree.h>, and along with that all the other headers in the same folder for letting it work. Nevertheless, when I do so, I have the problem that "OcTreeBaseSE.hxx:83:31: error: ‘octomap::point3d’ has no member named ‘norm2’". And indeed, for a point3d type only .norm is defined, I couldn't find any .norm2. So I guess there is a bug in what I downloaded. I didn't directly install it, since it came along with the robot, but in any case if I run 'sudo apt-get install ros-indigo-octomap', I have the latest version. How do I solve this?