This guide provides instructions for setting up a simulation of the Boston Dynamics Spot robot using a ROS-based setup in Gazebo, enhanced with ORB-SLAM3 visual odometry.
- Ensure you have
sudo
privileges on your system. - ROS must be installed on your system.
-
Install Dependencies:
- Create a catkin workspace if you don't already have one:
cd ~/catkin_ws/src git clone -- https://github.com/ebasatemesgen/ORB-SLAM3-Enabled-Visual-Odometry-.git
- Install Python ROS dependencies:
sudo apt install -y python-rosdep
- Create a catkin workspace if you don't already have one:
-
Install ROS Dependencies:
cd ~/catkin_ws rosdep install --from-paths src --ignore-src -r -y
-
Build the Workspace:
catkin_make
-
Clone the Gazebo Models and Worlds Collection Repository:
git clone https://github.com/leonhartyao/gazebo_models_worlds_collection.git
-
Update Environment Variables:
- Update the
GAZEBO_MODEL_PATH
andGAZEBO_RESOURCE_PATH
in your~/.bashrc
file:echo "export GAZEBO_MODEL_PATH=\$GAZEBO_MODEL_PATH:<path to gazebo_models_worlds_collection repo>/models" >> ~/.bashrc echo "export GAZEBO_RESOURCE_PATH=\$GAZEBO_RESOURCE_PATH:<path to gazebo_models_worlds_collection repo>/worlds" >> ~/.bashrc source ~/.bashrc
- Replace
<path to gazebo_models_worlds_collection repo>
with the actual path.
- Update the
- Run the Spot robot simulation in Gazebo:
roslaunch spot_gazebo spot.launch world:=<world_file_name>
- Replace
<world_file_name>
with your desired Gazebo world file name.
- You can use any world file from the
gazebo_models_worlds_collection
repository or create custom Gazebo worlds.
ORB-SLAM3-ROS is a ROS implementation of ORB-SLAM3 V1.0, focusing on the ROS integration. This package uses catkin_make
and is tested on Ubuntu 20.04.
-
Eigen3:
sudo apt install libeigen3-dev
-
Pangolin:
cd ~ git clone https://github.com/stevenlovegrove/Pangolin.git cd Pangolin mkdir build && cd build cmake .. make sudo make install
-
OpenCV:
- Check your OpenCV version (minimum 3.0 required):
python3 -c "import cv2; print(cv2.__version__)"
- Follow the OpenCV installation instructions if a newer version is needed.
- Check your OpenCV version (minimum 3.0 required):
-
(Optional) Hector-Trajectory-Server:
- Install to visualize real-time camera/imu trajectories:
sudo apt install ros-[DISTRO]-hector-trajectory-server
- Install to visualize real-time camera/imu trajectories:
- Build the ORB-SLAM3-ROS package:
cd ~/catkin_ws catkin_make
The provided Bash script automates the process of launching various ROS nodes and simulations for the Spot robot setup. This script simplifies the process of starting the simulation and necessary nodes, ensuring a smooth and integrated experience.
-
Location of the Script: Ensure the script
play.sh
(or the name you've given it) is located in a suitable directory and has execute permissions. If not, usechmod +x play.sh
to make it executable. -
Running the Script: Execute the script by navigating to its directory and running:
./play.sh
This will sequentially start the necessary ROS nodes and open new terminal windows for each component.
Use the following command to record odometry data from the /odom
topic into a ROS bag:
rosbag record -O my_odom_data.bag /odom
Visualizing Odometry Data The odometry_visualizer.py script visualizes the robot's odometry data. It plots the trajectory based on the X and Y positions recorded in the ROS bag file.
Run the script after recording the data:
python3 odometry_visualizer.py
If you have odometry data from a real Boston Dynamics Spot robot, you can visualize this data using a similar approach.
To visualize the real robot's odometry data, use a pre-recorded ROS bag file named real_spot_data.bag
:
rosbag play real_spot_data.bag
This command plays back the recorded data, which can be visualized or processed further as needed.
To run tests on the actual Boston Dynamics Spot robot, use the following launch command:
roslaunch spot_config simulated_spot.launch
This launch file is configured to interface with the real Spot robot, allowing you to see the tests or experiments I did in a real-world environment.
- ORB-SLAM3 Original Repository: UZ-SLAMLab/ORB_SLAM3
- CHAMP Quadruped Robot: chvmp/champ
- CHAMP Teleoperation Package: chvmp/champ_teleop
- Spot Robot ROS Integration: chvmp/spot_ros (branch: gazebo)
- Additional Robot Models: chvmp/robots