This repository is a ROS 2 adaptation of the original VINS-Fusion project. It supports visual-inertial odometry for both monocular and stereo camera setups, with optional GNSS/IMU fusion for global localization.
- Ported to ROS 2 (Humble and later)
- Compatible with stereo or monocular cameras
- Integration with IMU
- Supports tightly coupled sensor fusion
- Output of odometry and pose
- System
- Ubuntu 22.04
- ROS2 humble
- Libraries
- OpenCV (with CUDA enabled option)
- Ceres Solver-2.1.0 (you can refer here; just edit 1.14.0 to 2.1.0 for install.)
- Eigen-3.3.9
- glog
sudo apt-get install libgoogle-glog-dev libeigen3-dev libceres-dev libopencv-dev cd $(PATH_TO_YOUR_ROS2_WS)/src
git clone git@github.com:yangfuyuan/vins_fusion_ros2.git
cd ..
colcon build --symlink-install && source ./install/setup.bash && source ./install/local_setup.bash# vins
ros2 launch vins_fusion_ros2 vins_fusion_ros2.launch.pyUnfortunately, you cannot directly play a .bag file recorded in ROS 1 using ROS 2 tools like ros2 bag play.
This is because:
- ROS 1
.bagfiles are stored as a single binary file. - ROS 2
.bagfiles use a folder-based structure containing:- a
.db3SQLite3 database, - metadata YAML files.
- a
You can convert ROS 1 .bag files to ROS 2 .db3 format using rosbags.
pip install rosbagsIf you're using ~/.local/bin (default for user-level installs), you may need to add it to your shell PATH:
export PATH=$PATH:~/.local/binYou may also consider putting the above line in your .bashrc or .zshrc.
rosbags-convert --src foo.bag --dst /path/to/output_folderfoo.bag: your original ROS 1 bag file/path/to/output_folder: target folder where converted ROS 2.db3bag will be saved
Once conversion is complete, you can play it back using ROS 2 tools:
ros2 bag play /path/to/output_folderThe source code is released under GPLv3 license.
We are still working on improving the code reliability. For any technical issues, please contact Tong Qin <qintonguavATgmail.com>.
For commercial inquiries, please contact Shaojie Shen <eeshaojieATust.hk>.