Skip to content

Latest commit

 

History

History
9 lines (5 loc) · 1.47 KB

README.adoc

File metadata and controls

9 lines (5 loc) · 1.47 KB

CI

Swerve-2022

Offseason 2022 swerve drive

The swerve drive has three vector controls, x, y, and omega (angular velocity). Straight forward is positive x direction, straight left is positive y direction, and counter-clockwise is positive omega. The ChassisSpeeds object stores these three values in one object. The robot takes in the joystick commands for x speed, y speed, and omega (rotational) speed and adds them to a ChassisSpeeds object. The ChassisSpeeds values are robot relative, meaning positive x is forward on the robot. They can be changed to field relative, meaning positive x is directly away from you, with a gyro. The ChassisSpeeds object is then split up into an array of 4 individual SwerveModuleStates objects using the SwerveDriveKinematics class. These SwerveModuleStates can be sent to each individual swerve module and the motors can be set using this.

More information can be found at this blog and this video.