WPILibC++ 2024.3.2
frc2::sysid::SysIdRoutine Class Reference

A SysId characterization routine for a single mechanism. More...

#include <frc2/command/sysid/SysIdRoutine.h>

Inheritance diagram for frc2::sysid::SysIdRoutine:
frc::sysid::SysIdRoutineLog

Public Member Functions

 SysIdRoutine (Config config, Mechanism mechanism)
 Create a new SysId characterization routine. More...
 
frc2::CommandPtr Quasistatic (Direction direction)
 
frc2::CommandPtr Dynamic (Direction direction)
 
- Public Member Functions inherited from frc::sysid::SysIdRoutineLog
 SysIdRoutineLog (std::string_view logName)
 Create a new logging utility for a SysId test routine. More...
 
void RecordState (State state)
 Records the current state of the SysId test routine. More...
 
MotorLog Motor (std::string_view motorName)
 Log data from a motor during a SysId routine. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from frc::sysid::SysIdRoutineLog
static std::string StateEnumToString (State state)
 

Detailed Description

A SysId characterization routine for a single mechanism.

Mechanisms may have multiple motors.

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.

Constructor & Destructor Documentation

◆ SysIdRoutine()

frc2::sysid::SysIdRoutine::SysIdRoutine ( Config  config,
Mechanism  mechanism 
)
inline

Create a new SysId characterization routine.

Parameters
configHardware-independent parameters for the SysId routine.
mechanismHardware interface for the SysId routine.

Member Function Documentation

◆ Dynamic()

frc2::CommandPtr frc2::sysid::SysIdRoutine::Dynamic ( Direction  direction)

◆ Quasistatic()

frc2::CommandPtr frc2::sysid::SysIdRoutine::Quasistatic ( Direction  direction)

The documentation for this class was generated from the following file: