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.
FoundationStereo supports two fixed resolution configurations:
high_res: 576x960 resolution (default)
low_res: 320x736 resolution (original training resolution)
You can set the default model resolution using the FOUNDATIONSTEREO_MODEL_RES
environment variable. Use the --model_res argument to override the default or
to explicitly select between these options.
The high_res (576x960) model requires more than 16GB of VRAM, so it only works on GPUs with more than 16GB of VRAM.
Fast-FoundationStereo ONNX models are available from the
Fast-FoundationStereo GitHub repository.
Download the recommended ONNX model files from the linked Google Drive folder in the repository:
High Res (576x960):20_30_48_iters_4_res_576x960
Low Res (320x736):20_30_48_iters_4_res_320x736
Place the downloaded ONNX file and convert it to a TensorRT engine:
Repeat for the low resolution model if needed, saving as fast_foundationstereo_320x736.engine.
Note
Fast-FoundationStereo is a research model released under the
Fast-FoundationStereo license
and is not intended for commercial use. For commercial applications, use FoundationStereo.
FoundationStereo supports two fixed resolution configurations:
high_res: 576x960 resolution (default)
low_res: 320x736 resolution (original training resolution)
You can set the default model resolution using the FOUNDATIONSTEREO_MODEL_RES
environment variable. Use the --model_res argument to override the default or
to explicitly select between these options.
The high_res (576x960) model requires more than 16GB of VRAM, so it only works on GPUs with more than 16GB of VRAM.
Fast-FoundationStereo ONNX models are available from the
Fast-FoundationStereo GitHub repository.
Download the recommended ONNX model files from the linked Google Drive folder in the repository:
High Res (576x960):20_30_48_iters_4_res_576x960
Low Res (320x736):20_30_48_iters_4_res_320x736
Place the downloaded ONNX file and convert it to a TensorRT engine:
Repeat for the low resolution model if needed, saving as fast_foundationstereo_320x736.engine.
Warning
Fast-FoundationStereo is a research model released under the
Fast-FoundationStereo license
and is not intended for commercial use. For commercial applications, use FoundationStereo.
This tutorial requires a compatible RealSense camera from
the list of available
cameras.
Ensure that you have already set up your RealSense camera using the RealSense setup tutorial. If you have not, set up the sensor and then restart this quickstart from the beginning.
Continuing inside the Isaac ROS environment, install the following dependencies:
Complete steps to set up the FoundationStereo model as described in the
quickstart.
Continuing inside the Isaac ROS environment, run the following launch file to spin up a demo using a RealSense stereo camera:
Note
The RealSense camera defaults to a high frame rate (90 FPS) which can outrun FoundationStereo
inference, causing the streams to drop and the disparity output to stall within a minute of starting.
The commands below pass realsense_config_file pointing to realsense_stereo_low_fps.yaml
(provided in this package’s config directory), which lowers the infra streams to 15 FPS so the
camera does not outrun inference. If you still encounter drops, try the low resolution model or
lower the frame rate further by editing the profiles in that config file (supported 640x360 rates:
90, 60, 30, 15, 6).
If you are using the ZED X series, replace zed2_quickstart_interface_specs.json with zedx_quickstart_interface_specs.json in the above commands.
Note
The pub_frame_rate:=15.0 argument throttles the ZED node’s publish rate to 15 FPS so the camera
does not outrun FoundationStereo inference (which would otherwise cause dropped/out-of-sync frames
and stalled disparity output). Lower this value further if you still observe drops with the high
resolution model.
The isaac_ros_foundationstereo package offers functionality to generate a stereo
disparity map from stereo images using a trained FoundationStereo or Fast-FoundationStereo model. Given a pair
of stereo input images, the package generates a continuous disparity
image for the left input image. Fast-FoundationStereo is a drop-in replacement—simply
provide the Fast-FoundationStereo engine file path instead.
The package uses the DNNStereoDecoderNode
from the isaac_ros_dnn_stereo_decoder package to process the model output and generate the disparity map.
The isaac_ros_foundationstereo package outputs a disparity image with dimension same as the FoundationStereo model output dimension.
The input images are rescaled and padded to the FoundationStereo model input dimension
before inferencing. The disparity output is published as a continuous disparity map.
The disparity output is filtered to remove invalid values:
- Values below min_disparity (default: 0.0)
- Values above max_disparity (default: 10000.0)
- Invalid regions (inf, Nan) are set to 0.0
The right CameraInfo is used to composite a
NitrosDisparityImage. If you only care about the disparity
image, and don’t need the baseline and focal length information, you
can pass dummy camera messages.