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.

Settings are fixed at launch

xparo_ros reads every parameter on this page once, when it starts, and they are read-only after that. To change one, stop xparo_ros and start it again with the new value. ros2 param set refuses the change:

ros2 param set /xparo_ros xparo_stage development
Setting parameter failed: Trying to set a read-only parameter: xparo_stage.

The command still exits with status 0, so a script has to check what it prints (the refusal goes to standard error). ros2 param describe shows each one as Read only: true, with the description Set at launch; relaunch xparo to change it. (The node is /xparo_ros with ros2 launch, /xparo with ros2 run.)

The secret key is not kept as a parameter once xparo_ros has read it: ros2 param get and ros2 param dump show (hidden).

ros2 param get /xparo_ros xparo_secret_key
String value is: (hidden)

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 after 5 seconds (then less often, up to once a minute, while attempts keep failing) 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.

Robot location

By default the robot asks ip-api.com where its public IP address is. That only finds the internet provider’s city, and it’s a request to a third-party service. Set one of these environment variables before ros2 launch:

export XPARO_LOCATION="18.5204,73.8567"   # the site's latitude,longitude
export XPARO_NO_IP_LOOKUP=1               # or: don't look the location up at all

Robot identity (serial number)

A robot’s device id is worked out from its network card’s MAC address. To use the serial printed on the chassis instead (so the fleet, subscriptions and service requests show SB-0008), set it once on that robot, before its first connection:

export XPARO_DEVICE_ID="SB-0008"

A robot that has already joined keeps the id it joined with: it reconnects with its own credential, so setting the variable later changes nothing.

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 and tethered_channels_config_path.

~/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). Never copy it to another robot; see Many robots from one disk image.

transferred_files/

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

xparo/<project-id>/

Logs and messages waiting to be sent for that project.

Note

This folder is inside the build output, so rm -rf install or a clean rebuild deletes it. The server then refuses the robot (robot_credential_required) until the project Owner presses Reset robot sign-in (Robots Fleet → the robot → Power). After that it joins again with xparo_secret_key and shows up as the same robot, because its device ID comes from the MAC address (or XPARO_DEVICE_ID). See Identity, many robots and offline.