# ROS2 BuildHat Lego Spike/Prime Differential Drive Controller

**URL:** <https://discourse.openrobotics.org/t/ros2-buildhat-lego-spike-prime-differential-drive-controller/58504>\
**Category:** Projects\
**Created:** [September 30, 2026, 8:25am UTC](https://discourse.openrobotics.org/t/ros2-buildhat-lego-spike-prime-differential-drive-controller/58504 "2026-09-30T08:25:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jfrancis71](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/jfrancis71/32/20816_2.png) [@jfrancis71](https://discourse.openrobotics.org/u/jfrancis71)\
**Post date:** [September 30, 2026, 8:25am UTC](https://discourse.openrobotics.org/t/ros2-buildhat-lego-spike-prime-differential-drive-controller/58504/1 "2026-09-30T08:25:03Z")

</div>

Dear all,

BuildHat is a hardware interface (from the Raspberry Pi Foundation) between Raspberry Pi and Lego Spike/Prime.

I have developed a differential drive controller package for this interface for ROS2.

It subscribes to /cmd\_vel receiving TwistStamped messages and controls the motors. Additionally it also publishes odometry. The package is configurable for different physical designs. I also include a demonstration package for Brian, the robot.

It is a Python package, it does not use the ROS2 Differential Drive Controller as there is no convenient C interface for BuildHat, however it does largely adhere to its conventions.

Links:  
[github repo](https://github.com/jfrancis71/ros2_buildhat_differential_drive)  
[YouTube Demo](https://www.youtube.com/watch?v=Jb49me5SOI8)

I hope this may be of interest to some.

Thanks,  
Julian.
