From ba9c21cf3889014655d2baee61340449cb1fff05 Mon Sep 17 00:00:00 2001 From: Tyler Veness Date: Wed, 10 Jan 2024 20:48:23 -0800 Subject: [PATCH] [wpilib] Fix SysId log key for acceleration (#6196) Also add to docs that logging acceleration and current is optional. --- .../main/native/include/frc/sysid/SysIdRoutineLog.h | 6 ++++++ .../edu/wpi/first/wpilibj/sysid/SysIdRoutineLog.java | 10 ++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/wpilibc/src/main/native/include/frc/sysid/SysIdRoutineLog.h b/wpilibc/src/main/native/include/frc/sysid/SysIdRoutineLog.h index 7f106bd173b..117d1208708 100644 --- a/wpilibc/src/main/native/include/frc/sysid/SysIdRoutineLog.h +++ b/wpilibc/src/main/native/include/frc/sysid/SysIdRoutineLog.h @@ -112,6 +112,8 @@ class SysIdRoutineLog { /** * Log the linear acceleration of the motor. * + * 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). */ @@ -122,6 +124,8 @@ class SysIdRoutineLog { /** * Log the angular acceleration of the motor. * + * 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). */ @@ -132,6 +136,8 @@ class SysIdRoutineLog { /** * Log the current applied to the motor. * + * This is optional; SysId can perform an accurate fit without it. + * * @param current The current to record. * @return The motor log (for call chaining). */ diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/sysid/SysIdRoutineLog.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/sysid/SysIdRoutineLog.java index 38bc46f4000..dac100fac0f 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/sysid/SysIdRoutineLog.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/sysid/SysIdRoutineLog.java @@ -163,12 +163,14 @@ public MotorLog angularVelocity(Measure> velocity) { /** * Log the linear acceleration of the motor. * + *

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>> acceleration) { return value( - "position", + "acceleration", acceleration.in(MetersPerSecond.per(Second)), MetersPerSecond.per(Second).name()); } @@ -176,12 +178,14 @@ public MotorLog linearAcceleration(Measure>> acceler /** * Log the angular acceleration of the motor. * + *

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>> acceleration) { return value( - "position", + "acceleration", acceleration.in(RotationsPerSecond.per(Second)), RotationsPerSecond.per(Second).name()); } @@ -189,6 +193,8 @@ public MotorLog angularAcceleration(Measure>> accelerat /** * Log the current applied to the motor. * + *

This is optional; SysId can perform an accurate fit without it. + * * @param current The current to record. * @return The motor log (for call chaining). */