This is a code-base for visual slam written by # Shangzhou Ye and it is working well for me with a ROS wrapper and I'm planning to use it to add loop closure, landmark based optimization and parallel thread to this code-base
Here is the link to the original code by Shangzhou Ye https://github.com/shangzhouye/stereo-visual-slam.git
This project built a stereo visual SLAM system from scratch. It has feature-based visual odometry using ORB features, and a keyframe-based map management and optimization backend. The system is integrated with ROS.
The system has six major components:
- Initialization
- Feature Detection/Matching
- Motion Estimation
- Map Management
- Bundle Adjustment
- Visualization Module
- cmake_module/: cmake modules.
- config/: config files.
- include/: c++ header files.
- src/: ROS node and C++ source code.
- launch/: launch file.
config/
├── kitti_config.rviz
└── kitti_param.yaml
include/
└── stereo_visual_slam_main
├── library_include.hpp
├── map.hpp
├── optimization.hpp
├── types_def.hpp
├── visual_odometry.hpp
└── visualization.hpp
launch/
└── run_vslam.launch
src/
├── stereo_visual_slam_main
├── map.cpp
├── optimization.cpp
├── types_def.cpp
├── visual_odometry.cpp
└── visualization.cpp
└── run_vslam.cpp
config/kitti_param.yaml
contains the path to the datasetlibrary_include.hpp
include libraries that are commonly used in the packagemap.hpp
definition of map management moduleoptimization.hpp
implementation of non-linear optimization using G2Otypes_def.hpp
definition of frame, landmark, feature structvisual_odometry.hpp
functions for the stereo visual odometryvisualization.hpp
the visualization modulerun_vslam.cpp
is the ROS node for running this system
- ROS Melodic (Link)
- OpenCV (Version 3.2)
- Eigen (Official Site)
- Sophus: Lie Groups Library (Link)
- G20: Graph Optimization Framework (Link)
- Install all the dependencies
fork
this repository, thengit clone
or build usingwstool
- Build the package
catkin_make -DCMAKE_BUILD_TYPE=Release
in release mode - Modify the path to KITTI dataset on your computer in
config/kitti_param.yaml
- To download KITTI dataset, go to this link.
- If Rviz visualization is needed, set
if_rviz
to true inconfig/kitti_param.yaml
- If writing estimated trajectory to file is needed, set
if_write_pose
to true inconfig/kitti_param.yaml
- To launch the system, do
source devel/setup.bash
androslaunch stereo_visual_slam_main run_vslam.launch