Welcome to RDK X5 Robot repository
1. Use of Depth Camera
Use of Depth Camera
Use of Depth Camera1.1, Program Function Description1.2, program code reference path1.3, program startup1.4, Image visualization1.4.1, rqt_image_view1.4.2, rviz21.4.3, Web display
Before driving the depth camera, you need to identify the Astra camera device on the car side. The environment has been set up in the system image. After SSH connects to the car, enter in the terminal,
xxxxxxxxxxll /dev/astra*

The result is shown in the figure, indicating that the Astra camera device is successfully connected. If no result is displayed, you can try to re-plug the camera USB.
1.1, Program Function Description
After the program runs, drive the Astra camera, you can get color RGB, depth Depth, infrared IR image information and depth point cloud information.
Basic SDK, document download address: https://gitee.com/orbbecdeveloper/OrbbecSDK OrbbecViewer tool download address: https://github.com/orbbec/OrbbecSDK/releases ROS related documents and SDK: https://github.com/orbbec/OrbbecSDK_ROS1.git https://github.com/orbbec/OrbbecSDK_ROS2.git PythonSDK download path: https://github.com/orbbec/pyorbbecsdk
1.2, program code reference path
After SSH connects to the car, the location of the function source code is,
xxxxxxxxxx/home/sunrise/software/library_ws/src/ros2_astra_camera/astra_camera/launch
1.3, program startup
launch startup command,
| launch file | camera model |
|---|---|
| ros2 launch astra_camera astra_pro.launch.xml | Astrapro |
| ros2 launch astra_camera astro_pro_plus.launch.xml | Astraproplus |
| ros2 launch astra_camera astra.launch.xml | Astramini |
Take the launch of the Astraproplus camera as an example. After SSH connects to the car, enter in the terminal,
xxxxxxxxxxros2 launch astra_camera astro_pro_plus.launch.xml

You can use the following command to view the topic. Enter in the virtual machine terminal,
xxxxxxxxxxros2 topic list

The main topics are as follows,
| Topic name | Topic content |
|---|---|
| /camera/color/image_raw | RGB color image data |
| /camera/depth/image_raw | Depth depth image data |
| /camera/depth/points | Depth depth point cloud data |
| /camera/ir/image_raw | IR infrared image data |
1.4, Image visualization
After the camera is started, the topic image can be displayed in the following ways.
1.4.1, rqt_image_view
Use rqt_image_view tool to view image data, enter in the virtual machine terminal,
xxxxxxxxxxros2 run rqt_image_view rqt_image_view
Then select the corresponding image topic to be displayed in the upper left corner. Here, we take the display of RGB image as an example.

1.4.2, rviz2
Use rviz2 to display image or depth point cloud, enter in the virtual machine terminal,
xxxxxxxxxxrviz2
It is necessary to change Fixed Frame to camera_link
View color image


View depth image


View infrared images
You can modify the plugin topic directly

(2) Add depth point cloud information in rviz,

View point cloud information


1.4.3, Web display
In the subsequent courses on depth camera related functions, they are all developed based on the ROSboard tool to achieve web interaction. Here, this tool is used to display images.
After SSH connects to the car, enter in the terminal,
xxxxxxxxxxros2 run rosboard rosboard_nodeThen open the PC browser (note that the computer and the Sunrise Network must be in the same LAN), enter the URL: car IP:9999, for example, my car IP is 192.168.2.84, enter the URL in the browser of the virtual machine to open the ROSboard web page:
xxxxxxxxxx192.168.2.84:9999

Click the button in the upper left corner to display the current ROS topics. We can select one or more image topic data to display:
