Back to Systems System 02

3-Wheel Swerve
Path Planner

ROS2 C++ Holonomic Kinematics 3WD Swerve Heading Decoupling STM32 Ongoing
Swerve Drive Demo Video
assets/videos/swerve_demo.mp4
Problem

Differential drives are constrained by heading-dependent translation โ€” any positional change requires the robot to first orient toward the goal, creating stop-and-turn mechanics that are catastrophically slow in competition scenarios requiring continuous repositioning.

Approach

Developed a custom path planner leveraging the holonomic kinematics of a 3-Wheel Omnidirectional (Swerve) drive โ€” a platform capable of simultaneous independent translation and rotation. The planner fully decouples heading control from translational motion, allowing the robot to translate in any field-relative direction while maintaining an arbitrary orientation. This is critical for competition tasks requiring precise positioning while facing a fixed target.

System Architecture
Laptop (ROS2 Humble) โ”‚ โ”œโ”€โ”€ Nav2 Planner Server โ”‚ โ””โ”€โ”€ Custom Holonomic Planner Plugin (C++) โ”‚ โ””โ”€โ”€ Twist Commands (Vx, Vy, Vฮธ) โ”‚ โ”œโ”€โ”€ Kinematics Node โ€” 3WD Decomposition โ”‚ โ”œโ”€โ”€ Wheel 1: Speed + Steering Angle โ”‚ โ”œโ”€โ”€ Wheel 2: Speed + Steering Angle โ”‚ โ””โ”€โ”€ Wheel 3: Speed + Steering Angle โ”‚ โ”œโ”€โ”€ STM32 Microcontroller (Serial / CAN) โ”‚ โ”œโ”€โ”€ Motor Driver 1 โ”‚ โ”œโ”€โ”€ Motor Driver 2 โ”‚ โ””โ”€โ”€ Motor Driver 3 โ”‚ โ””โ”€โ”€ Swerve Modules ร— 3
Implementation Details

C++ Nav2 plugin translating global Twist commands (Vx, Vy, Vฮธ) into independent wheel speeds and orientations via the inverse kinematic model of the 3WD geometry. The planner computes heading-independent trajectories โ€” the robot can translate in any direction while concurrently reorienting, maximising task efficiency. Integrates with Nav2's lifecycle management and Costmap2D without changes to the broader navigation stack.

Hardware & CAD
Drop photos into assets/images/hardware/ and assets/images/cad/ โ€” they'll appear above automatically.
Result

Robot translates freely in any direction while concurrently reorienting to face targets, drastically improving competition task efficiency. The decoupled heading control eliminates time lost to stop-and-turn mechanics entirely, enabling continuous smooth repositioning in complex field environments.

View on GitHub Next: Diff Drive Planner โ†’