From d9eba4bb22797a37d0d9ef9c1807cd073f43b7b3 Mon Sep 17 00:00:00 2001 From: DeltaDizzy Date: Sat, 21 Feb 2026 17:36:36 -0500 Subject: [PATCH] [wpilib] Document zero angle in SingleJointedArmSim (NFC) (#7756) Fixes #7752 --------- Co-authored-by: sciencewhiz Co-authored-by: Tyler Veness --- .../frc/simulation/SingleJointedArmSim.h | 18 ++++++++++++------ .../simulation/SingleJointedArmSim.java | 18 ++++++++++++------ 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/wpilibc/src/main/native/include/frc/simulation/SingleJointedArmSim.h b/wpilibc/src/main/native/include/frc/simulation/SingleJointedArmSim.h index 36924f8d0f..59d041b1ec 100644 --- a/wpilibc/src/main/native/include/frc/simulation/SingleJointedArmSim.h +++ b/wpilibc/src/main/native/include/frc/simulation/SingleJointedArmSim.h @@ -30,10 +30,13 @@ class SingleJointedArmSim : public LinearSystemSim<2, 1, 2> { * @param gearing The gear ratio of the arm (numbers greater than 1 * represent reductions). * @param armLength The length of the arm. - * @param minAngle The minimum angle that the arm is capable of. - * @param maxAngle The maximum angle that the arm is capable of. + * @param minAngle The minimum angle that the arm is capable of, + * with 0 being horizontal. + * @param maxAngle The maximum angle that the arm is capable of, + * with 0 being horizontal. * @param simulateGravity Whether gravity should be simulated or not. - * @param startingAngle The initial position of the arm. + * @param startingAngle The initial position of the arm, with 0 being + * horizontal. * @param measurementStdDevs The standard deviations of the measurements. */ SingleJointedArmSim(const LinearSystem<2, 1, 2>& system, @@ -52,10 +55,13 @@ class SingleJointedArmSim : public LinearSystemSim<2, 1, 2> { * @param moi The moment of inertia of the arm. This can be * calculated from CAD software. * @param armLength The length of the arm. - * @param minAngle The minimum angle that the arm is capable of. - * @param maxAngle The maximum angle that the arm is capable of. + * @param minAngle The minimum angle that the arm is capable of, + * with 0 being horizontal. + * @param maxAngle The maximum angle that the arm is capable of, + * with 0 being horizontal. * @param simulateGravity Whether gravity should be simulated or not. - * @param startingAngle The initial position of the arm. + * @param startingAngle The initial position of the arm, with 0 being + * horizontal. * @param measurementStdDevs The standard deviation of the measurement noise. */ SingleJointedArmSim(const DCMotor& gearbox, double gearing, diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/simulation/SingleJointedArmSim.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/simulation/SingleJointedArmSim.java index 7d7ae78284..bcb66ea45a 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/simulation/SingleJointedArmSim.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/simulation/SingleJointedArmSim.java @@ -44,10 +44,13 @@ public class SingleJointedArmSim extends LinearSystemSim { * @param gearbox The type of and number of motors in the arm gearbox. * @param gearing The gearing of the arm (numbers greater than 1 represent reductions). * @param armLengthMeters The length of the arm. - * @param minAngleRads The minimum angle that the arm is capable of. - * @param maxAngleRads The maximum angle that the arm is capable of. + * @param minAngleRads The minimum angle that the arm is capable of, with 0 radians being + * horizontal. + * @param maxAngleRads The maximum angle that the arm is capable of, with 0 radians being + * horizontal. * @param simulateGravity Whether gravity should be simulated or not. - * @param startingAngleRads The initial position of the Arm simulation in radians. + * @param startingAngleRads The initial position of the Arm simulation in radians, with 0 radians + * being horizontal. * @param measurementStdDevs The standard deviations of the measurements. Can be omitted if no * noise is desired. If present must have 1 element for position. */ @@ -80,10 +83,13 @@ public class SingleJointedArmSim extends LinearSystemSim { * @param gearing The gearing of the arm (numbers greater than 1 represent reductions). * @param jKgMetersSquared The moment of inertia of the arm; can be calculated from CAD software. * @param armLengthMeters The length of the arm. - * @param minAngleRads The minimum angle that the arm is capable of. - * @param maxAngleRads The maximum angle that the arm is capable of. + * @param minAngleRads The minimum angle that the arm is capable of, with 0 radians being + * horizontal. + * @param maxAngleRads The maximum angle that the arm is capable of, with 0 radians being + * horizontal. * @param simulateGravity Whether gravity should be simulated or not. - * @param startingAngleRads The initial position of the Arm simulation in radians. + * @param startingAngleRads The initial position of the Arm simulation in radians, with 0 radians + * being horizontal. * @param measurementStdDevs The standard deviations of the measurements. Can be omitted if no * noise is desired. If present must have 1 element for position. */