Skip to content
Mehul Goel edited this page Feb 24, 2026 · 6 revisions

ROS2Bnyahaj Communication Overview

ROS2Bnyahaj handles communication between the Firmware stack (Teensy) and the Software stack (ROS) over a UART channel.

This is the primary pathway for transmitting critical system information, including:

  • Steering commands
  • Buggy position data
  • Sensor telemetry
  • Debug information

Because this node is mission-critical, it is configured in ROS to automatically restart if it crashes. Repeated restarts may indicate a deeper system bug.


Key Software Components

Host Communication Library

host_comm.py

Handles low-level serial packet encoding/decoding and UART communication.

ROS Serial Node

ros_to_bnyahaj.py

ROS node responsible for reading serial data and publishing relevant ROS topics.


Packet Definitions


NAND Teensy → NAND ROS (Rosbag)

NAND Debug Packet

Field Type Description
TX12 (controller) connected bool Whether the TX12 controller is connected
Operator ready bool Operator enable/ready state
RC steering angle float Steering angle from RC
Stepper steering angle float Steering angle reported by stepper
Stepper alarm bool Stepper fault state
Brake status bool Brake engaged/disengaged
Use auton steer bool Whether autonomous steering is active
RC Uplink quality int RC signal quality metric
Encoder angle float Raw encoder angle
Accelerometer float Acceleration reading
RFM69 missed packet bool Whether a radio packet was missed
Teensy timestamp int millis() timestamp from Teensy

NAND UKF Packet

Field Type Description
Eastern float Position (meters, UTM Easting)
Northern float Position (meters, UTM Northing)
θ (theta) float Heading (radians)
ω (omega) float Angular velocity (rad/s)
Velocity float Linear velocity (m/s)
Teensy timestamp int millis() timestamp from Teensy

NAND Raw GPS Packet

Field Type Description
Sequence number int GPS packet sequence ID
Eastern (unfiltered) float UTM Easting (meters)
Northern (unfiltered) float UTM Northing (meters)
Fix type int GPS fix classification
Accuracy float GPS reported accuracy
GPS time float Timestamp from GPS module
Teensy timestamp int millis() timestamp from Teensy

NAND Teensy → SC Teensy (via RFM69)

(Also logged in SC Rosbag via SC Teensy)

NAND POS Packet

Field Type Description
NAND GPS Sequence Number int Sequence ID from NAND GPS
NAND GPS Fix int Fix classification
X / East (unfiltered) float UTM Easting (meters)
Y / North (unfiltered) float UTM Northing (meters)

SC Teensy → SC ROS (Rosbag)

SC Debug Packet

Field Type Description
TX12 state bool Controller connection state
Operator ready bool Operator enable/ready state
RC steering angle float Steering angle from RC
Stepper steering angle float Steering angle reported by stepper
Stepper alarm bool Stepper fault state
Brake status bool Brake state
Use auton steer bool Whether autonomous steering is active
RC Uplink quality int RC signal quality
Raw encoder float Raw encoder reading
Missed packet count int Packets missed since last debug packet
Teensy timestamp int millis() timestamp from Teensy

SC Sensors Packet

Field Type Description
Steering float Actual stepper steering angle
Speed float Encoder-derived speed (m/s)
Teensy timestamp int millis() timestamp from Teensy

Timestamp Roundtrip

Used for synchronization and latency measurement.

Field Type Description
Teensy timestamp int millis() from firmware
Absolute timestamp float Software-side absolute time

Clone this wiki locally