Skip to main content
Version: ROS 2 Humble

System

Proper networking setup is crucial in setting up the ROS 2 middleware and to ensure other onboard computers communicate reliably.

Username

The username indicates the username that will be used to run all ROS nodes. If this username needs to be changed then the robot services must be reinstalled as directed in the software installation instructions.

Hosts

The hosts section serves as a way to match hostnames to IP addresses. By default, Clearpath robots use the serial number as the hostname and have a default IP of 192.168.131.1. This section must define ip addresses for all hostnames that appear in the remainder of the robot.yaml file.

For example:

  hosts:
- hostname: cpr-a200-0000 # The robot computer
ip: 192.168.131.1
- hostname: offboard-computer
ip: 192.168.131.5

ROS 2 Environment

The ros2 section is necessary to set up the ROS 2 networking.

KeyValue / DatatypeDescription
namespacestringSpecified will be appended as a prefix to all sensor topics to prevent topics from being overloaded when multiple robots are on the same network and domain ID.
domain_idintegerSpecifies the ROS 2 domain ID to use.
middlewareSee BelowSpecifies the ROS 2 middleware settings.
workspaceslistIndicates a list of custom ROS 2 workspaces that need to be sourced by specifying the path to the setup.bash or set to [] to leave it blank

For example:

ros2:
username: administrator
namespace: a200_0000
domain_id: 0
middleware: # This section is described further below
implementation: rmw_fastrtps_cpp
workspaces:
- /home/administrator/colcon_ws/install/setup.bash # Path to the custom workspace

Middleware

The middleware section defines the which RMW Implementation to use and any related settings. To choose which implementation and discovery method is right for your project see networking.

KeyValue / DatatypeDescription
implementationrmw_fastrtps_cppDeclares the RMW Implementation to use. Currently only supports rmw_fastrtps_cpp.
discoverysimple or serverSelect simple for simple discovery and server for discovery server. (Defaults to simple)
profilestringAdvanced feature, allows an optional custom XML profile to be provided - RMW Implementation / vendor specific.
serverslistProvides a list of all discovery servers in the system and whether or not the robot should connect to them.

For example:

middleware:
implementation: rmw_fastrtps_cpp
discovery: simple
profile: path/to/profile.xml
servers: # This section is described further below
- hostname: cpr-a200-0000

Servers

This section is only used with eProsima Fast DDS Discovery Server (implementation: rmw_fastrtps_cpp and discovery: server).

note

This section must define every single discovery server in the system. This must include not only every discovery server that this robot is connecting to but also every discovery server that the offboard computer will connect to in the system.

Each server can be defined with a number of different parameters:

KeyValue / DatatypeDescription
hostnamestringThe hostname of the computer that is hosting the server (must be in the hosts list).
portintegerThe port at which to connect to the server (default is 11811).
enabledTrue or FalseThis indicates whether or not the robot should connect to this server and, if the hostname matches the computer's own hostname, whether or not to launch the server (default is True).

For example:

servers:
- hostname: cpr-a200-0000
port: 11811
enabled: True

Sample

Sample A200 System Section

In our sample, we have a Husky A200 platform whose primary computer has the hostname: cpr-a200-0000 and IP: 192.168.131.1.

By default, all Clearpath robots use the username administrator and the robot's namespace matches the serial_number.

system:
username: administrator
hosts:
- hostname: cpr-a200-0000
ip: 192.168.131.1
ros2:
namespace: a200_0000
domain_id: 0
middleware:
implementation: rmw_fastrtps_cpp
discovery: simple
workspaces: []

At this point, with just the serial_number and system defined, our robot is just the standard Husky A200 platform, and looks like this:

Default Husky A200