ROS 2 workspace for the RIT SPEX rover (Scorpio). Runs on the Nvidia Jetson Orin Nano.
This repository depends on the shared protocol package (rovers-protocol) for encoding/decoding messages from the basestation. The same protocol repo is used by both this repo and rovers-basestation.
# Clone with submodule
git clone --recurse-submodules https://github.com/rit-spex/rovers-ros.git
# Or if already cloned
git submodule update --init --recursiveExpected submodule location: lib/rovers-protocol/
The basestation sends controller data over XBee radio as compact bit-packed bytes. The basestation_node decodes them using MessageEncoder from the shared protocol and publishes the values as ROS topics. The telemetry_uplink_node collects rover telemetry from ROS topics, encodes them using the same protocol, and sends them back to the basestation over UDP.
XBee Radio
┌───────────────┐ ───────────────> ┌─────────────────┐
│ BASESTATION │ controller data │ ROVER (ROS 2) │
│ (Raspberry Pi)│ <─────────────── │ (this repo) │
│ │ telemetry (UDP) │ │
└───────────────┘ └─────────────────┘
| Node | File | Purpose |
|---|---|---|
basestation_node |
src/communications/basestation/basestation/basestation_node.py |
Decodes XBee messages → ROS topics |
telemetry_uplink_node |
src/communications/basestation/basestation/telemetry_uplink_node.py |
Encodes rover telemetry and sends it to the basestation via UDP |
You can enable real-time hex-level protocol tracing to verify that the rover is correctly encoding/decoding messages. This is useful for confirming bit-packed message IDs and field values match what the basestation expects.
To enable tracing, pass the protocol_trace:=1 argument:
# In simulation
ros2 launch main simulation_launch.xml protocol_trace:=1
# On hardware (SSH in and run)
ros2 launch main main_launch.xml protocol_trace:=1When enabled, the basestation_node and telemetry_uplink_node will print hex traces like:
[protocol rx] <ID:0x02> data:0200ff...(Xbox control message)[protocol tx] <ID:0xF1> data:f1045a...(Telemetry message)
Make sure you have ROS 2 (Humble) installed, then:
colcon build
source source.sh# Launch the full system
ros2 launch main main_launch.xml
# Launch the simulator
ros2 launch main simulation_launch.xmlSSH to the rover:
ssh rovers@129.21.91.140
# Password: roversThen:
cd ~/ros/rovers-ros
source source.sh
ros2 launch main main_launch.xmlAfter you see "starting xbee..." enter the password rovers.