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.
Key | Value / Datatype | Description |
---|---|---|
namespace | string | Specified 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_id | integer | Specifies the ROS 2 domain ID to use. |
middleware | See Below | Specifies the ROS 2 middleware settings. |
workspaces | list | Indicates 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.
Key | Value / Datatype | Description |
---|---|---|
implementation | rmw_fastrtps_cpp | Declares the RMW Implementation to use. Currently only supports rmw_fastrtps_cpp . |
discovery | simple or server | Select simple for simple discovery and server for discovery server. (Defaults to simple ) |
profile | string | Advanced feature, allows an optional custom XML profile to be provided - RMW Implementation / vendor specific. |
servers | list | Provides 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
).
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:
Key | Value / Datatype | Description |
---|---|---|
hostname | string | The hostname of the computer that is hosting the server (must be in the hosts list). |
port | integer | The port at which to connect to the server (default is 11811 ). |
enabled | True or False | This 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: