A ROS 2 pipeline that estimates dense metric depth from a monocular camera using Depth Anything V2, then feeds the generated RGB-D stream into ORB-SLAM3 for real-time visual SLAM. The system is evaluated on the KITTI Odometry dataset by comparing the estimated camera trajectories against the available ground-truth poses.
Depth estimation from a single RGB image.
ORB-SLAM3 running on the generated RGB-D stream. (Visualization may take a few seconds to load.)
ORB-SLAM3 is included as a git submodule inside the external/ directory.
Clone the repository with submodules:
git clone --recursive https://github.com/mhatre-shubham/RGBD_Visual_SLAM.gitInstall dependencies and build ROS 2 Package
colcon build --packages-select rgbd_slam
source install/setup.bashStart the ROS 2 pipeline:
ros2 launch rgbd_slam pipeline_launch.pyRunning ORB-SLAM3
cd external/ORB_SLAM3
./Examples/RGB-D/rgbd_tum \
Vocabulary/ORBvoc.txt \
Examples/RGB-D/KITTI_RGBD.yaml \
/path/to/dataset/ \
/path/to/generated_dataset/associations.txtThe project can also be executed without ROS2. This workflow processes an image sequence offline, generates metric depth maps, creates an RGB-D dataset compatible with ORB-SLAM3, and evaluates the estimated trajectory.
python3 scripts/offline_depth_estimation.pypython3 scripts/create_association.pycd external/ORB_SLAM3
./Examples/RGB-D/rgbd_tum \
Vocabulary/ORBvoc.txt \
Examples/RGB-D/KITTI_RGBD.yaml \
/path/to/dataset/ \
/path/to/generated_dataset/associations.txtpython scripts/plot_trajectory.pyRGBD_Visual_SLAM/
│
├── rgbd_slam/ # ROS 2 package
│ │
│ ├── src/
│ │ ├── kitti_publisher.py # Publishes KITTI RGB images
│ │ ├── depth_anything_node.py # Depth Anything V2 inference
│ │ └── slam_rgbd_sync_node.cpp # Synchronizes RGB and dept images for RGB-D SLAM
│ │
│ ├── launch/ # ROS 2 launch file
│ │ └── pipeline_launch.py
│ │
│ ├── CMakeLists.txt # ROS 2 build configuration
│ └── package.xml # ROS 2 package metadata
│
├── external/
│ └── ORB_SLAM3/ # ORB-SLAM3 as git submodule
│
├── scripts/
│ ├── offline_depth_estimation.py # Generate metric depth images using Depth Anything V2
│ ├── create_association.py # Create RGB-depth timestamp associations for ORB-SLAM3
│ ├── plot_trajectory.py # Compare estimated trajectory with KITTI ground truth
│ └── visualize_depth_estimation.py # Generate RGB-depth visualization videos for depth evaluation
│
├── results/ # Experimental results and visualizations
│ ├── depth_estimation.gif
│ ├── visual_slam.gif
│ └── trajectory_comparison.png
│
├── README.md
└── .gitignore



