How to convert point cloud data to map using octomap?
Hi people,
I am working with Kinect, I can see a point cloud with rviz from kinect, but I dont know what I have to do for convert the point cloud to a map, I dont know if I must write a node or if I can do it only with rviz, I am rookie and I was looking for an example.
Please can somebody help me?
Thanks
Asked by Rookie92 on 2015-08-03 09:32:34 UTC
Answers
The octomap_server package takes care of this conversion. You just have to launch it telling which topic is the pointcloud topic. Usually, the default topic will be OK. Then, just load the corresponding display in RViz and you should see the voxels.
Asked by Javier V. Gómez on 2015-08-03 09:46:35 UTC
Comments
I have install that package, but I dont know what I must to launch...
Do you think the topic /camera/depth_registered/points is a good topic to create a map?
Asked by Rookie92 on 2015-08-03 10:22:03 UTC
Try this out: https://github.com/OctoMap/octomap_mapping/blob/master/octomap_server/launch/octomap_mapping.launch You will have to change the remap of the camera topic. I recommend you to go over the code of the packages you are about to use, to see examples, and their doc. Don't simply use them.
Asked by Javier V. Gómez on 2015-08-03 10:45:25 UTC
In my case I am doing:
<node name="octomap_server" pkg="octomap_server" type="octomap_server_node">
<remap from="cloud_in" to="/camera/depth/points"/>
Asked by Javier V. Gómez on 2015-08-03 10:45:34 UTC
Ok one more question, when I am in Rviz, what kind of display must I visualize it in? and what topic must I put in Rviz I am not sure.
Thanks thanks and thanks
Asked by Rookie92 on 2015-08-03 11:26:03 UTC
From the octomap_server page: "occupied_cells_vis_array (visualization_msgs/MarkerArray) All occupied voxels as "box" markers for visualization in RViz. Be sure to subscribe to the topic occupied_cells_vis in RViz!"
Asked by Javier V. Gómez on 2015-08-03 11:45:50 UTC
I execute these commands:
roslaunch octomap_server octomap_mapping
roslaunch openni_launch openni.launch
rosrun openni_camera openni_node
rosrun rviz rviz
And I add MarkerArray and MarkerArrayTopic I subscribe to occupied_cells_vis_array or occupied_cells_vis, and I see nothing
Asked by Rookie92 on 2015-08-05 06:39:40 UTC
Just in case, run first roslaunch openni_launch openni.launch
(with this you do not need to run openni_node) and then roslaunch octomap_server octomap_mapping
. Check the name of the topics, as octomap_mapping launch file is listening to topic /narrow_stereo/points_filtered2
Asked by Javier V. Gómez on 2015-08-05 06:59:59 UTC
But openni publishes different topic names. You need to change that topic remap. Copy the launch file to a package of your catkin workspace and modify it according to your needs.
Asked by Javier V. Gómez on 2015-08-05 07:00:49 UTC
I copied octomap_mapping to my package and I think that I have remap to the correct topic: <remap from="cloud_in" to="/camera/depth_registered/points" />
If I subscribe a display PointCloud2 to that topic in rivz I can see a pointcloud,I think is the right topic.Which package do you use for kinect?
Asked by Rookie92 on 2015-08-05 09:50:35 UTC
I do not use the kinect, but the Asus and I subscribe to /camera/depth/points
but yours should be OK, it is the same but including color information. You cannot see the octomap in rviz yet?
Asked by Javier V. Gómez on 2015-08-05 10:19:19 UTC
No, I only can see pointcloud and I am a bit desesperate with rviz and kinect.
In rviz which is your fixed frame in global options?
Asked by Rookie92 on 2015-08-05 11:07:30 UTC
Then check you are actually getting the proper topics. Use rostopic, rosnode and rqt_graph to track what the messages flow is. Post an image of rqt_graph and probably I can help you.
Asked by Javier V. Gómez on 2015-08-05 11:24:28 UTC
This is rqt_graph image I have used rostopic list and rosnode list and I don't see nothing wrong, but I am noob. If I show a display map in rviz and I subscribe to /projected_map which is publishing, the message in display is: "No map received".
Asked by Rookie92 on 2015-08-06 04:39:25 UTC
Can you subscribe to rviz to occupied_cells_vis_array
and also do rostopic hz /occupied_cells_vis_array
?
Asked by Javier V. Gómez on 2015-08-06 05:24:39 UTC
Ok:
$ rostopic hz /occupied_cells_vis_array
subscribed to [/occupied_cells_vis_array]
I do:
$ rostopic echo /occupied_cells_vis_array
And I see nothing so I thing this topic is not publishing.
Asked by Rookie92 on 2015-08-06 09:32:35 UTC
If there is no more output then something is not OK. It is hard to help you with this. But just go through the documentation of octomap_server, it is not as difficult as it might seem.
Asked by Javier V. Gómez on 2015-08-06 09:52:55 UTC
But I dont understand...octomap_server must publish automaticly in that topic right?
Do you know if I can use display map in rviz to see the map subscribing to /projected_map?, the message in this display sais: "No map received"
Asked by Rookie92 on 2015-08-06 10:27:31 UTC
octomap_sever will publish in that topic if it has an subscribers and if it has the correct inputs. I do not remember, but you can do rostopic info /projected_map to see which display to use. But if you do not have a occupied cells message, you wont have any other output.
Asked by Javier V. Gómez on 2015-08-06 11:17:36 UTC
I am desperate, I dont know the reason but I cant get /occupied_cells_vis_array publish something. Have you any tutorial to learn mapping?
Asked by Rookie92 on 2015-08-12 10:22:10 UTC
Comments