This repository is ROS2 wrapping to use ORB_SLAM3
-
I have tested on below version.
- Ubuntu 22.04
- ROS2 Humble
- OpenCV 4.5.4
-
Build ORB_SLAM3
- Follow the build instructions in the repo below . you may need to change the CMake version
- After you build and follow the instruction go to
home/<username>/<orbslam_directory>/Thirdparty/Sophus/buildand dosudo make install - You don't necessarly have to download opencv from source as specified in the repo below
- Go to this repo and follow build instruction.
-
Install related ROS2 package
$ sudo apt install ros-$ROS_DISTRO-vision-opencv && sudo apt install ros-$ROS_DISTRO-message-filters
- Clone repository to your ROS workspace
$ mkdir -p colcon_ws/src
$ cd ~/colcon_ws/src
$ git clone https://github.com/Melasmar-711/ORB_SLAM3_ROS2.git
$ git checkout RAMI_ORBSLAM3
Now, you are ready to build!
$ cd ~/colcon_ws
$ colcon build --symlink-install --packages-select orbslam3
- If you cannot find
sophus/se3.hpp:
Go to yourORB_SLAM3_ROOT_DIRand install sophus library.
$ cd ~/{ORB_SLAM3_ROOT_DIR}/Thirdparty/Sophus/build
$ sudo make install
- Please compile with
OpenCV 4.5.4version atleast.
- Source the workspace
$ source ~/colcon_ws/install/local_setup.bash
- before running the nodes
tar -xvzf <Your_Package_Dir>/vocabulary/ORBvoc.txt.tar.gz
- if you run the next command without specifying that you need the webcam the slam will run by subscribing to an image topic name
/sf/AUV/rgb_camera/image_colorwhich is the topic coming out of the simulation node.
ros2 run orbslam3 mono <Package_Dir>/vocabulary/ORBvoc.txt <Package_Dir>/config/monocular/sim_camera.yaml
- you can from the web cam using
ros2 run orbslam3 mono <Package_Dir>/vocabulary/ORBvoc.txt <Package_Dir>/config/monocular/web_cam.yaml --webcam
- you need a ros2 bag that have the images and imu reading streamed recorded . i still have to record a good one where the images aren't so distant from each other
ros2 run orbslam3 mono-inertial <Package_Dir>/vocabulary/ORBvoc.txt <Package_Dir>/config/monocular-inertial/mono_inertial_sim.yaml
This repository is modified from this repository.
working with ubuntu 22.04 and adding an option to run from a usb or web camera