Unit 6: Intermediate FRC Coding
Welcome to one of the most exciting and powerful topics in FRC. Swerve drive is the key to our robot's incredible maneuverability and a core part of our team's identity on the field.
A swerve drive is a type of robot drivetrain where each of the four wheels can both drive and steer independently. Unlike a standard tank drive, this gives our robot unparalleled flexibility and control.
Each of the four wheels is part of a "swerve module" that contains:
Using a swerve drive is a significant challenge, but the benefits are massive and give us a competitive edge.
When driving a swerve robot, there are two primary ways to control it. The code uses a mathematical model called kinematics to translate driver input into the correct speed and angle for each of the four modules.
In this mode, the controls are always relative to the robot's front. Pushing the joystick forward always makes the robot drive in whatever direction it's currently facing. This is how a tank drive works, but it can be disorienting with swerve's ability to strafe.
This is the most powerful and common way we drive our swerve robots. The controls are always relative to the playing field. Pushing the joystick "forward" always moves the robot toward the opponent's alliance station, regardless of which way the robot is facing. This is made possible by using a gyroscope to keep track of the robot's heading.
Question: What is the key sensor that enables Field-Oriented Control on a swerve drive?