Welcome to NUWA-HP60C 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,
sudo 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 humble, just change it to humble.
2. Compile the function package
1), copy the workspace
Unzip the file and copy ascam_ros2_ws to the root directory

2), compile
Enter the ascam_ros2_ws workspace
xxxxxxxxxxcd ~/ascam_ros2_wsCheck the buil.sh file
xxxxxxxxxxls

Add running permissions
xxxxxxxxxxchmod a+x build.sh
Compile
xxxxxxxxxx./build.sh
When the prompt below appears, run the compilation command again until the prompt is successful


Note: If you use other architecture platforms, please open build.sh and modify it to your own architecture platform. If orbslam errors occur, you need to install orbslam related function packages first. Or remove orbslam related function packages and compile first. The supporting virtual machine does not need to be installed
3), add environment variables
Terminal input,
xxxxxxxxxxecho "source ~/ascam_ros2_ws/install/setup.bash" >> ~/.bashrc3, install udev rules
Terminal input,
xxxxxxxxxxcd ~/ascam_ros2_ws/src/ascamera/scriptssudo bash create_udev_rules.sh
If the above picture appears, it means success.
4. Modify the configuration file path
Check the location of the configuration file
xxxxxxxxxxcd ~/ascam_ros2_ws/src/ascamera/configurationfilespwd

Modify the launch file
xxxxxxxxxxcd ~/ascam_ros2_ws/src/ascamera/launchgedit hp60c.launch.py

Recompile
xxxxxxxxxxcd ~/ascam_ros2_ws./build.sh
Close the terminal after compiling
5. Run the camera and view the image
Open a new terminal and enter,
xxxxxxxxxx#Camera launchros2 launch ascamera hp60c.launch.pyEnter 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

Select the topic in the upper left corner.
6. Run the camera and view the point cloud image
Terminal input,
xxxxxxxxxxros2 launch ascamera hp60c.launch.pyYou 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.
