[ROS2 Series] ORBBEC AstraPro camera performs rtabmap 3D mapping in ROS2

Table of Contents

background:

1. Driving AstraPro camera

2. Install rtabmap

error1: missing package

3. Try

4. Parameter explanation

5. Operation

error2: Did not receive data since 5 seconds!

6. Effect? Edit

error4:


Background:

1. Equipment: pc;jeston agx orin

2. Environment: Ubuntu20.04; ROS2 (Foxy)

3. Master-slave configuration, jeston agx orin is the host

4.jeston agx orin contains: AstraPro, lidar driver, Xingtian chassis control, voice interaction

5. Lidar 2D mapping, AstraPro driver, Xingtian chassis control, and voice interaction have been implemented so far

1. Driving AstraPro camera

https://github.com/orbbec/ros_astra_camera

Start the camera:
ros2 launch astra_camera astra_pro.launch.py

warning:

[component_container-1] [WARN] [1697708402.794392173] [camera.point_cloud_xyz]: [image_transport] Topics '/camera/depth/image_raw' and '/camera/depth/camera_info' do not appear to be synchronized. In the last 10s:
[component_container-1] Image messages received: 5
[component_container-1] CameraInfo messages received: 5
[component_container-1] Synchronized pairs: 0

2. Install rtabmap

https://github.com/introlab/rtabmap_ros

For specific operations, see [ROS2 series] ubuntu 20.04 testing rtabmap-CSDN blog

But I am using injeston agx orin

rosdep update & amp; & rosdep install --from-paths src --ignore-src -r -y
error1: missing package
sudo apt-get ros-foxy-
Note: The "_" in the following packages needs to be changed to "-"

Three, try

Since I am using an Obi medium-light camera, there is no official example. I also asked the maintainer in the issue:

Here is an example of zed:
ros2 launch zed_wrapper zed.launch.py

ros2 launch rtabmap_launch rtabmap.launch.py \
    rtabmap_args:="--delete_db_on_start" \
    rgb_topic:=/zed/zed_node/rgb/image_rect_color \
    depth_topic:=/zed/zed_node/depth/depth_registered \
    camera_info_topic:=/zed/zed_node/rgb/camera_info \
    frame_id:=base_link \
    approx_sync:=false \
    wait_imu_to_init:=true \
    imu_topic:=/zed/zed_node/imu/data \
    qos:=1 \
    rviz:=true

qos (Quality of Service) argument should match the published topics QoS (1=RELIABLE, 2=BEST EFFORT). ROS1 was always RELIABLE.

So here I choose to use qos=2.

Four. Parameter explanation

args:="-d --Mem/UseOdomGravity true --Optimizer/GravitySigma 0.3": This parameter is used to specify the command line parameters of RTAB-Map. Specifically, it includes the following command line parameters:

-d: Indicates that RTAB-Map deletes (clears) the previous database on startup to start building the map again.
--Mem/UseOdomGravity true: Enable RTAB-Map to use odometry information for gravity correction.
--Optimizer/GravitySigma 0.3: Set the gravity direction variance in RTAB-Map optimization to 0.3.
odom_topic:=/t265/odom/sample: This option specifies the topic of odometry information, usually used for fusion positioning and map construction.

frame_id:=t265_link: This option specifies the coordinate system used by RTAB-Map, usually the coordinate system of the camera or robot. Here, it is set to t265_link.

rgbd_sync:=true: This option means to enable synchronization of RGB-D data, ensuring that the RGB image and depth image have the same timestamp.

depth_topic:=/d400/aligned_depth_to_color/image_raw: This option specifies the topic of the depth image.

rgb_topic:=/d400/color/image_raw: This option specifies the topic of RGB images.

camera_info_topic:=/d400/color/camera_info: This option specifies the topic of camera information, including camera parameters and calibration information.

approx_rgbd_sync:=false: This option disables approximate synchronization of RGB-D data.

visual_odometry:=false: This option disables visual odometry (Visual Odometry).

queue_size:=30: This option specifies the message queue size used by the RTAB-Map node. Increasing the queue size can accommodate more messages to cope with inconsistent message publishing frequency.
frame_id:=base_link: This option specifies the coordinate system used by the RTAB-Map node, usually the coordinate system of the camera or robot. Here, it is set to base_link.

approx_sync:=false: This option is used to control the synchronization of RGB and depth images. When set to false, RGB and depth images are not forced into sync.

Five. Run

Enter ubuntu and view the camera topic

ros2 topic list
 ('rgb/image', '/camera/color/image_raw'),
          #('rgb/camera_info', '/camera/color/camera_info'),
          ('rgb/camera_info', '/camera/color/camera_info'),
          #('depth/image', '/camera/aligned_depth_to_color/image_raw'),
          ('depth/image', '/camera/depth/image_raw')]

When I try the command, I get a delay error

error2: Did not receive data since 5 seconds!
rtabmap_viz-3] [WARN] [1697700727.832576678] [rtabmap.rtabmap_viz]: rtabmap_viz: Did not receive data since 5 seconds! Make sure the input topics are published ("$ ros2 topic 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=20). 

There are many errors about this. I have read all the related solutions in the github issue, but they are not what I need. In the end, my executable command is:

ros2 launch rtabmap_launch rtabmap.launch.py \
    rtabmap_args:="--delete_db_on_start" \
    rgb_topic:=/camera/color/image_raw \
    depth_topic:=/camera/depth/image_raw \
    camera_info_topic:=/camera/color/camera_info \
    frame_id:=camera_link \
    use_sim_time:=true \
    approx_sync:=true \
    qos:=2 \
    rviz:=true \
    queue_size:=30

Six. Effects

At least 3 interfaces have images.

When I operate my robot, the image synchronization is too slow and the terminal reports an error.

error4:
[rtabmap_viz-3] [INFO] [1697708400.611813528] [rtabmap.rtabmap_viz]: rtabmap_viz stopping spinner...
[rtabmap-2] [ERROR] (2023-10-19 17:39:10.449) Rtabmap.cpp:1343::process() RGB-D SLAM mode is enabled, memory is incremental but no odometry is provided. Image 0 is ignored!
[rtabmap-2] [ERROR] (2023-10-19 17:39:11.367) Rtabmap.cpp:1343::process() RGB-D SLAM mode is enabled, memory is incremental but no odometry is provided. Image 0 is ignored!

I’ll update it later, I’m so tired and want to vomit. Why doesn’t my intel D435i display point clouds? ! !

The knowledge points of the article match the official knowledge files, and you can further learn relevant knowledge. Python entry skill treeHomepageOverview 382,140 people are learning the system