Welcome to AI View Depth camera repository
1. Use of depth camera
1. Environment setup
This course takes Ubuntu20.04+ros-foxy as an example to explain how to build an environment and use a camera in a ros2 environment.
1. Install related dependencies
Terminal input,
xxxxxxxxxxsudo apt install libgflags-dev nlohmann-json3-dev libgoogle-glog-dev ros-foxy-image-transport ros-foxy-image-publisherHere, foxy** is modified according to the actual ros2 version**. If it is galactic, just change it to galactic.
2. Compile the function package
1) Create a workspace
Take the example of creating a workspace named orbbec_ws in the ~ directory,
xxxxxxxxxxmkdir orbbec_wscd orbbec_wsmkdir src2) Copy the function package to the workspace
Unzip the file, copy and paste the folder (function package) under src to the ~/orbbec_ws/src directory just created.
3) Compile
Terminal input,
xxxxxxxxxxcd ~/orbbec_wscolcon build4) Add environment variables
Terminal input,
xxxxxxxxxxecho "source ~/orbbec_ws/install/setup.bash" >> ~/.bashrc3) Install udev rules
Terminal input,
xxxxxxxxxxcd ~/orbbec_ws/src/OrbbecSDK_ROS2/orbbec_camera/scriptssudo bash install.shEnter the following command to check whether the rule file is loaded successfully and the camera is bound,
xxxxxxxxxx#astraproplusll /dev/astro_pro_plus#gemini maxll /dev/gemini

If the above picture appears, it means success.
4. Run the camera and view the image
Terminal input,
xxxxxxxxxx#astraproplus camera launchros2 launch astra_camera astro_pro_plus.launch.xml#gemini camera launchros2 launch astra_camera gemini.launch.xmlEnter the following command to view the topic information,
xxxxxxxxxxros2 topic list
Use the rqt_image_view tool to view the image, terminal input,
xxxxxxxxxxros2 run rqt_image_view rqt_image_viewColor image

Depth image

IR image

Select the topic in the upper left corner.
5. Run the camera and view the point cloud image
Terminal input,
xxxxxxxxxxros2 launch astra_camera gemini.launch.xmlYou can see the point cloud data released by the camera in rviz, terminal input,
xxxxxxxxxxrviz2

After opening rviz, set the visualization point cloud data as shown in the figure above.
