ROS 2 driver
A reconnect-capable ROS 2 node for live UWB range, TDOA position, serial events, and device health.
Source available
The driver and custom message packages live in the main repository under ros2/. The serial parser is independently tested and accepts both full and compact range records.
Build
From the repository root in a sourced ROS 2 environment:
rosdep install --from-paths ros2 --ignore-src -r -y
colcon build --base-paths ros2 --symlink-install
source install/setup.bash
Run
Connect the measurement-producing tag and pass its stable USB serial path to the launch file.
ros2 launch opentags_driver driver.launch.py \
port:=/dev/serial/by-id/your-opentag
ros2 topic echo /opentags/range
ros2 topic echo /diagnostics
Published topics
| Topic | Type | Contents |
|---|---|---|
/opentags/range | opentags_msgs/RangeMeasurement | Distance, sequence, exchange time, and RSSI. |
/opentags/position | geometry_msgs/PointStamped | TDOA position in metres. |
/opentags/position_raw | opentags_msgs/PositionMeasurement | Position, sequence, and raw TDOA values. |
/opentags/events | std_msgs/String | INFO, DIAG, PHY, MISS, OK, and error records. |
/diagnostics | diagnostic_msgs/DiagnosticArray | Connection, freshness, parsing, sequence gaps, and device data. |
Generic range output is opt-in.
sensor_msgs/Range defines only ultrasound and infrared radiation values, not UWB. Set publish_sensor_range:=true only when an existing consumer requires that message and your application accepts the mapping.
Command services
Each service returns success when the command is written. Device responses appear on /opentags/events.
ros2 service call /opentags_driver/ping std_srvs/srv/Trigger
ros2 service call /opentags_driver/request_info std_srvs/srv/Trigger
ros2 service call /opentags_driver/reset_statistics std_srvs/srv/Trigger
Failure behavior
- The node reconnects after cable removal, device reset, or serial errors.
- Malformed records are counted and discarded without terminating the node.
- Sequence gaps, missed exchanges, stale data, and host queue drops appear in diagnostics.
- TDOA position uses the surveyed anchor geometry configured for the target environment.