Using rtabmap on a remote workstation
Hi,
@matlabbe, I have connected an asus xtion live pro camera to adroid xu4. The ros master is running on the odroid and I am subscribing the image data on my laptop through wifi (Both ROS distros are indigo). After that, I run the following command:
roslaunch rtabmap_ros rgbd_mapping.launch rtabmap_args:="--delete_db_on_start" rviz:=true rtabmapviz:=false
But, when I run this I don't see anything for the map building. Also, the image stream is really slow.
Do you know how I can solve this problem? Thank you.
Edit:
After applying the changes to the launch of the camera, these are the rqt_graph on (the ros master is on odroid):
1) odroid:
2) laptop:
Still, no success in getting the map.
Asked by MahsaP on 2016-07-21 08:06:10 UTC
Answers
If images are streamed from another computer, I would suggest to add compressed:=true
to your line:
$ roslaunch rtabmap_ros rgbd_mapping.launch rtabmap_args:="--delete_db_on_start" rviz:=true rtabmapviz:=false compressed:=true
Your remote computer will then subscribe to compressed image topics instead of the raw ones, saving a lot of network bandwidth.
You may also want to reduce the frame rate of your camera to ~10/15 Hz to save even more bandwidth, similar to this example. You could use rtabmap_ros/data_throttle nodelet on adroid to reduce the frame rate, if the driver used for the camera doesn't have the option. Here is an example loading the nodelet in the camera nodelet manager of your camera:
<group ns="camera">
<node pkg="nodelet" type="nodelet" name="data_throttle" args="load rtabmap_ros/data_throttle camera_nodelet_manager" output="screen">
<param name="rate" type="double" value="10.0"/>
<remap from="rgb/image_in" to="rgb/image_rect_color"/>
<remap from="depth/image_in" to="depth_registered/image_raw"/>
<remap from="rgb/camera_info_in" to="rgb/camera_info"/>
<remap from="rgb/image_out" to="data_throttled_image"/>
<remap from="depth/image_out" to="data_throttled_image_depth"/>
<remap from="rgb/camera_info_out" to="data_throttled_camera_info"/>
</node>
</group>
The line above would be modified with the correct topics:
$ roslaunch rtabmap_ros rgbd_mapping.launch rtabmap_args:="--delete_db_on_start" rviz:=true rtabmapviz:=false compressed:=true rgb_topic:=/camera/data_throttled_image depth_registered_topic:=/camera/data_throttled_image_depth camera_info_topic:=/camera/data_throttled_camera_info
EDIT
For the first example, you can verify that you are correctly receiving the compressed topics on the laptop with:
$ rostopic hz /camera/rgb/image_rect_color/compressed
$ rostopic hz /camera/depth_registered/image_raw/compressedDepth
EDIT 2
Making sure that ROS_IP
is set on both computers (to avoid a computer not seeing topics of the other), it works if I do this (well openni2_launch can be used instead of freenect_launch):
A) computer A:
$ roslaunch freenect_launch freenect.launch depth_registration:=true
B) computer B:
$ roslaunch rtabmap_ros rgbd_mapping.launch rtabmap_args:="--delete_db_on_start" rviz:=true rtabmapviz:=false compressed:=true
Make sure to uncheck Image display in RVIZ to avoid subscribing to raw image, which would results in 30 MB/sec bandwidth!! Removing the Image display or setting Transport hint
to "theora" instead of "raw", I have 3.5 MB/sec bandwidth. If I do the data_throttle
example with 10 Hz instead of 30 Hz framerate:
A) computer A:
$ roslaunch freenect_launch freenect.launch depth_registration:=true
$ roslaunch data_throttle.launch
B) computer B:
$ roslaunch rtabmap_ros rgbd_mapping.launch rtabmap_args:="--delete_db_on_start" rviz:=true rtabmapviz:=false compressed:=true rgb_topic:=/camera/data_throttled_image depth_registered_topic:=/camera/data_throttled_image_depth camera_info_topic:=/camera/data_throttled_camera_info
With this setup, I have now 1 MB/sec bandwidth.
cheers
Asked by matlabbe on 2016-07-21 09:29:47 UTC
Comments
@matlabbe thanks for the explanation. I modified the openni2.launch and added the section you said for the camera. Still no success. Also, without modifying openni2.launch if I run the first command you said I can't see anything in rviz.
Asked by MahsaP on 2016-07-21 10:42:31 UTC
Just to give more information: I am running openni2.launch on odroid and roslaunch rtabmap_ros rgbd_mapping.launch on my laptop.
Asked by MahsaP on 2016-07-21 11:41:18 UTC
Can you add your rqt_graph after launching vanilla openni2_launch on odroid and rtabmap with compressed:=true
? I also modified the answer above.
Asked by matlabbe on 2016-07-21 13:36:32 UTC
@matlabbe thanks. I updated the question.
Asked by MahsaP on 2016-07-22 04:25:09 UTC
see EDIT 2...
Asked by matlabbe on 2016-07-22 12:12:56 UTC
@matlabbe From what you said, the image stream is not that slow anymore. But, still I don't get any mapping. I just changed freenect_launch to openni2_launch, and also I unchecked the image display on Rviz.
Asked by MahsaP on 2016-07-25 07:01:30 UTC
I am getting the following warning (is it causing the problem?): [ WARN] rtabmap: Could not get transform from odom to camera_link after 0.200000 seconds (for stamp=1469447469.217299)!
Asked by MahsaP on 2016-07-25 07:03:07 UTC
[ WARN] Could not get odometry value for depth image 0 stamp (1469447469.217299s). Latest odometry stamp is 1469447469.248058s. The depth image pose will not be synchronized with odometry.
Asked by MahsaP on 2016-07-25 07:03:56 UTC
[ WARN] Save depth data to 16 bits format: depth type detected is 32FC1, use 16UC1 depth format to avoid this conversion (or set parameter "Mem/SaveDepth16Format=false" to use 32bits format). This message is only printed once..
Asked by MahsaP on 2016-07-25 07:04:15 UTC
Also, I checked the tutorial here. I don't have a problem with ROP_IP. because I can subscribe to the image topic on my laptop from the Odroid with no problem.
Asked by MahsaP on 2016-07-25 07:07:46 UTC
Is it necessary to have ~500 KiB/s of bandwidth? When I check system monitor on both systems sometimes the bandwidth is less than this value.
Asked by MahsaP on 2016-07-25 07:19:11 UTC
I don't have this node: points_xyzrgb. Do I need it? I see you have it in rqt_graph and also on remote_mapping launch file.
Asked by MahsaP on 2016-07-25 07:44:27 UTC
If you launch only the camera on odroid, and on the laptop you do (both at the same time in different terminals):
$ rostopic hz /camera/rgb/image_rect_color/theora
$ rostopic hz /camera/depth_registered/image_raw/compressedDepth
What are the frame rates?
Asked by matlabbe on 2016-07-25 08:56:01 UTC
If you are on wireless, I would also recommend to test first on ethernet.
Asked by matlabbe on 2016-07-25 08:58:12 UTC
points_xyzrgb is a nodelet started by rgbd_mapping.launch only when rviz:=true
Asked by matlabbe on 2016-07-25 08:59:41 UTC
@matlabbe for rostopic hz /camera/rgb/image_rect_color/theora for both odroid and laptop I get the rate between 8 and 11 for the second one I get something about 18 but sometimes no message is coming for laptop and a rate about 30 on odroid.
Asked by MahsaP on 2016-07-25 09:27:08 UTC
Do you think there is a problem in rqt_graph?
Asked by MahsaP on 2016-07-25 09:43:15 UTC
So, now instead of a laptop I am considering a pc. There is no difference. I don't know which part I am missing.
Asked by MahsaP on 2016-07-25 11:10:50 UTC
Now, on pc as computer B, I can see mapping but it is really really slow so I think I just have something on Rviz from one frame. After that nothing is getting updated. I get an error in terminal: process() RGB-D SLAM mode is enabled and no odometry is provided. Image 21 is ignored!
Asked by MahsaP on 2016-07-25 11:48:42 UTC
Are you on WI-FI or ethernet? You should have a steady image framerate for both RGB and depth streams if you want to do remote mapping.
Asked by matlabbe on 2016-07-25 15:56:00 UTC
I am on WI-FI. Is it possible to have a steady image framerate on wifi?
Asked by MahsaP on 2016-07-26 02:23:45 UTC
Well, if you have a reliable Wi-Fi network. I generally prefer to do mapping on the robot and do visualization on a remote computer (at low bandwidth ~ 100KB/sec, subscribing only on /rtabmap/mapData
topic). Even if the Wi-FI fails, the robot is still working until Wi-Fi reconnects.
Asked by matlabbe on 2016-07-26 08:08:35 UTC
@matlabbe Thanks for your explanation. Is there any tutorial how to do mapping on the robot?
Asked by MahsaP on 2016-07-26 09:41:36 UTC
If I do this on odroid is that sufficient: roslaunch rtabmap_ros rgbd_mapping.launch rtabmap_args:="--delete_db_on_start" rviz:=false rtabmapviz:=false
Asked by MahsaP on 2016-07-26 09:50:46 UTC
For visualization on pc from /rtabmap/mapData
what should I do?
Asked by MahsaP on 2016-07-26 09:52:59 UTC
You can look at the Raspberry Pi example for a similar setup. You can visualize /rtabmap/mapData
with the rtabmap_ros/MapCloud plugin in RVIZ.
Asked by matlabbe on 2016-07-26 10:33:46 UTC
Thanks for giving me an example. If I want to save the map on the robot, how is it possible?
Asked by MahsaP on 2016-07-26 10:54:23 UTC
$ cp ~/.ros/rtabmap.db saved_map.db
Asked by matlabbe on 2016-07-26 17:51:22 UTC
@matlabbe Finally, I can make a map on a remote station. Thanks for your explanation. My problem was related to the WiFi bandwidth. Now, everything is ok.
Asked by MahsaP on 2016-08-19 09:40:01 UTC
Comments