This is a ROS2 package for BostonDynamics' Spot. The package contains all necessary topics, services and actions to teleoperate or navigate Spot. This package is derived of this ROS1 package. This package currently corresponds to version 3.2.0 of the spot-sdk
- Tested for Ubuntu 20.04 + Foxy
- Tested for Ubuntu 22.04 + Humble
In your ROS2 workspace src
directory, clone the repo:
git clone https://github.com/bdaiinstitute/spot_ros2.git
and initialize and install the submodules
cd spot_ros2
git submodule init
git submodule update
Then run the install script:
cd <path to spot_ros2>
./install_spot_ros2.sh
cd <ros2 ws>
source /opt/ros/humble/setup.bash
colcon build --symlink-install
source install/local_setup.bash
See the examples for some examples of using the ROS2 driver.
The spot login data hostname, username and password can either be specified as ROS parameters or as environment variables. If using ROS parameters, see spot_driver/config/spot_ros_example.yaml
for an example of what your file could look like. If using environment variables, define BOSDYN_CLIENT_USERNAME
, BOSDYN_CLIENT_PASSWORD
, and SPOT_IP
.
ros2 launch spot_description description.launch.py
ros2 launch spot_driver spot_driver.launch.py [config_file:=<path to your ROS config file>] [has_arm:=<True|False>]
ros2 launch spot_driver point_cloud_xyz.launch.py
The command_spot_driver
node contains service and action clients. To send a trajectory goal execute:
ros2 run spot_driver command_spot --ros-args -p command:=trajectory
If you want to use multiple robots, use the spot_driver_with_namespace
launch file:
ros2 launch spot_driver_with_namespace.py spot_name:=<spot name> config_file:=<path to your ROS config file>
This will launch all nodes in the spot_name
namespace and use spot_name/
as the prefix for all frames.
spot_msgs
are normally compiled as part of this repository. If you would prefer to install them as a debian package, follow the steps below:
wget -q -O /tmp/ros-humble-spot-msgs_0.0.0-0jammy_amd64.deb https://github.com/bdaiinstitute/spot_ros2/releases/download/spot_msgs-v0.0-0/ros-humble-spot-msgs_0.0.0-0jammy_amd64.deb
sudo dpkg -i /tmp/ros-humble-spot-msgs_0.0.0-0jammy_amd64.deb
rm /tmp/ros-humble-spot-msgs_0.0.0-0jammy_amd64.deb
The bosdyn_msgs
package is installed as a debian package as part of the install_spot_ros2
script because it's very large. It can be checked out from source here and then built as a normal ROS2 package if that is preferred (compilation takes about 15 minutes).
MIT license - parts of the code developed specifically for ROS2. BSD3 license - parts of the code derived from the Clearpath Robotics ROS1 driver.
To contribute, install pre-commit
via pip, run pre-commit install
and then run pre-commit run --all-files
to
verify that your code will pass inspection.
git clone https://github.com/bdaiinstitute/spot_ros2.git
cd spot_ros2
pip3 install pre-commit
pre-commit install
pre-commit run --all-files
Now whenever you commit code to this repository, it will be checked against our pre-commit
hooks. You can also run
git commit --no-verify
if you wish you commit without checking against the hooks.
This project is a collaboration between the Mobile Autonomous Systems & Cognitive Robotics Institute (MASKOR) at FH Aachen and the Boston Dynamics AI Institute.
MASKOR contributors:
- Maximillian Kirsch
- Shubham Pawar
- Christoph Gollok
- Stefan Schiffer
- Alexander Ferrein
Boston Dynamics AI Institute contributors:
- Jenny Barry
- Daniel Gonzalez
- Tao Pang
- David Surovik
- Jiuguang Wang
- David Watkins
Linköping University contributors:
- Tommy Persson