thien94 / orb_slam3_ros_wrapper

A ROS wrapper for ORB-SLAM3. Focus on portability and flexibility.
166 stars 76 forks source link

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.

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

2. orb_slam3_ros_wrapper

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`](http://docs.ros.org/en/melodic/api/sensor_msgs/html/msg/PointCloud2.html)): all keypoints being tracked.
- `/orb_slam3/camera_pose` ([`PoseStamped`](http://docs.ros.org/en/melodic/api/geometry_msgs/html/msg/PoseStamped.html)): 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.