This repo contains a ROS implementation of a real-time landmark SLAM based on AprilTag and GTSAM. We use AprilTag as the front end, which alleviates the challengings in data association. Both CPU and CUDA versions of the AprilTag front end are included. We provide iSAM2 and batch fixed-lag smoother for SLAM and visual Inertia Odometry.
The package is initially built for a ZED2 camera running on Nvidia Jetson Xavier. However, it can be easily adapted for other sensors and other platforms. We have tested this on JetPack 5.0.2 and regular PC with Ubuntu 20.04, ROS Noetic and Nvidia GTX 1080Ti.
- Apriltag 3
- ROS Noetic
- A slightly modified version of GTSAM 4.1.1 built with gtsam_unstable.
-
If ZED SDK is not installed, you will not able to run SLAM that directly interface with ZED SDK. However, you can still run SLAM that subscribes to ROS topics. If you do not have ZED SDK, You will have to to add
-DUSE_ZED=OFF
flag to the catkin. -
CUDA 11+:
If CUDA is not enabled, we will only do SLAM with CPU based CUDA detector. Interface with ZED SDK will be turned off as well. If you do not have CUDA, You will have to to add
-DUSE_CUDA=OFF
flag to the catkin.Note: older JetPack with CUDA 10 should work as well, but we have not tested it.
-
OpenCV 4.6.0 with CUDA support:
First, complete an environment set up on your Ubuntu 20.04 machine like here. This will install
- ros-noetic
- zed-sdk
- GTSAM Release 4.1.1
- RoboStack (conda ROS environment) using a PySpline compiled .whl file
In the last step source set_startup_package
we build a ~/StartUp
directory similar to below. However, this also includes the Maestro-Controller-ROS
repository. To build AprilTagSLAM_ROS
on
its own, follow these instructions:
mkdir tagslam_ws
cd tagslam_ws
mkdir src
cd src
git clone https://github.com/SafeRoboticsLab/AprilTagSLAM_ROS.git
cd AprilTagSLAM_ROS
git checkout sdk_v4
cd ..
git clone https://github.com/AprilRobotics/apriltag.git
# We need compile cv_bridge from source files to avoid mixing OpenCV versions
git clone https://github.com/ros-perception/vision_opencv.git
cd vision_opencv
git checkout noetic
cd ../..
# build
source /opt/ros/noetic/setup.bash
catkin_make_isolated
Checkout the settings in config/config.yaml.
source devel_isolated/setup.bash
roslaunch tagslam_ros zed_sdk.launch