Welcome to RDK X3 Robot repository
1. Use depth camera
1. Use depth camera
1. Use depth camera1.1. Description of program function1.2. Program Code Reference path1.3. Program Startup1.4. Visualize images1.4.1 rqt_image_view1.4.2. rviz21.4.3. Web display
Before driving the depth camera, the Astra camera device needs to be identified at the cart end. The environment has been set up in the system image. After SSH connects to the car, type in the terminal,
xxxxxxxxxxll /dev/astra*

If the following figure is displayed, the Astra camera device is successfully connected. If no result is displayed, reinsert the camera USB.
1.1. Description of program function
After the program is run, Astra camera can be driven to obtain color RGB, Depth depth, infrared IR image information and depth point cloud information.
Official website link:https://orbbec3d.com/develop/
Astra Camera:https://github.com/orbbec/ros_astra_camera
Developer community:https://developer.orbbec.com.cn/download.html?id=53
1.2. Program Code Reference path
After SSH connection car, the location of the function source code is located at,
xxxxxxxxxx/userdata/software/astramini_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 Astrapro camera as an example, after SSH connection to the car, terminal input,
xxxxxxxxxxros2 launch astra_camera astra_pro.launch.xml

You can run the following command to view the topic, enter in the VM 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 Image data |
| /camera/depth/points | Depth Indicates the depth point cloud data |
| /camera/ir/image_raw | IR infrared image data |
1.4. Visualize images
After the camera is started, you can display the topic image in the following ways.
1.4.1 rqt_image_view
Use the rqt_image_view tool to view the 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, take the display of RGB images as an example.

1.4.2. rviz2
Use rviz2 to display images or deep point clouds, enter in the virtual machine terminal,
xxxxxxxxxxrviz2
(1) Add Image information to rviz.

Change Fixed Frame to camera_link and select a suitable Topic in the topic bar to display the image. Here, the depth map is shown as an example.

(2) Add depth point cloud information to rviz,

Change Fixed Frame to camera_link to view the point cloud information.

In fact, if you only need in-depth information, Astra pro just needs to launch the following command,
xxxxxxxxxxros2 launch astra_camera astra.launch.xml
1.4.3. Web display
In the subsequent courses related to the functions of depth camera, the ROSboard tool is developed to achieve web-side interaction. Here, the tool is preliminarily used for image display.
After SSH connects to the car, terminal input,
xxxxxxxxxxros2 run rosboard rosboard_nodeThen open the browser on the PC side (note that the computer and the Rising Sun network must be in the same LAN), enter the URL: car IP:9999, for example, my car IP is 192.168.2.67, enter the URL in the browser on the virtual machine side to open the ROSboard webpage:
xxxxxxxxxx192.168.2.67:9999

Click the button in the upper left corner to display the ROS topic that currently exists. We can select one or more image topic data to display.

For example, rgb images, depth images, and ir images are displayed here.
