Posted by
karleno on
URL: http://official-rtab-map-forum.206.s1.nabble.com/Raytracing-using-stereo-camera-for-better-SLAM-and-obstacle-avoidance-tp5632p5701.html
Hi, thank you a lot for all the help and the great piece of software that is RTAB-MAP. I am the one working with "johanehr" on the autonomous drone exploration project, and am currently struggling a bit with remote mapping. Our current goal is off-loading the RTAB-MAP calculations to a laptop, and running all camera nodes on an on-board computer (Aaeon Up Board as previously mentioned). The camera we have is an Intel Realsense D435i camera, and I'm trying to follow the remote mapping tutorial found on this link:
Remote Mapping.
On the Up board, I run the following launch files:
1) "opensource_tracking_SUPERFAST_NO_RTABMAP.launch"
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43 | <launch>
<arg name="rate" default="5"/>
<arg name="approx_sync" default="false" />
<!-- Use same nodelet used by realsense2 -->
<group ns="camera">
<node pkg="nodelet" type="nodelet" name="data_throttle" args="load rtabmap_ros/data_throttle realsense2_camera_manager" output="screen">
<param name="rate" type="double" value="$(arg rate)"/>
<param name="compressed_rate" type="double" value="$(arg rate)"/>
<param name="approx_sync" type="bool" value="$(arg approx_sync)"/>
<!--
<remap from="color/image_raw" to="rgb/image_rect_color"/>
<remap from="depth/image_rect_raw" to="depth_registered/image_raw"/>
<remap from="color/camera_info" to="rgb/camera_info"/>
-->
<remap from="rgb/image_in" to="color/image_raw"/>
<remap from="depth/image_in" to="depth/image_rect_raw/"/>
<remap from="rgb/camera_info_in" to="color/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>
<node pkg="nodelet" type="nodelet" name="rgbd_sync" args="standalone rtabmap_ros/rgbd_sync" output="screen">
<remap from="rgb/image" to="color/image_raw"/>
<remap from="depth/image" to="depth/image_rect_raw"/>
<remap from="rgb/camera_info" to="color/camera_info"/>
<remap from="rgbd_image" to="rgbd_image"/>
<param name="approx_sync" value="$(arg approx_sync)"/>
</node>
</group>
</launch>
|
, and 2) "remotemappingtut.launch":
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43 | <launch>
<arg name="rate" default="5"/>
<arg name="approx_sync" default="false" />
<!-- Use same nodelet used by realsense2 -->
<group ns="camera">
<node pkg="nodelet" type="nodelet" name="data_throttle" args="load rtabmap_ros/data_throttle realsense2_camera_manager" output="screen">
<param name="rate" type="double" value="$(arg rate)"/>
<param name="compressed_rate" type="double" value="$(arg rate)"/>
<param name="approx_sync" type="bool" value="$(arg approx_sync)"/>
<!--
<remap from="color/image_raw" to="rgb/image_rect_color"/>
<remap from="depth/image_rect_raw" to="depth_registered/image_raw"/>
<remap from="color/camera_info" to="rgb/camera_info"/>
-->
<remap from="rgb/image_in" to="color/image_raw"/>
<remap from="depth/image_in" to="depth/image_rect_raw/"/>
<remap from="rgb/camera_info_in" to="color/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>
<node pkg="nodelet" type="nodelet" name="rgbd_sync" args="standalone rtabmap_ros/rgbd_sync" output="screen">
<remap from="rgb/image" to="color/image_raw"/>
<remap from="depth/image" to="depth/image_rect_raw"/>
<remap from="rgb/camera_info" to="color/camera_info"/>
<remap from="rgbd_image" to="rgbd_image"/>
<param name="approx_sync" value="$(arg approx_sync)"/>
</node>
</group>
</launch>
|
.
Now the first question is regarding the rgdb_sync nodelet, I don't quite understand whether stating that "approx_sync = false" is enough to make the D435i topics synced or if I need to run the nodelet as well. Also, I get different rqt_graph:s depending on whether I run the rgbd_sync nodelet as a "standalone" or if i "load" it together with the realsense2_camera_manager, as seen on line 32 in "remotemappingtut.launch". First, the graph when running nodelet as standalone:

and secondly by loading it, together with realsense2_camera_manager:

.
The two options yield different connections to the rgbd_sync nodelet, and I wonder which way is the correct one, if any of these?
The next question is regarding having odometry on the robot and throttling what's sent out of the robot. I've successfully throttled message with the help from this post:
How to use rtabmap_ros/data_throttle for Realsense camera? . The launch file that I run off-board looks like this ("opensource_tracking_only_rtabmap_throttled.launch"):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 | <launch>
<arg name="offline" default="false"/>
<include file="$(find rtabmap_ros)/launch/rtabmap.launch">
<arg name="compressed" value="true"/>
<arg name="args" value="--delete_db_on_start"/>
<arg name="rgb_topic" value="/camera/data_throttled_image"/>
<arg name="depth_topic" value="/camera/data_throttled_image_depth"/>
<arg name="camera_info_topic" value="/camera/data_throttled_camera_info"/>
<arg name="rtabmapviz" value="false"/>
<arg name="rviz" value="true"/>
<arg name="odom_topic" value="/odometry/filtered"/>
<arg name="visual_odometry" value="false"/>
<!--
<arg name="approx_sync" value="false"/>
<arg name="rgbd_sync" value="true"/>
<arg name="approx_rgbd_sync" value="false"/>
-->
<!--
<remap from="/camera/aligned_depth_to_color/image_raw/compressedDepth" to="/camera/data_throttled_image/compressedDepth" />
<remap from="/camera/color/image_raw/compressed" to="/camera/data_throttled_image/compressed" />
-->
</include>
<!-- <param name="/ukf_se/odom0_config" value="{true,true,true,}"/> -->
</launch>
|
In this file, odom_topic is set to /odometry/filtered and visual_odometry is false. What I try to achieve is to perform odometry on-board and throttling the messages that are sent over WiFi. However, eventhough when I run the off-board launch file with approx_sync:=false, the resulting output is as follows:
[ WARN] [1553848298.491931635]: /rtabmap/rtabmap: Did not receive data since 5 seconds! Make sure the input topics are published ("$ rostopic hz my_topic") and the timestamps in their header are set. If topics are coming from different computers, make sure the clocks of the computers are synchronized ("ntpdate"). If topics are not published at the same rate, you could increase "queue_size" parameter (current=10).
/rtabmap/rtabmap subscribed to (approx sync):
/odometry/filtered,
/camera/data_throttled_image_relay,
/camera/data_throttled_image_depth_relay,
/camera/data_throttled_camera_info
It should be added that the output after launching the on-board files confirm that exact sync is to be used (output of remotemappingtut.launch is
/camera/rgbd_sync subscribed to (exact sync):
/camera/color/image_raw,
/camera/depth/image_rect_raw,
/camera/color/camera_info
)
. Running rostopic hz for the relayed topics gives:
topic rate min_delta max_delta std_dev window
===========================================================================================
/camera/data_throttled_image_relay 4.074 0.1446 0.3659 0.05938 25
/camera/data_throttled_image_depth_relay 4.069 0.1454 0.3932 0.06352 25
/camera/data_throttled_camera_info 4.16 0.1434 0.3662 0.06035 25
Which suggests that the topics aren't synced. I'm not sure whether this poses a problem, will it matter if the sync is approximate?
Any help regarding these matters is appreciated and again, thanks for the great piece of software as well as active support here on the forums. Cheers!