Class SysIdRoutine.Mechanism

java.lang.Object
edu.wpi.first.wpilibj2.command.sysid.SysIdRoutine.Mechanism
Enclosing class:
SysIdRoutine

public static class SysIdRoutine.Mechanism
extends Object
A mechanism to be characterized by a SysId routine. Defines callbacks needed for the SysId test routine to control and record data from the mechanism.
  • Field Details

  • Constructor Details

    • Mechanism

      public Mechanism​(Consumer<Measure<Voltage>> drive, Consumer<SysIdRoutineLog> log, Subsystem subsystem, String name)
      Create a new mechanism specification for a SysId routine.
      Parameters:
      drive - Sends the SysId-specified drive signal to the mechanism motors during test routines.
      log - Returns measured data of the mechanism motors during test routines. To return data, call `motor(string motorName)` on the supplied `SysIdRoutineLog` instance, and then call one or more of the chainable logging handles (e.g. `voltage`) on the returned `MotorLog`. Multiple motors can be logged in a single callback by calling `motor` multiple times.
      subsystem - The subsystem containing the motor(s) that is (or are) being characterized. Will be declared as a requirement for the returned test commands.
      name - The name of the mechanism being tested. Will be appended to the log entry title for the routine's test state, e.g. "sysid-test-state-mechanism". Defaults to the name of the subsystem if left null.
    • Mechanism

      public Mechanism​(Consumer<Measure<Voltage>> drive, Consumer<SysIdRoutineLog> log, Subsystem subsystem)
      Create a new mechanism specification for a SysId routine. Defaults the mechanism name to the subsystem name.
      Parameters:
      drive - Sends the SysId-specified drive signal to the mechanism motors during test routines.
      log - Returns measured data of the mechanism motors during test routines. To return data, call `motor(string motorName)` on the supplied `SysIdRoutineLog` instance, and then call one or more of the chainable logging handles (e.g. `voltage`) on the returned `MotorLog`. Multiple motors can be logged in a single callback by calling `motor` multiple times.
      subsystem - The subsystem containing the motor(s) that is (or are) being characterized. Will be declared as a requirement for the returned test commands. The subsystem's `name` will be appended to the log entry title for the routine's test state, e.g. "sysid-test-state-subsystem".