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 |
|---|---|---|
|
(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. |
|
(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. |
|
|
Which task stages this robot accepts: |
|
|
|
|
|
How the robot talks to the server. See Connection types below. |
|
|
Launch file only: |
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 |
|---|---|
|
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. |
|
Like |
|
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_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 |
Default with |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
not a launch argument |
|
|
|
|
|
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 |
What it is |
|---|---|
|
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. |
|
The folder the Robots Fleet Files tool browses, uploads to and downloads from. |
|
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.