[wpilib] Fix SysId log key for acceleration (#6196)

Also add to docs that logging acceleration and current is optional.
This commit is contained in:
Tyler Veness
2024-01-10 20:48:23 -08:00
committed by GitHub
parent 211c2a375c
commit ba9c21cf38
2 changed files with 14 additions and 2 deletions

View File

@@ -163,12 +163,14 @@ public class SysIdRoutineLog {
/**
* Log the linear acceleration of the motor.
*
* <p>This is optional; SysId can perform an accurate fit without it.
*
* @param acceleration The linear acceleration to record.
* @return The motor log (for call chaining).
*/
public MotorLog linearAcceleration(Measure<Velocity<Velocity<Distance>>> acceleration) {
return value(
"position",
"acceleration",
acceleration.in(MetersPerSecond.per(Second)),
MetersPerSecond.per(Second).name());
}
@@ -176,12 +178,14 @@ public class SysIdRoutineLog {
/**
* Log the angular acceleration of the motor.
*
* <p>This is optional; SysId can perform an accurate fit without it.
*
* @param acceleration The angular acceleration to record.
* @return The motor log (for call chaining).
*/
public MotorLog angularAcceleration(Measure<Velocity<Velocity<Angle>>> acceleration) {
return value(
"position",
"acceleration",
acceleration.in(RotationsPerSecond.per(Second)),
RotationsPerSecond.per(Second).name());
}
@@ -189,6 +193,8 @@ public class SysIdRoutineLog {
/**
* Log the current applied to the motor.
*
* <p>This is optional; SysId can perform an accurate fit without it.
*
* @param current The current to record.
* @return The motor log (for call chaining).
*/