Kinematics is a way to convert a drivetrain agnostic velocity/rotation (ChassisSpeeds
) to values meaningful for the actual drivetrain (WheelSpeeds
). Similar to odometry, there are drivetrain specific classes for converting chassis speeds to wheel speeds. Here, we use
Differential Drive Kinematics. Swerve Drive Kinematics and Mecanum Drive Kinematics are also available.
Summary of changes:
ArcadeDrive.java
- Update command to use new
arcadeDriveKinematics()
- Update command to use new
Drivetrain.java
- Create a
DifferentialDriveKinematics
object that uses the robot'strackWidthMeters
SysId constant - Add a new private
setDriveSpeed()
helper function that accepts wheel speeds and implements combined feedforward and PID control. - Implement a new
arcadeDriveKinematics()
that uses the newsetDriveSpeed()
helper function - Implement a new
setChassisSpeeds()
function that converts from a universalChassisSpeeds
object to wheel speeds
- Create a