Max Speed

This one is a bit complicated

What is Max Speed?

YAGSL stores the maximum speed and uses it in the following functions

The maximum speed represents the physical maximum speed of the robot.

How do I change my Max Speed?

You can change your maximum speed by using SwerveDrive.setMaximumSpeed the initial maximum speed is given in SwerveParser.createSwerveDrive for initial values like the maximum angular velocity and drive feedforward and telemetry maximum speed.

The maximum speed in telemetry does not change because most widgets do not support this and it might break them!

  /**
   * Initialize {@link SwerveDrive} with the directory provided.
   *
   * @param directory Directory of swerve drive config files.
   */
  public SwerveSubsystem(File directory)
  {
    // Configure the Telemetry before creating the SwerveDrive to avoid unnecessary objects being created.
    SwerveDriveTelemetry.verbosity = TelemetryVerbosity.HIGH;
    swerveDrive = new SwerveParser(directory).createSwerveDrive(Constants.MAX_SPEED);
    swerveDrive.setMaximumSpeed(Units.feetToMeters(12.4)); // 12.4ft/s to m/s
  }

Last updated