SysIdRoutineLog

class wpilib.sysid.SysIdRoutineLog(logName: str)

Bases: pybind11_object

Utility for logging data from a SysId test routine. Each complete routine (quasistatic and dynamic, forward and reverse) should have its own SysIdRoutineLog instance, with a unique log name.

Create a new logging utility for a SysId test routine.

Parameters:

logName – The name for the test routine in the log. Should be unique between complete test routines (quasistatic and dynamic, forward and reverse). The current state of this test (e.g. “quasistatic-forward”) will appear in WPILog under the “sysid-test-state-logName” entry.

class MotorLog

Bases: pybind11_object

Logs data from a single motor during a SysIdRoutine.

acceleration(acceleration: wpimath.units.meters_per_second_squared) wpilib._wpilib.sysid.SysIdRoutineLog.MotorLog

Log the linear acceleration of the motor.

This is optional; SysId can perform an accurate fit without it.

Parameters:

acceleration – The linear acceleration to record.

Returns:

The motor log (for call chaining).

angularAcceleration(acceleration: wpimath.units.turns_per_second_squared) wpilib._wpilib.sysid.SysIdRoutineLog.MotorLog

Log the angular acceleration of the motor.

This is optional; SysId can perform an accurate fit without it.

Parameters:

acceleration – The angular acceleration to record.

Returns:

The motor log (for call chaining).

angularPosition(position: wpimath.units.turns) wpilib._wpilib.sysid.SysIdRoutineLog.MotorLog

Log the angular position of the motor.

Parameters:

position – The angular position to record.

Returns:

The motor log (for call chaining).

angularVelocity(velocity: wpimath.units.turns_per_second) wpilib._wpilib.sysid.SysIdRoutineLog.MotorLog

Log the angular velocity of the motor.

Parameters:

velocity – The angular velocity to record.

Returns:

The motor log (for call chaining).

current(current: wpimath.units.amperes) wpilib._wpilib.sysid.SysIdRoutineLog.MotorLog

Log the current applied to the motor.

This is optional; SysId can perform an accurate fit without it.

Parameters:

current – The current to record.

Returns:

The motor log (for call chaining).

position(position: wpimath.units.meters) wpilib._wpilib.sysid.SysIdRoutineLog.MotorLog

Log the linear position of the motor.

Parameters:

position – The linear position to record.

Returns:

The motor log (for call chaining).

value(name: str, value: float, unit: str) wpilib._wpilib.sysid.SysIdRoutineLog.MotorLog

Log a generic data value from the motor.

Parameters:
  • name – The name of the data field being recorded.

  • value – The numeric value of the data field.

  • unit – The unit string of the data field.

Returns:

The motor log (for call chaining).

velocity(velocity: wpimath.units.meters_per_second) wpilib._wpilib.sysid.SysIdRoutineLog.MotorLog

Log the linear velocity of the motor.

Parameters:

velocity – The linear velocity to record.

Returns:

The motor log (for call chaining).

voltage(voltage: wpimath.units.volts) wpilib._wpilib.sysid.SysIdRoutineLog.MotorLog

Log the voltage applied to the motor.

Parameters:

voltage – The voltage to record.

Returns:

The motor log (for call chaining).

motor(motorName: str) wpilib._wpilib.sysid.SysIdRoutineLog.MotorLog

Log data from a motor during a SysId routine.

Parameters:

motorName – The name of the motor.

Returns:

Handle with chainable callbacks to log individual data fields.

recordState(state: wpilib._wpilib.sysid.State) None

Records the current state of the SysId test routine. Should be called once per iteration during tests with the type of the current test, and once upon test end with state none.

Parameters:

state – The current state of the SysId test routine.

static stateEnumToString(state: wpilib._wpilib.sysid.State) str