isaac_ros_dnn_stereo_decoder#
Source code available on GitHub.
Quickstart#
Set Up Development Environment#
Set up your development environment by following the instructions in getting started.
(Optional) Install dependencies for any sensors you want to use by following the sensor-specific guides.
Note
We strongly recommend installing all sensor dependencies before starting any quickstarts. Some sensor dependencies require restarting the development environment during installation, which will interrupt the quickstart process.
Build isaac_ros_dnn_stereo_decoder#
Activate the Isaac ROS environment:
isaac-ros activateInstall the prebuilt Debian package:
sudo apt-get update
sudo apt-get install -y ros-jazzy-isaac-ros-dnn-stereo-decoder
Install Git LFS:
sudo apt-get install -y git-lfs && git lfs install
Clone this repository under
${ISAAC_ROS_WS}/src:cd ${ISAAC_ROS_WS}/src && \ git clone -b release-4.5 https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_dnn_stereo_depth.git isaac_ros_dnn_stereo_depth
Activate the Isaac ROS environment:
isaac-ros activateUse
rosdepto install the package’s dependencies:sudo apt-get update
rosdep update && rosdep install --from-paths ${ISAAC_ROS_WS}/src/isaac_ros_dnn_stereo_depth/isaac_ros_dnn_stereo_decoder --ignore-src -y
Build the package from source:
cd ${ISAAC_ROS_WS} && \ colcon build --packages-up-to isaac_ros_dnn_stereo_decoder --base-paths ${ISAAC_ROS_WS}/src/isaac_ros_dnn_stereo_depth/isaac_ros_dnn_stereo_decoder
Source the ROS workspace:
Note
Make sure to repeat this step in every terminal created inside the Isaac ROS environment.
Because this package was built from source, the enclosing workspace must be sourced for ROS to be able to find the package’s contents.
source install/setup.bash
Run Launch File#
Continuing inside the Isaac ROS environment, install the following dependencies:
sudo apt-get update
sudo apt-get install -y ros-jazzy-isaac-ros-examples
Run the following launch file to start the decoder node:
ros2 launch isaac_ros_examples isaac_ros_examples.launch.py \ launch_fragments:=dnn_stereo_decoder \ min_disparity:=0.0 max_disparity:=10000.0
Visualize Output#
Open a new terminal and attach to the container:
isaac-ros activateIn the terminal, visualize the disparity output using the visualizer script:
ros2 run isaac_ros_dnn_stereo_decoder isaac_ros_dnn_stereo_visualizer.py
Troubleshooting#
Tensor and camera info timestamp mismatch#
Symptom#
Warning messages about timestamp mismatch between tensor and camera info:
[dnn_stereo_decoder] Tensor and camera info pair dropped due to timestamp mismatch - consider enabling 'cache_camera_info' parameter to process all tensor messages
Solution#
Enable camera info caching by setting the cache_camera_info parameter to true.
This mode caches the latest camera info and processes every tensor message independently
without requiring exact timestamp synchronization.
ros2 launch isaac_ros_examples isaac_ros_examples.launch.py \
launch_fragments:=dnn_stereo_decoder cache_camera_info:=true
Isaac ROS Troubleshooting#
For solutions to problems with Isaac ROS, refer to Troubleshooting.
API#
Overview#
The isaac_ros_dnn_stereo_decoder package provides a node that converts a disparity tensor
output from any DNN stereo model into a NitrosDisparityImage. The node subscribes to a disparity tensor and camera info,
applies GPU-accelerated filtering, and publishes the resulting disparity image.
Usage#
ros2 launch isaac_ros_examples isaac_ros_examples.launch.py launch_fragments:=dnn_stereo_decoder
DNNStereoDecoderNode#
ROS Parameters#
ROS Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
|
|
Name of the disparity tensor in the input TensorList message. |
|
|
|
Optional name of a confidence tensor. If set and |
|
|
|
Confidence threshold in range [0.0, 1.0] for masking low-confidence pixels. Only used if |
|
|
|
Minimum valid disparity value. Values below this are set to 0. |
|
|
|
Maximum valid disparity value. Values above this are set to 0. |
|
|
|
If |
|
|
|
QoS profile for input subscribers. |
|
|
|
QoS profile for output publisher. |
ROS Topics Subscribed#
ROS Topic |
Interface |
Description |
|---|---|---|
|
Input tensor list containing the disparity tensor (and optionally confidence tensor). |
|
|
The right camera model used to populate disparity parameters (focal length and baseline). |
ROS Topics Published#
ROS Topic |
Interface |
Description |
|---|---|---|
|
The processed NITROS disparity image with focal length and baseline parameters. |
Input Tensor Requirements#
The disparity tensor must be a float32 tensor.
Supported tensor shapes:
Rank-3:
[H, W, 1]or similarRank-4:
[N, C, H, W](batch dimension ignored)
If using confidence masking, the confidence tensor must have the same H×W dimensions as the disparity tensor.
Output Interpretations#
The output disparity image has the same dimensions as the input disparity tensor.
Disparity parameters are derived from the right camera info:
focal_length = P[0](first element of projection matrix)baseline = -P[3] / P[0](from projection matrix)min_disparityandmax_disparityfrom node parameters
Invalid disparity values are set to 0:
NaNorInfvaluesValues outside the
[min_disparity, max_disparity]rangeValues with confidence below
confidence_threshold(if confidence masking is enabled)