Class SysId

java.lang.Object
com.stuypulse.robot.util.SysId

public class SysId extends Object

A class that handles the Mechanism logging and unit conversions required to create a SysId routine

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static edu.wpi.first.wpilibj2.command.sysid.SysIdRoutine
    getRoutine(double rampRate, double stepVoltage, String subsystemName, Consumer<Double> voltageSetter, Supplier<Double> positionSupplier, Supplier<Double> velocitySupplier, Supplier<Double> voltageSupplier, edu.wpi.first.wpilibj2.command.Subsystem subsystemInstance)
    Creates a SysId routine from the parameters
    static edu.wpi.first.wpilibj2.command.sysid.SysIdRoutine
    getRoutine(edu.wpi.first.units.measure.Velocity<edu.wpi.first.units.VoltageUnit> rampRate, edu.wpi.first.units.measure.Voltage stepVoltage, String subsystemName, Consumer<edu.wpi.first.units.measure.Voltage> voltageSetter, Supplier<edu.wpi.first.units.measure.Angle> positionSupplier, Supplier<edu.wpi.first.units.measure.AngularVelocity> velocitySupplier, Supplier<edu.wpi.first.units.measure.Voltage> voltageSupplier, edu.wpi.first.wpilibj2.command.Subsystem subsystemInstance)
    Creates a SysId routine from the parameters

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SysId

      public SysId()
  • Method Details

    • getRoutine

      public static edu.wpi.first.wpilibj2.command.sysid.SysIdRoutine getRoutine(double rampRate, double stepVoltage, String subsystemName, Consumer<Double> voltageSetter, Supplier<Double> positionSupplier, Supplier<Double> velocitySupplier, Supplier<Double> voltageSupplier, edu.wpi.first.wpilibj2.command.Subsystem subsystemInstance)

      Creates a SysId routine from the parameters

      Parameters:
      rampRate - - Measured in volts per second, the voltage ramp rate used for quasistatic test routines.
      stepVoltage - - Measured in volts, the step voltage output used for dynamic test routines.
      subsystemName - - Name of the subsystem used for logging.
      voltageSetter - - Double consumer that sets the voltage of the subsystem.
      positionSupplier - - In rotations, a supplier for the position of the subsystem.
      voltageSupplier - - A supplier for the voltage of the subsystem's motors.
      subsystemInstance - - The subsystem containing the motor(s) that is (or are) being characterized.
    • getRoutine

      public static edu.wpi.first.wpilibj2.command.sysid.SysIdRoutine getRoutine(edu.wpi.first.units.measure.Velocity<edu.wpi.first.units.VoltageUnit> rampRate, edu.wpi.first.units.measure.Voltage stepVoltage, String subsystemName, Consumer<edu.wpi.first.units.measure.Voltage> voltageSetter, Supplier<edu.wpi.first.units.measure.Angle> positionSupplier, Supplier<edu.wpi.first.units.measure.AngularVelocity> velocitySupplier, Supplier<edu.wpi.first.units.measure.Voltage> voltageSupplier, edu.wpi.first.wpilibj2.command.Subsystem subsystemInstance)

      Creates a SysId routine from the parameters

      Uses WPILib unit classes so inputs can be in any unit.

      Parameters:
      rampRate - - The voltage ramp rate used for quasistatic test routines.
      stepVoltage - - The step voltage output used for dynamic test routines.
      subsystemName - - Name of the subsystem used for logging.
      voltageSetter - - Double consumer that sets the voltage of the subsystem.
      positionSupplier - - A supplier for the position of the subsystem.
      voltageSupplier - - A supplier for the voltage of the subsystem's motors.
      subsystemInstance - - The subsystem containing the motor(s) that is (or are) being characterized.