Skip to content

Launching the Spot ROS 2 Driver

Katie Hughes edited this page Sep 20, 2024 · 1 revision

The Spot ROS 2 driver contains the topics, services, and actions necessary for controlling and getting data from the robot.

Launching the Driver and Launch Arguments

To launch the ROS 2 driver for Spot, first build and source your ROS 2 workspace. Then, run the following command with the appropriate launch arguments:

ros2 launch spot_driver spot_driver.launch.py

The launch arguments can be viewed with ros2 launch spot_driver spot_driver.launch.py --show-args, but are also summarized below:

  • spot_name: Name of Spot, which will become the ROS namespace. Defaults to no name (i.e., no namespace).
  • config_file: Path to a configuration file for the driver, where additional parameters can be specified. No default.
  • launch_rviz: Choose whether to launch RViz. Default is False.
  • rviz_config_file: RViz config file. No default, if you launch with launch_rviz:=True a standard config for your robot will be auto-generated and used.
  • tf_prefix: apply namespace prefix to robot links and joints. No default -- you shouldn't need to modify this.

The following launch arguments for the driver are related to the image publishing from Spot. They are fed through the spot_driver.launch.py launchfile into the spot_image_publishers.launch.py launchfile.

  • launch_image_publishers: Choose whether to launch the image publishing nodes from Spot. Default is True.
  • depth_registered_mode: Choose between disable, from_spot, and from_nodelets. If disable is set, do not publish registered depth images. If from_spot is set, request registered depth images from Spot through its SDK. If from_nodelets is set, use depth_image_proc::RegisterNode component nodes running on the host computer to create registered depth images (this reduces the computational load on Spot's internal systems). The default is from_nodelets.
  • publish_point_clouds: If True, create and publish point clouds for each depth registered and RGB camera pair. Requires that the depth_register_mode launch argument is set to a value that is not disable. The default is False.
  • uncompress_images: Choose whether to publish uncompressed images from Spot. The default is True.
  • publish_compressed_images: Choose whether to publish compressed images from Spot. The default is False.
  • stitch_front_images: Choose whether to publish a stitched image constructed from Spot's front left and right cameras, similar to what is seen on the tablet. The default is False.

Spot Login Credentials

In order to log into a Spot, you need to specify the username, password, and hostname (IP address) of the robot. When launching the driver, these login credentials can be specified in two different ways:

  1. You can set them as environment variables (BOSDYN_CLIENT_USERNAME, BOSDYN_CLIENT_PASSWORD, and SPOT_IP), either directly in your terminal or through your .bashrc
$ export BOSDYN_CLIENT_USERNAME="<your username>"
$ export BOSDYN_CLIENT_PASSWORD="<your password>"
$ export SPOT_IP="<Spot's IP address>"
$ ros2 launch spot_driver spot_driver.launch.py ...
  1. You can specify them as parameters in your config yaml file (username, password, and hostname) which is passed in upon launching the driver. Say you have a config file spot_config.yaml that contains the following parameters:
$ cat spot_config.yaml
/**:
  ros__parameters:
    username: "<your username>"
    password: "<your password>"
    hostname: "<Spot's IP address>"

Then, you can launch the driver like:

$ ros2 launch spot_driver spot_driver.launch.py config_file:=spot_config.yaml ...
Clone this wiki locally