Skip to content

Running traversability with a real robot!

suchetanrs edited this page Sep 2, 2024 · 7 revisions

1. Clone this repository

  1. git clone -b traversability_integration https://github.com/suchetanrs/ORB-SLAM3-ROS2-Docker
  2. cd ORB-SLAM3-ROS2-Docker
  3. git submodule update --init --recursive --remote

2. Install Docker on your system

cd ORB-SLAM3-ROS2-Docker
sudo chmod +x container_root/shell_scripts/docker_install.sh
./container_root/shell_scripts/docker_install.sh

3. Build the image with ORB_SLAM3

  1. Build the image: sudo docker build -t orb-slam3-humble:22.04 .
  2. Add xhost + to your .bashrc to support correct x11-forwarding using echo "xhost +" >> ~/.bashrc
  3. source ~/.bashrc
  4. You can see the built images on your machine by running sudo docker images.

4. Running the container

  1. cd ORB-SLAM3-ROS2-Docker (ignore if you are already in the folder)
  2. sudo docker compose run orb_slam3_22_humble
  3. This should take you inside the container. Once you are inside, run the command xeyes and a pair of eyes should pop-up. If they do, x11 forwarding has correctly been setup on your computer.

5. Building the ORB-SLAM3 Wrapper

Launch the container using steps in (4).

cd /home/traversability/traversability_mapping && ./build.sh
cd /root/colcon_ws/
colcon build --symlink-install
source install/setup.bash
cd /root/trav_ws/
colcon build --symlink-install
source install/setup.bash

Important information:

Please consider using the VLP-16. Heavy lidars such as OS-128 can lead to very fast RAM memory exhaustion if loop closing is enabled (it is enabled for ORB-SLAM3).

Please rebuild the packages after making parameter changes. The information to do this is given in the upcoming sections.

After this, you need to set the parameters to be able to run traversability successfully.

Inside the docker container there are 3 configuration files you need to tune to run traversability with ORB-SLAM3. These changes are saved and you don't need to rebuild the docker container after making the change. However, you need to rebuild the packages within the container.

ORB-SLAM3 configuration.

The path of the file you need to edit inside the docker container is: /root/colcon_ws/src/orb_slam3_ros2_wrapper/params/gazebo_rgbd.yaml

You can ignore the parameters for IMU since we run ORB-SLAM3 only in the RGBD mode. Please make sure to edit the camera calibration parameters. If you are running this on a realsense D435i, have a look at these parameters and put them into gazebo_rgbd.yaml These parameters are not absolute, you may need to re-calibrate your realsense.

The second file you need to edit is: /root/colcon_ws/src/orb_slam3_ros2_wrapper/params/rgbd-ros-params.yaml

In this, you can leave everything untouched except for the topic names. The topic names are namespaced by default. The namespace is /robot_0. If you wish to use an absolute topic name, set the parameter values to /topic_name instead of topic_name.

If you are running the SLAM via ssh and not directly on the robot, set the visualization to false to avoid X server issues.

Traversability configuration.

There is one file you need to configure: /home/traversability/traversability_mapping/traversability_mapping/params/traversabilityParams.yaml.

This file has already been configured to use with ORB-SLAM3. The only thing you need to change is the transformation between the lidar and robot body. That is,

T_SLAMFrameToLidarFrame:
  quaternion:
    x: 0.0
    y: 0.2474
    z: 0.0
    w: 0.9689
  translation:
    x: 0.0
    y: 0.0
    z: 0.6

After making these edits, please rebuild the everything using:

cd /home/traversability/traversability_mapping && ./build.sh
cd /home/orb/ORB_SLAM3 && ./build.sh
cd /root/trav_ws/
colcon build --symlink-install
source install/setup.bash
cd /root/colcon_ws/
colcon build --symlink-install
source install/setup.bash

You can use this https://www.andre-gaschler.com/rotationconverter/ to find your values in quaternion. The existing parameter is for a lidar pointed to the front of the robot (You can see how it is placed in the simulation)

Running the traversability.

ros2 launch orb_slam3_ros2_wrapper unirobot.launch.py