Before driving a depth camera, it is necessary for the host to be able to recognize the Astra camera device; When entering the Docker container, you need to mount this Astra device to recognize the camera in the Docker container. The supporting host has already been built in an environment and does not require additional configuration. If it is on a new host, a rule file needs to be added. The addition method is very simple. Copy the "/etc/udev rules. d/56 orbbec-usb rules" file from the host computer to the "/etc/udev rules. d" directory in the new environment, and then restart system
After the program runs, drive the Astra camera to obtain color RGB, depth, infrared IR image information, and depth point cloud information.
After entering the Docker container, the source code for this function is located at,
/root/yahboomcar_ros2_ws/software/library_ws/src/ros2_astra_camera/astra_camera/launch/
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 |
Taking starting the Astrapro camera as an example, after entering the Docker container, the terminal enters the following command:
xxxxxxxxxx
ll /dev/astra*
Taking the Astrapro camera as an example, after entering the Docker container, the terminal inputs the camera model,
Enter in the Docker terminal,
xxxxxxxxxx
ros2 launch astra_camera astra_pro.launch.xml
You can use the following command to view topics, enter in the Docker terminal,
xxxxxxxxxx
ros2 topic list
The main topics are as follows:
Topic Name | topical contents |
---|---|
/camera/color/image_raw | RGB color image data |
/camera/depth/image_raw | Depth image data |
/camera/depth/points | Depth point cloud data |
/camera/ir/image_raw | IR infrared image data |
Using rqt_ Image_ View tool to view image data, input in Docker terminal,
xxxxxxxxxx
ros2 run rqt_image_view rqt_image_view
Then select the corresponding image topic to be displayed in the upper left corner, taking displaying RGB images as an example,
Use rviz2 to display deep point clouds, input in Docker terminal,
xxxxxxxxxx
rviz2
Then add deep point cloud information in rviz,
Finally, modify the 【 Fixed Frame】 to 【camera_ Link 】 to view point cloud information,
If only depth information is needed, Astrapro and Astraproplus only need to start the following command,
xxxxxxxxxx
ros2 launch astra_camera astra.launch.xml
Viewing image data on web pages,
xxxxxxxxxx
ros2 run web_video_server web_video_server
Then open the browser, and the computer and host network must be on the same local area network. Enter the URL: your host IP+8080, for example, my host network IP is 192.168.2.53, and my dock container also uses the host network. Therefore, the network IPs of the two are the same, so enter the URL in the browser:
xxxxxxxxxx
http://192.168.2.53:8080/
Then, select one of the image topic data, such as displaying an rgb image, and select "image_raw" under "/camera/color/".