Home About Projects Contact

ROS Driver for a Robotic Actuator


One of the difficulties of testing robotic systems is the lack of proper and consistently working infrastructure. This project makes controlling T-motor AK series robotic actuators a breeze! Simply flash your Teensy, wire it up to your host and motor, then send messages to the ROS2 topics to control!

I developed a Teensy firmware that one can generate and flash by simply running a Docker service. This firmware uses the micro-ROS libraries to communicate with the ROS2 host and uses the CAN bus to receive from and send control commands to the motor. On the host side, simply run a micro-ROS agent and automagically™ see the available topics to listen/send commands to.

mathematics and physics behind this project

Using multi-stage Docker builds, I created couple custom images for development. Docker on Linux allows for USB-passthrough, so a Linux host can build, flash, and communicate with Teensy over USB. I implemented the two modes that this motor can be used with: Servo mode (position, speed, current, brake control) and the Motor mode (torque control).

picture of the mechanism

Finally, I connected a joystick and plotted the state messages on a graph. Red is the desired position and blue is the position measured by the motor. The demo on the right uses the motor mode and applies torque based on angular position and velocity error. To see a more detailed explanation and documentation, please see the git repo.

picture of the mechanism