Code Monkey home page Code Monkey logo

orb_slam3_ros_wrapper's Introduction

ROS wrapper for ORB-SLAM3

A ROS wrapper for ORB-SLAM3. The main idea is to use the ORB-SLAM3 as a standalone library and interface with it instead of putting everything together. For that, you can check out this package.

Tested with ORB-SLAM3 V1.0, primarily on Ubuntu 20.04.

  • Pros:
    • Easy to update ORB-SLAM3 indepedently.
    • Easy to replace different variants that are not built for ROS.
  • Cons:
    • Dependent on the exposed APIs from ORB-SLAM3.
    • Development involves more steps (1. Make changes in ORB-SLAM3 library -> 2. Build ORB-SLAM3 -> 3. Change the roswrapper if necessary -> 4. Test).
    • Might break when dependencies or upstream changes.

Installation

General guide: first, install ORB-SLAM3 normally with all of its dependencies (any location is fine). Then, install this package in a catkin build environment.

1. ORB-SLAM3

cd ~
git clone https://github.com/UZ-SLAMLab/ORB_SLAM3.git ORB_SLAM3
  • Make changes to the source code if necessary to build successfully. For Ubuntu 20.04, you will need to change CMakeList from C++11 to C++14. I have incorporated the changes in this fork.
  • Build:
cd ORB_SLAM3
chmod +x build.sh
./build.sh
  • Make sure that libORB_SLAM3.so is created in the ORB_SLAM3/lib folder. If not, check the issue list from the original repo and retry.

2. orb_slam3_ros_wrapper

  • Clone the package. Note that it should be a catkin build workspace.
cd ~/catkin_ws/src/
git clone https://github.com/thien94/orb_slam3_ros_wrapper.git
  • Open CMakeLists.txt and change the directory that leads to ORB-SLAM3 library at the beginning of the file (default is home folder ~/)
cd ~/catkin_ws/src/orb_slam3_ros_wrapper/
nano CMakeLists.txt

# Change this to your installation of ORB-SLAM3. Default is ~/
set(ORB_SLAM3_DIR
   $ENV{HOME}/ORB_SLAM3
)
  • Build the package normally.
cd ~/catkin_ws/
catkin build
  • Next, copy the ORBvoc.txt file from ORB-SLAM3/Vocabulary/ folder to the config folder in this package. Alternatively, you can change the voc_file param in the launch file to point to the right location.

  • (Optional) Install hector-trajectory-server to visualize the trajectory.

sudo apt install ros-[DISTRO]-hector-trajectory-server
  • If everything works fine, you can now try the different launch files in the launch folder.

3. How to run

EuRoC dataset:

  • In one terminal, launch the node:
roslaunch orb_slam3_ros_wrapper euroc_monoimu.launch
  • In another terminal, playback the bag:
rosbag play MH_01_easy.bag

Similarly for other sensor types.

Topics

The following topics are published by each node:

  • /orb_slam3/map_points (PointCloud2): all keypoints being tracked.
  • /orb_slam3/camera_pose (PoseStamped): current left camera pose in world frame, as returned by ORB-SLAM3.
  • tf: transformation from camera frame to world frame.

Params

  • Enable / disable pangolin viewer: enable_pangolin
  • For monocular/stereo case, use world_roll, world_pitch, world_yaw in the launch file to rotate the world frame if necessary (otherwise the first KF will be the world frame). The world frame will be rotated by the provided roll-pitch-yaw angles (in rad) in that order.

XYZ Instructions

Tested with ORB-SLAM3 V1.0, Ubuntu 20.04, OpenCV 4.2.0 ** I did not test the authors forked version of ORB SLAM3

  • First you will need to set ORB_SLAM3_DIR in the cmake file
  • Next you will need to change voc_file in rs_d455_stereo_inertial.launch to point to the VOC file in your version of ORBSLAM3

Once Everything is built you can run the Boron node. I will demo how to do this with the bag 29-01-24_Boron_G02_test.bag

  • Navigate to wrapper root (the folder containing this file) and generate uniform IMU data.
python3 scripts/ProcessBoron.py bags/29-01-24_Boron_G02_test.bag bags/G02_imu.bag
  • In one terminal launch the orb_slam3_ros_wrapper with rs_d455_stereo_inertial
roslaunch orb_slam3_ros_wrapper rs_d455_stereo_inertial.launch 
  • In a second terminal play the rosbag
rosbag play 29-01-24_Boron_G02_test.bag G02_imu.bag 
  • In a third terminal record the runs pose & state
rosbag record -o g02 /orb_slam3/camera_pose /orb_slam3/state

orb_slam3_ros_wrapper's People

Contributors

thien94 avatar hcolesxyz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.