# praveenelango/ros2-fast-stereo architecture

> Architecture diagram of the GitHub repository praveenelango/ros2-fast-stereo, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/praveenelango/ros2-fast-stereo
- Repository: https://github.com/praveenelango/ros2-fast-stereo

## Overview

This ROS 2 workspace turns synchronized camera images into rectified stereo disparity, depth, and colored point clouds. The main path is camera configuration and projection, virtual-pinhole rectification, GPU stereo inference, then ROS publication; a parallel quad-stereo path batches four pairs for surround coverage. The graph also preserves the seven camera models and both configuration loaders. Relationships follow the README and SOURCE INDEX references; several implementation details are unsampled, so those connections are omitted rather than inferred.

Main entry points: [`src/camera_models/src/camera.cpp`](https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/camera_models/src/camera.cpp) (Camera abstraction), [`src/ffs_depth/src/ffs_node.cpp`](https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/ffs_depth/src/ffs_node.cpp) (Stereo ROS node), [`src/ffs_depth/src/quad_stereo_node.cpp`](https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/ffs_depth/src/quad_stereo_node.cpp) (Quad stereo node), [`src/ffs_depth/src/stereo_depth_estimator.cpp`](https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/ffs_depth/src/stereo_depth_estimator.cpp) (TensorRT estimator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_camera["Camera models"]
  node_camera_api["Camera abstraction<br/>[camera.cpp]"]
  node_pinhole["Pinhole model<br/>[pinhole_camera.cpp]"]
  node_double_sphere["Double Sphere model"]
  node_equirect["Equirectangular model"]
  node_fisheye_poly["Fisheye polynomial"]
  node_kb8["Kannala Brandt 8"]
  node_mei["Mei Omni model"]
  node_omni["Omni model<br/>[omni_camera.cpp]"]
  node_ros_config["ROS parameter loader"]
  node_yaml_config["YAML loader"]
end

subgraph group_rectification["Rectification"]
  node_reprojection["Reprojection maps<br/>[reprojection.cpp]"]
  node_stereo_pair["Virtual stereo pair<br/>[stereo_pair.cpp]"]
end

subgraph group_stereo["Stereo depth"]
  node_single_node["Stereo ROS node<br/>[ffs_node.cpp]"]
  node_frame_queue["Frame queue<br/>[frame_queue.hpp]"]
  node_single_estimator["TensorRT estimator"]
  node_depth_kernel["Depth conversion<br/>[depth_kernel.hpp]"]
  node_stereo_outputs["Depth and cloud outputs<br/>[ffs_node.cpp]"]
end

subgraph group_quad["Quad stereo"]
  node_quad_node["Quad stereo node"]
  node_quad_estimator["Batched estimator"]
  node_quad_outputs["Per-pair outputs"]
end

node_image_source(("ROS image sources"))
node_trt_engine["TensorRT engine"]

node_image_source -->|"sends synchronized images"| node_single_node
node_image_source -->|"sends four images"| node_quad_node
node_single_node -->|"loads camera parameters"| node_ros_config
node_quad_node -->|"loads camera parameters"| node_ros_config
node_ros_config -->|"configures models"| node_camera_api
node_yaml_config -->|"configures models"| node_camera_api
node_camera_api -->|"dispatches projection"| node_pinhole
node_camera_api -->|"dispatches projection"| node_double_sphere
node_camera_api -->|"dispatches projection"| node_equirect
node_camera_api -->|"dispatches projection"| node_fisheye_poly
node_camera_api -->|"dispatches projection"| node_kb8
node_camera_api -->|"dispatches projection"| node_mei
node_camera_api -->|"dispatches projection"| node_omni
node_single_node -->|"creates rectified pair"| node_stereo_pair
node_quad_node -->|"creates rectified pairs"| node_stereo_pair
node_stereo_pair -->|"precomputes remaps"| node_reprojection
node_single_node -->|"enqueues frames"| node_frame_queue
node_single_node -->|"runs inference"| node_single_estimator
node_single_estimator -->|"loads engine"| node_trt_engine
node_single_estimator -->|"converts disparity"| node_depth_kernel
node_single_node -->|"publishes results"| node_stereo_outputs
node_quad_node -->|"runs batched inference"| node_quad_estimator
node_quad_estimator -->|"loads batch engine"| node_trt_engine
node_quad_estimator -->|"converts disparity"| node_depth_kernel
node_quad_node -->|"publishes pair results"| node_quad_outputs

click node_camera_api "https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/camera_models/src/camera.cpp"
click node_pinhole "https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/camera_models/src/pinhole_camera.cpp"
click node_double_sphere "https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/camera_models/src/double_sphere_camera.cpp"
click node_equirect "https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/camera_models/src/equirect_camera.cpp"
click node_fisheye_poly "https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/camera_models/src/fisheye_poly_camera.cpp"
click node_kb8 "https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/camera_models/src/kannala_brandt8_camera.cpp"
click node_mei "https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/camera_models/src/mei_omni_camera.cpp"
click node_omni "https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/camera_models/src/omni_camera.cpp"
click node_ros_config "https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/camera_models/src/ros_cam_cfg_loader.cpp"
click node_yaml_config "https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/camera_models/src/yaml_cam_cfg_loader.cpp"
click node_reprojection "https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/perception_utils/src/reprojection.cpp"
click node_stereo_pair "https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/ffs_depth/src/stereo_pair.cpp"
click node_single_node "https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/ffs_depth/src/ffs_node.cpp"
click node_frame_queue "https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/ffs_depth/include/ffs_depth/frame_queue.hpp"
click node_single_estimator "https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/ffs_depth/src/stereo_depth_estimator.cpp"
click node_depth_kernel "https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/ffs_depth/include/ffs_depth/depth_kernel.hpp"
click node_stereo_outputs "https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/ffs_depth/src/ffs_node.cpp"
click node_quad_node "https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/ffs_depth/src/quad_stereo_node.cpp"
click node_quad_estimator "https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/ffs_depth/src/quad_stereo_depth_estimator.cpp"
click node_quad_outputs "https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/ffs_depth/src/quad_stereo_node.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_camera_api,node_pinhole,node_double_sphere,node_equirect,node_fisheye_poly,node_kb8,node_mei,node_omni,node_ros_config,node_yaml_config toneBlue
class node_reprojection,node_stereo_pair toneAmber
class node_single_node,node_frame_queue,node_single_estimator,node_depth_kernel,node_stereo_outputs toneMint
class node_quad_node,node_quad_estimator,node_quad_outputs toneRose
class node_image_source,node_trt_engine toneIndigo
```

## Components

### Camera models

- [Camera abstraction](https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/camera_models/src/camera.cpp): `src/camera_models/src/camera.cpp`
- [Pinhole model](https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/camera_models/src/pinhole_camera.cpp): `src/camera_models/src/pinhole_camera.cpp`
- [Double Sphere model](https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/camera_models/src/double_sphere_camera.cpp): `src/camera_models/src/double_sphere_camera.cpp`
- [Equirectangular model](https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/camera_models/src/equirect_camera.cpp): `src/camera_models/src/equirect_camera.cpp`
- [Fisheye polynomial](https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/camera_models/src/fisheye_poly_camera.cpp): `src/camera_models/src/fisheye_poly_camera.cpp`
- [Kannala Brandt 8](https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/camera_models/src/kannala_brandt8_camera.cpp): `src/camera_models/src/kannala_brandt8_camera.cpp`
- [Mei Omni model](https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/camera_models/src/mei_omni_camera.cpp): `src/camera_models/src/mei_omni_camera.cpp`
- [Omni model](https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/camera_models/src/omni_camera.cpp): `src/camera_models/src/omni_camera.cpp`
- [ROS parameter loader](https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/camera_models/src/ros_cam_cfg_loader.cpp): `src/camera_models/src/ros_cam_cfg_loader.cpp`
- [YAML loader](https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/camera_models/src/yaml_cam_cfg_loader.cpp): `src/camera_models/src/yaml_cam_cfg_loader.cpp`

### Rectification

- [Reprojection maps](https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/perception_utils/src/reprojection.cpp): `src/perception_utils/src/reprojection.cpp`
- [Virtual stereo pair](https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/ffs_depth/src/stereo_pair.cpp): `src/ffs_depth/src/stereo_pair.cpp`

### Stereo depth

- [Stereo ROS node](https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/ffs_depth/src/ffs_node.cpp): `src/ffs_depth/src/ffs_node.cpp`
- [Frame queue](https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/ffs_depth/include/ffs_depth/frame_queue.hpp): `src/ffs_depth/include/ffs_depth/frame_queue.hpp`
- [TensorRT estimator](https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/ffs_depth/src/stereo_depth_estimator.cpp): `src/ffs_depth/src/stereo_depth_estimator.cpp`
- [Depth conversion](https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/ffs_depth/include/ffs_depth/depth_kernel.hpp): `src/ffs_depth/include/ffs_depth/depth_kernel.hpp`
- [Depth and cloud outputs](https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/ffs_depth/src/ffs_node.cpp): `src/ffs_depth/src/ffs_node.cpp`

### Quad stereo

- [Quad stereo node](https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/ffs_depth/src/quad_stereo_node.cpp): `src/ffs_depth/src/quad_stereo_node.cpp`
- [Batched estimator](https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/ffs_depth/src/quad_stereo_depth_estimator.cpp): `src/ffs_depth/src/quad_stereo_depth_estimator.cpp`
- [Per-pair outputs](https://github.com/praveenelango/ros2-fast-stereo/blob/main/src/ffs_depth/src/quad_stereo_node.cpp): `src/ffs_depth/src/quad_stereo_node.cpp`

### Other components

- **ROS image sources**
- **TensorRT engine**

## Connections

- ROS image sources → Stereo ROS node: sends synchronized images (evidence: `README.md`)
- ROS image sources → Quad stereo node: sends four images (evidence: `README.md`)
- Stereo ROS node → ROS parameter loader: loads camera parameters
- Quad stereo node → ROS parameter loader: loads camera parameters
- ROS parameter loader → Camera abstraction: configures models (evidence: `src/camera_models/src/camera.cpp`)
- YAML loader → Camera abstraction: configures models
- Camera abstraction → Pinhole model: dispatches projection (evidence: `src/camera_models/src/camera.cpp`)
- Camera abstraction → Double Sphere model: dispatches projection (evidence: `src/camera_models/src/camera.cpp`)
- Camera abstraction → Equirectangular model: dispatches projection (evidence: `src/camera_models/src/camera.cpp`)
- Camera abstraction → Fisheye polynomial: dispatches projection (evidence: `src/camera_models/src/camera.cpp`)
- Camera abstraction → Kannala Brandt 8: dispatches projection (evidence: `src/camera_models/src/camera.cpp`)
- Camera abstraction → Mei Omni model: dispatches projection (evidence: `src/camera_models/src/camera.cpp`)
- Camera abstraction → Omni model: dispatches projection (evidence: `src/camera_models/src/camera.cpp`)
- Stereo ROS node → Virtual stereo pair: creates rectified pair
- Quad stereo node → Virtual stereo pair: creates rectified pairs
- Virtual stereo pair → Reprojection maps: precomputes remaps
- Stereo ROS node → Frame queue: enqueues frames
- Stereo ROS node → TensorRT estimator: runs inference
- TensorRT estimator → TensorRT engine: loads engine (evidence: `README.md`)
- TensorRT estimator → Depth conversion: converts disparity (evidence: `src/ffs_depth/src/stereo_depth_estimator.cpp`)
- Stereo ROS node → Depth and cloud outputs: publishes results (evidence: `src/ffs_depth/src/ffs_node.cpp`)
- Quad stereo node → Batched estimator: runs batched inference
- Batched estimator → TensorRT engine: loads batch engine (evidence: `README.md`)
- Batched estimator → Depth conversion: converts disparity (evidence: `src/ffs_depth/src/quad_stereo_depth_estimator.cpp`)
- Quad stereo node → Per-pair outputs: publishes pair results (evidence: `src/ffs_depth/src/quad_stereo_node.cpp`)
