Skip to content

Latest commit

 

History

History
39 lines (30 loc) · 2.26 KB

max-speed.md

File metadata and controls

39 lines (30 loc) · 2.26 KB
description
This one is a bit complicated

Max Speed

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.

{% hint style="info" %} The maximum speed in telemetry does not change because most widgets do not support this and it might break them! {% endhint %}

  /**
   * 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
  }