Background
The problem
The ASUR autonomous submarine required precise, low-latency motor control across multiple thrusters. The existing communication between the ROS (Robot Operating System) control layer and the motor drivers lacked a well-defined serial protocol — control values needed to be reliably encoded, transmitted over I2C, and decoded on the receiving end without data corruption.
The project required a protocol that could handle the electrical noise and constraints of an underwater embedded environment, where unreliable communication directly impacts vehicle maneuverability.
Solution
What I built
A custom I2C serial communication protocol written in C++ for the ROS ecosystem. The protocol defines how motor control values are encoded into serial-transferable strings, transmitted over the I2C bus, and decoded by the motor driver microcontroller.
- Encodes floating-point control values into a compact, validated serial string format.
- Handles transmission framing, acknowledgment, and basic error detection over I2C.
- Integrates with ROS as a node, subscribing to control topics and publishing to the hardware interface.
- Designed to operate reliably in the noisy electrical environment of an underwater vehicle.
Engineering
Technical decisions
I2C was chosen over SPI for its two-wire simplicity and multi-device addressability — important for a submarine with several independent motor controllers. The encoding scheme converts control values to fixed-length byte strings to ensure predictable frame sizes and simplify parsing on the microcontroller side.
Integration with ROS required wrapping the protocol in a C++ node with proper publisher/subscriber patterns, allowing the high-level autonomy stack to issue thrust commands without needing to know anything about the serial transport layer.
Results
Outcome
- Delivered a working serial protocol that connected the ROS autonomy layer to physical motor hardware.
- Served as a core infrastructure component for the ASUR submarine's drive system.
- Provided hands-on experience with embedded C++, I2C bus architecture, and ROS node development.
- Foundation for further robotics software development as Software Lead the following year.