RoboticsIntermediate

Swerve Drive Basics for FRC Robots

A swerve drivetrain lets a robot translate and rotate by independently steering each wheel module.

FRCSwerveKinematicsRobotics

Site connection

The 2024 robotics writing describes the team's move to swerve, PathPlanner, vision, odometry, and simulation.

Visual model

Chassis motion becomes four module vectors

Change strafe and rotation to see why each wheel receives a different command.

Interactive

Each module receives its own speed and wheel angle

What Makes Swerve Different

A tank drive changes direction mostly by varying left and right wheel speeds. A swerve drive can point each wheel module independently.

That means the robot can move sideways, diagonally, rotate in place, or combine translation and rotation.

Kinematics

The driver asks for chassis motion: x velocity, y velocity, and angular velocity. Swerve kinematics converts that chassis command into each module's speed and angle.

Odometry runs the other direction: it estimates the robot pose from gyro angle and module movement.

InputOutput
Chassis speedsWheel speeds and angles
Gyro plus module positionsEstimated robot pose
Field-relative joystick commandRobot-relative chassis command

Common Pitfalls

  • Mixing field-relative and robot-relative coordinates.
  • Trusting odometry after a gyro disconnect.
  • Forgetting to desaturate wheel speeds when commands exceed physical limits.
  • Testing only in simulation and skipping module zeroing on hardware.

Quick check

Quiz

What does swerve kinematics convert?
  1. Battery voltage into code
  2. Chassis motion into module states
  3. Camera images into AprilTags
  4. LED colors into robot modes

Swerve kinematics maps desired chassis velocity to wheel speeds and angles.

Sources and Further Reading

Related Explainers