sample_depth_estimation sample application estimates per-pixel depth maps from RGB images using ROS 2 nodes. It uses the Qualcommยฎ AI Engine Direct SDK (QNN) for on-device model inference.
sample_depth_estimation accepts an RGB image named input_image.jpg as input or subscribes to the /sample_container/cam0_stream1 topic from the qrb_ros_camera node. It publishes the depth estimation results as a per-pixel depth map to the /sample_container/depth_map topic.
Note
- For more information, see the sample_depth_estimation GitHub repository.
- This model comes from Depth Anything V2, in which depth refers to the distance from the camera to each point in the image, estimated using a deep convolutional neural network.
Figure: Sample effects of sample_depth_estimat
Pipeline flow for sample_depth_estimation
Figure: Pipeline flow for sample_depth_estimation
ROS nodes used in the sample_depth_estimation pipeline
ROS topics used in the sample_depth_estimation pipeline
| ROS Topic | Type | Description |
|---|---|---|
/image_raw | sensor_msgs.msg.Image | Published image information, from image_publisher. Subscribed with an absolute name, so it is not namespaced. |
/sample_container/cam0_stream1 | sensor_msgs.msg.Image | Camera image stream, from qrb_ros_camera. |
/sample_container/qrb_inference_input_tensor | qrb_ros_tensor_list_msgs.msg.TensorList | Preprocess message. |
/sample_container/qrb_inference_output_tensor | qrb_ros_tensor_list_msgs.msg.TensorList | Postprocess message. |
/sample_container/depth_map | sensor_msgs.msg.Image | Contains per-pixel depth values as a color map. |
NoteThe launch files put every node in the
sample_container namespace, so the sampleโs topics are prefixed with /sample_container/. Only /image_raw is subscribed with an absolute name and therefore stays global.Prerequisites
You have completed the following settings in Set up the environment for running sample applications.- Set up the device
- Set up the host docker
Run out-of-the-box sample_depth_estimation
Try me
Try me
1
Run the sample on the development kit
SSH Session
2
View the depth estimation result on the host computer
- Start a terminal and run the following command to check the depth estimation result.
SSH Session
- Start the
rqtto view the depth estimation result on the host docker, for more information, see rqt.SSH Session - Select the following buttons in sequence. Plugins โ> Visualization โ> Image View
- Select topic
/sample_container/depth_mapby manual on rqt gui, then picture show onrqtsuccessfully.
Build and run sample_depth_estimation
The following steps build the sample_depth_estimation package using Dragonwing IQ-9075 Evaluation Kit as an example.
Try me
Try me
1
Build and package on the host computer
- Build the sample application project.
SSH Session
- Package and push the sample application to the device.
SSH Session
2
Install and run on the development kit
- Install the sample application.
SSH Session
- Run the sample application with the steps in Run out-of-the-box sample_depth_estimation.

