Class SysIdRoutine
public class SysIdRoutine extends SysIdRoutineLog
A single subsystem may have multiple mechanisms, but mechanisms should not share test routines. Each complete test of a mechanism should have its own SysIdRoutine instance, since the log name of the recorded data is determined by the mechanism name.
The test state (e.g. "quasistatic-forward") is logged once per iteration during test execution, and once with state "none" when a test ends. Motor frames are logged every iteration during test execution.
Timestamps are not coordinated across data, so motor frames and test state tags may be recorded on different log frames. Because frame alignment is not guaranteed, SysId parses the log by using the test state flag to determine the timestamp range for each section of the test, and then extracts the motor frames within the valid timestamp ranges. If a given test was run multiple times in a single logfile, the user will need to select which of the tests to use for the fit in the analysis tool.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SysIdRoutine.Config
Hardware-independent configuration for a SysId test routine.static class
SysIdRoutine.Direction
Motor direction for a SysId test.static class
SysIdRoutine.Mechanism
A mechanism to be characterized by a SysId routine.Nested classes/interfaces inherited from class edu.wpi.first.wpilibj.sysid.SysIdRoutineLog
SysIdRoutineLog.MotorLog, SysIdRoutineLog.State
-
Constructor Summary
Constructors Constructor Description SysIdRoutine(SysIdRoutine.Config config, SysIdRoutine.Mechanism mechanism)
Create a new SysId characterization routine. -
Method Summary
Modifier and Type Method Description Command
dynamic(SysIdRoutine.Direction direction)
Returns a command to run a dynamic test in the specified direction.Command
quasistatic(SysIdRoutine.Direction direction)
Returns a command to run a quasistatic test in the specified direction.
-
Constructor Details
-
SysIdRoutine
Create a new SysId characterization routine.- Parameters:
config
- Hardware-independent parameters for the SysId routine.mechanism
- Hardware interface for the SysId routine.
-
-
Method Details
-
quasistatic
Returns a command to run a quasistatic test in the specified direction.The command will call the `drive` and `log` callbacks supplied at routine construction once per iteration. Upon command end or interruption, the `drive` callback is called with a value of 0 volts.
- Parameters:
direction
- The direction in which to run the test.- Returns:
- A command to run the test.
-
dynamic
Returns a command to run a dynamic test in the specified direction.The command will call the `drive` and `log` callbacks supplied at routine construction once per iteration. Upon command end or interruption, the `drive` callback is called with a value of 0 volts.
- Parameters:
direction
- The direction in which to run the test.- Returns:
- A command to run the test.
-