XPARO ROS2 Integration
This page explains how to use XPARO with ROS2.
The xparo_ros node allows robots fleet to communicate with the XPARO platform using socket (internet). It connects your robot to the XPARO server and enables:
sync behaviour tree and files in realtime with monitoring
you can call llm directly from API too
Receiving responses from the XPARO engine
saving task completion on server
Recording ROS bag files automatically
update startup logs to the XPARO server
The node is already implemented and ready to use. Users only need to run the node and use the provided ROS topics.
—
Running the XPARO ROS2 Node
Run the node normally using ROS2:
ros2 run xparo xparo_ros
Or using a launch file:
ros2 launch xparo xparo_launch.py
After starting the node it will automatically connect to the XPARO server.
—
ROS Parameters
The node uses several parameters to connect to the XPARO platform.
These parameters are usually set inside a launch file.
Parameters
xparo_project_id
Your XPARO project identifier.
Example:
xparo_project_id = "project_01"
This tells the node which project on the XPARO server it belongs to.
—
xparo_secret_key
Secret key used to authenticate the robot with the server.
Example:
xparo_secret_key = "abc123secret"
Do not share this key publicly.
—
xparo_connection_type
Defines how the robot communicates with the server.
Available options:
websocket(recommended)rest
Example:
xparo_connection_type = "websocket"
—
BAG_DIR
Directory where ROS bag recordings will be stored.
Example:
BAG_DIR = "/home/robot/ros_bags"
Recorded bag files will automatically be uploaded to the XPARO server when possible.
—
ROS Topics
The node communicates using standard ROS topics.
Topics are used to send questions to the XPARO engine and receive responses.
—
Topic: /xparo/ask
This topic is used to send a question or command to LLM.
Type:
std_msgs/String
Publish a text message.
Example:
ros2 topic pub /xparo/ask std_msgs/String "data: 'Hello robot'"
Expected Behavior
The message will be sent to the XPARO engine.
The engine processes the request and returns a response.
The response will appear on:
/xparo/response
—
Topic: /xparo/response
This topic publishes all responses from the XPARO engine in stringyfied json.
Type:
std_msgs/String
Example output:
data: '{"status": true, "title": "gab", "aiml": "", "maps": "", "Sets": "amcl:\n ros__parameters:\n alpha1: 0.2\n alpha2: 0.2\n ...'
Robots can use this message for:
text-to-speech
display on screen
UI dashboards
logging
navigation systems
custom robot logic
Example subscriber:
ros2 topic echo /xparo/response
—
Topic: /xparo/task_updates
This topic is used to send task updates to the XPARO server.
Type:
std_msgs/String
The message must contain JSON.
Example:
ros2 topic pub /xparo/task_updates std_msgs/String \
"data: '{\"task\":\"delivery\",\"status\":\"completed\"}'"
Expected Behavior
The update is stored in the XPARO database and can be viewed from the dashboard.
This allows the server to track robot activities.
—
Typical Workflow
Start the XPARO ROS2 node
ros2 run xparo xparo_ros
Send a question
ros2 topic pub /xparo/ask std_msgs/String "data: 'Hello robot'"
Receive the response
ros2 topic echo /xparo/response
Send task updates
ros2 topic pub /xparo/task_updates std_msgs/String "data: '{\"task\":\"delivery\",\"status\":\"completed\"}'"
—
ROS Bag Recording
The XPARO ROS node automatically records ROS bag files.
Recorded data includes:
robot telemetry
ROS topics
system events
Files are saved inside:
BAG_DIR
Example:
/home/robot/ros_bags/
The node automatically uploads completed recordings to the XPARO server.
This feature is useful for:
debugging
remote diagnostics
system analysis
—
Checking Available Topics
To see all available topics:
ros2 topic list
You should see:
/xparo/ask
/xparo/response
/xparo/json
/xparo/task_updates
—
Troubleshooting
Node does not start
Make sure the package is installed correctly.
ros2 pkg list | grep xparo_ros
—
No response from /xparo/response
Check the following:
project_id is correct
secret_key is correct
robot has internet access
—
Topics not visible
Check if the node is running.
ros2 node list
You should see:
/xparo
—
Support
Website
https://xparo.in
https://xparo.onrender.com
https://xparo-website.onrender.com
GitHub
https://github.com/lazyxcientist/xparo_ros2
Contact
xparo@xparo.in
xpassistantpersonal@gmail.com