Configuration

Everything xparo_ros needs is passed as ROS 2 parameters when you start it. Only the first two are required.

Build your command

Fill in the boxes and copy the result. The builder only adds the settings you change from their defaults.

The same thing written by hand:

ros2 launch xparo xparo_launch.py \
  xparo_project_id:=<your-project-id> \
  xparo_secret_key:=<your-secret-key>

The node is named /xparo_ros. The launch file can also start a ROS bag recorder for you (record_bags:=true).

ros2 run xparo xparo_ros --ros-args \
  -p xparo_project_id:=<your-project-id> \
  -p xparo_secret_key:=<your-secret-key>

The node is named /xparo.

Main settings

Parameter

Default

What it does

xparo_project_id

(none)

Required. The project to join. Copy it from the Dashboard page (Project Key (websocket routing id)) or from the Robots Fleet Add a robot dialog.

xparo_secret_key

(none)

Required for the first connection. A secret key generated on the Dashboard page. After the first connection the robot uses its own saved credential instead (see What the robot keeps on its own disk), and only falls back to this key if that credential is rejected.

xparo_stage

production

Which task stages this robot accepts: development runs every stage, testing runs testing/review/production, review runs review/production, production runs production only. New tasks start in development, so use xparo_stage:=development while you build and test.

xparo_environment

production

production connects to xparo.in over HTTPS and secure WebSockets. local connects to 127.0.0.1:8000 over plain HTTP, for people running the XPARO server code on the same machine.

xparo_connection_type

websocket

How the robot talks to the server. See Connection types below.

record_bags

false

Launch file only: true also starts a ros2 bag record process that XPARO controls. See ROS bag recording.

xparo_ads_display

native

Who shows the project’s approved ads on the robot’s screen: native (XPARO’s own player), xpshell (the XP-shell app’s player) or off. See Advertising (Earn).

Warning

Quote off (and any value like on, yes, no, true, false) when you pass it on the command line. ROS 2 reads a bare off as the boolean false and the node then stops with InvalidParameterTypeException: ... expecting type 'STRING'.

ros2 launch xparo xparo_launch.py ... "xparo_ads_display:='off'"
ros2 run xparo xparo_ros --ros-args ... -p "xparo_ads_display:='off'"

Connection types

Value

Behaviour

websocket

Use this. A permanent connection; the dashboard can reach the robot instantly. If it drops, the robot reconnects by itself every 5 seconds and re-syncs.

hybrid

Like websocket, but if the connection stays down for about 25 seconds the robot starts polling the server over HTTPS every 2 seconds, and goes back to the WebSocket as soon as it returns. For robots on unreliable networks.

rest

No WebSocket at all: the robot polls the server over HTTPS. It still syncs trees and tasks and uploads its data, but dashboard commands cannot reach it: Run now, terminal, files, teleop and the other Robots Fleet tools need a WebSocket connection.

Whatever the type, the robot sends its 30-second heartbeat as an HTTPS request, so it needs outgoing HTTPS (port 443) as well as the WebSocket.

A config file instead of parameters

xparo_ros also reads ~/xparo_config.json from the home directory of the user it runs as, and uses its values as the defaults for these parameters: xparo_project_id, xparo_secret_key, xparo_connection_type, xparo_environment, xparo_stage, xparo_transport, tethered_channels_config_path and xparo_ads_display.

~/xparo_config.json
{
  "xparo_project_id": "<your-project-id>",
  "xparo_secret_key": "<your-secret-key>",
  "xparo_stage": "development"
}
ros2 run xparo xparo_ros

The node logs ALERT: xparo_config.json file found in home directory when it uses the file.

Important

The file only works with ros2 run. The launch file always passes its own defaults for every parameter (an empty project ID, the production stage, and so on), and parameters passed on start-up win over the file. With ros2 launch, pass the values as launch arguments instead.

Advanced settings

You rarely need these. They decide where synced files are written on the robot; Synced files and folders explains what each file is for.

Parameter

Default with ros2 launch

Default with ros2 run

xparo_behavior_path

<share>/config/default.xml

<share>/config/default.xml

xparo_env_path

<share>/config/default.env

<share>/config/default.env

xparo_local_env_path

<share>/config/default.env

<share>/config/local.env

xparo_file_path

<share>/config/default.yaml

<share>/config/default.txt

xparo_properties_path

<share>/properties/properties.txt

<share>/config/properties.txt

xparo_custom_behaviors_folder_path

<share>/custom_behaviors (with xparo_environment:=local: <workspace>/src/xparo/custom_behaviors if that folder exists)

<share>/custom_behaviors

xparo_custom_evns_folder_path

<share>/custom_envs (with xparo_environment:=local: <workspace>/src/xparo/custom_envs if that folder exists)

<share>/custom_envs

xparo_custom_files_folder_path

<share>/custom_files

<share>/custom_files

BAG_DIR

<share>/ros_bags

<share>/xparo/<project-id>/ros_bags

xparo_folder

not a launch argument

<share>, the base for the ros2 run defaults above

xparo_transport

django_ws

django_ws

tethered_channels_config_path

empty

empty

<share> is the package’s install folder, usually ~/xparo_ws/install/xparo/share/xparo. Print it with ros2 pkg prefix xparo (then add /share/xparo).

xparo_transport is always django_ws for a robot that talks to xparo.in. The other value, tethered_tcp, is for vehicles connected to a topside computer by a tether cable with no internet access; it is not covered in these docs.

What the robot keeps on its own disk

Besides the synced files above, xparo_ros keeps its own state next to its Python code, in <workspace>/install/xparo/lib/python3.X/site-packages/ (X is your Python version):

Path (under site-packages/)

What it is

config/credential.json

The robot’s own credential, saved after the first connection (readable only by its owner). Delete it to make the robot join with xparo_secret_key again.

transferred_files/

The folder the Robots Fleet Files tool browses, uploads to and downloads from.

xparo/<project-id>/

Logs, messages waiting to be sent, and ad data for that project.

Note

This folder is inside the build output, so rm -rf install or a clean rebuild deletes it. The robot then simply joins again with xparo_secret_key on its next start, and shows up as the same robot because its device ID comes from the MAC address.