Personal project · 2025 to 2026

Swerve Drive Robot

A 15 × 15 inch swerve robot built to explore mobile robotics control, navigation, and mechanical and electrical design.

5.07 m/s
Max speed (no-load)
8
Independently driven motors
ROS 2
Software framework

Robotics Software

Navigation: mapping, localization, and path planning

Validating navigation in simulation: LiDAR scans fill in the map while the planner searches it for a route.

Built a ROS 2 navigation stack integrating LiDAR SLAM and A starpath planning. Published odometry and TF transforms to validate navigation behavior in Gazebo and Foxglove before deploying to hardware.

Swerve Drive Control

Joystick input becoming chassis speeds and then a state for each of the four modules
Two stick axes and a gyro heading become a speed and an angle for every wheel.

Developed a ROS-based swerve drive controller converting desired robot velocities into independent steering angles and wheel speeds for each module.

A module state being converted into drive and angle motor outputs
Inside one module: speed goes straight to the drive motor, angle goes through motion optimization and a PID loop.

Implemented PID control and motion profiling for the drive and steering motors, with the low-level control loop running on the ESP32.

Testing swerve drive on a real robot:

Validating swerve drive control on a FRC robot previously.

Hardware

Electronics & Control Architecture

Schematic connecting the Raspberry Pi, the ESP32, and four motor controllers
The control sheet: the Raspberry Pi hands off to the ESP32, which reaches the drive controllers over a shared CAN bus.

Designed the electronics architecture in KiCad, using modular power distribution and motor control for 8 BLDC motors through 80 A ESCs.

Separated high-level computation and real-time control across a Raspberry Pi 5 and ESP32. The Raspberry Pi handles navigation and mission planning, while the ESP32 handles time-sensitive motor control, PID loops, and swerve kinematics.

This separation prevents computationally expensive navigation tasks from interfering with the motor control loop.

Mechanical Design

Swerve Module

CAD assembly of one swerve module with the steering gear lifted off
One module, designed for independent drive and steering. Bevel and spur gears turn the wheel; a belt points it.

Designed the swerve drivetrain in SolidWorks with a two-stage drive system using bevel and spur gears for propulsion and a belt drive for steering.

Derived the gear ratios to achieve 5.07 m/s no-load speed while maintaining torque headroom for carpet and threshold traversal.

Structural Analysis

Von Mises stress plot of the chassis plate under a side load
Von Mises stress across the chassis plate, loaded along one edge. The corners around the module cutouts carry it.

Used SolidWorks Simulation during the design process to identify structural issues, then used ANSYS for detailed stress distribution and impact-load analysis.

Final Frame Assembly

Full chassis assembly with all four swerve modules mounted
The full platform: four modules, eight motors, and the frame that holds the electronics between the plates.

Integrated the mechanical, electrical, and computing systems into a compact frame designed to balance stiffness, weight, and component protection.

The modular frame and electronics layout leave room for future hardware and software upgrades without redesigning the entire platform.

Stack

  • C++
  • ROS 2
  • Gazebo
  • SolidWorks
  • KiCad
  • ESP32
  • Raspberry 5