-
Notifications
You must be signed in to change notification settings - Fork 61
Launching the Spot ROS 2 Driver
The Spot ROS 2 driver contains the topics, services, and actions necessary for controlling and getting data from the robot.
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 isFalse
. -
rviz_config_file
: RViz config file. No default, if you launch withlaunch_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 isTrue
. -
depth_registered_mode
: Choose betweendisable
,from_spot
, andfrom_nodelets
. Ifdisable
is set, do not publish registered depth images. Iffrom_spot
is set, request registered depth images from Spot through its SDK. Iffrom_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 isfrom_nodelets
. -
publish_point_clouds
: IfTrue
, 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 notdisable
. The default isFalse
. -
uncompress_images
: Choose whether to publish uncompressed images from Spot. The default isTrue
. -
publish_compressed_images
: Choose whether to publish compressed images from Spot. The default isFalse
. -
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 isFalse
.
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:
- You can set them as environment variables (
BOSDYN_CLIENT_USERNAME
,BOSDYN_CLIENT_PASSWORD
, andSPOT_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 ...
- You can specify them as parameters in your config yaml file (
username
,password
, andhostname
) which is passed in upon launching the driver. Say you have a config filespot_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 ...