From 5f05124ef8875a34bdc9ec4bd9cf91ecd75825d4 Mon Sep 17 00:00:00 2001 From: Tyler Veness Date: Fri, 1 Dec 2023 20:11:43 -0800 Subject: [PATCH] Address review comments --- .../java/edu/wpi/first/cscore/HttpCamera.java | 4 +-- .../first/networktables/NetworkTableTest.java | 5 ++-- .../simulation/DifferentialDrivetrainSim.cpp | 28 ++++++++----------- .../first/wpilibj/motorcontrol/Victor.java | 3 +- .../wpilibj/smartdashboard/FieldObject2d.java | 2 +- .../subsystems/Pneumatics.java | 2 +- .../wpilibj/BuiltInAccelerometerTest.java | 4 +-- .../wpi/first/wpilibj/MotorEncoderTest.java | 4 +-- .../wpi/first/wpilibj/MotorInvertingTest.java | 4 +-- .../java/edu/wpi/first/wpilibj/PDPTest.java | 4 +-- .../java/edu/wpi/first/wpilibj/PIDTest.java | 4 +-- .../edu/wpi/first/wpilibj/test/TestBench.java | 5 ++-- .../edu/wpi/first/wpilibj/test/TestSuite.java | 3 +- ...ontrolAffinePlantInversionFeedforward.java | 2 +- .../controller/ImplicitModelFollower.java | 2 +- .../LTVDifferentialDriveController.java | 2 +- .../controller/LTVUnicycleController.java | 4 +-- .../LinearPlantInversionFeedforward.java | 2 +- .../controller/LinearQuadraticRegulator.java | 9 +++--- .../math/estimator/ExtendedKalmanFilter.java | 8 +++--- .../first/math/estimator/KalmanFilter.java | 6 ++-- .../estimator/SteadyStateKalmanFilter.java | 10 +++---- .../math/estimator/UnscentedKalmanFilter.java | 10 +++---- .../wpi/first/math/filter/LinearFilter.java | 10 +++++-- .../kinematics/SwerveDriveKinematics.java | 2 +- .../first/math/spline/CubicHermiteSpline.java | 17 +++++++++-- .../math/spline/QuinticHermiteSpline.java | 22 ++++++++------- .../first/math/system/LinearSystemLoop.java | 2 +- .../estimator/ExtendedKalmanFilterTest.java | 3 +- .../estimator/UnscentedKalmanFilterTest.java | 3 +- .../wpi/first/math/geometry/Pose3dTest.java | 10 +++---- .../trajectory/TrajectoryGeneratorTest.java | 5 ++-- .../src/printlog/java/printlog/PrintLog.java | 8 +++--- 33 files changed, 109 insertions(+), 100 deletions(-) diff --git a/cscore/src/main/java/edu/wpi/first/cscore/HttpCamera.java b/cscore/src/main/java/edu/wpi/first/cscore/HttpCamera.java index 4a656b4f209..8c72350e635 100644 --- a/cscore/src/main/java/edu/wpi/first/cscore/HttpCamera.java +++ b/cscore/src/main/java/edu/wpi/first/cscore/HttpCamera.java @@ -46,7 +46,7 @@ public static HttpCameraKind getHttpCameraKindFromInt(int kind) { * Create a source for a MJPEG-over-HTTP (IP) camera. * * @param name Source name (arbitrary unique identifier) - * @param url Camera URL (e.g. "...") + * @param url Camera URL (e.g. "http://10.x.y.11/video/stream.mjpg") */ public HttpCamera(String name, String url) { super(CameraServerJNI.createHttpCamera(name, url, HttpCameraKind.kUnknown.getValue())); @@ -56,7 +56,7 @@ public HttpCamera(String name, String url) { * Create a source for a MJPEG-over-HTTP (IP) camera. * * @param name Source name (arbitrary unique identifier) - * @param url Camera URL (e.g. "...") + * @param url Camera URL (e.g. "http://10.x.y.11/video/stream.mjpg") * @param kind Camera kind (e.g. kAxis) */ public HttpCamera(String name, String url, HttpCameraKind kind) { diff --git a/ntcore/src/test/java/edu/wpi/first/networktables/NetworkTableTest.java b/ntcore/src/test/java/edu/wpi/first/networktables/NetworkTableTest.java index 4c431afbdc9..bca694b9903 100644 --- a/ntcore/src/test/java/edu/wpi/first/networktables/NetworkTableTest.java +++ b/ntcore/src/test/java/edu/wpi/first/networktables/NetworkTableTest.java @@ -6,7 +6,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals; -import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.stream.Stream; @@ -61,8 +60,8 @@ private static Stream getHierarchyArguments() { return Stream.of( Arguments.of(Collections.singletonList("/"), ""), Arguments.of(Collections.singletonList("/"), "/"), - Arguments.of(Arrays.asList("/", "/foo", "/foo/bar", "/foo/bar/baz"), "/foo/bar/baz"), - Arguments.of(Arrays.asList("/", "/foo", "/foo/bar", "/foo/bar/"), "/foo/bar/")); + Arguments.of(List.of("/", "/foo", "/foo/bar", "/foo/bar/baz"), "/foo/bar/baz"), + Arguments.of(List.of("/", "/foo", "/foo/bar", "/foo/bar/"), "/foo/bar/")); } @ParameterizedTest diff --git a/wpilibc/src/main/native/cpp/simulation/DifferentialDrivetrainSim.cpp b/wpilibc/src/main/native/cpp/simulation/DifferentialDrivetrainSim.cpp index 4d2720f5a6f..d5addb23389 100644 --- a/wpilibc/src/main/native/cpp/simulation/DifferentialDrivetrainSim.cpp +++ b/wpilibc/src/main/native/cpp/simulation/DifferentialDrivetrainSim.cpp @@ -92,26 +92,22 @@ Pose2d DifferentialDrivetrainSim::GetPose() const { } units::ampere_t DifferentialDrivetrainSim::GetLeftCurrentDraw() const { - auto loadIleft = - m_motor.Current( - units::radians_per_second_t{m_x(State::kLeftVelocity) * - m_currentGearing / m_wheelRadius.value()}, - units::volt_t{m_u(0)}) * - wpi::sgn(m_u(0)); - - return loadIleft; + return m_motor.Current(units::radians_per_second_t{m_x(State::kLeftVelocity) * + m_currentGearing / + m_wheelRadius.value()}, + units::volt_t{m_u(0)}) * + wpi::sgn(m_u(0)); } units::ampere_t DifferentialDrivetrainSim::GetRightCurrentDraw() const { - auto loadIRight = - m_motor.Current( - units::radians_per_second_t{m_x(State::kRightVelocity) * - m_currentGearing / m_wheelRadius.value()}, - units::volt_t{m_u(1)}) * - wpi::sgn(m_u(1)); - - return loadIRight; + return m_motor.Current( + units::radians_per_second_t{m_x(State::kRightVelocity) * + m_currentGearing / + m_wheelRadius.value()}, + units::volt_t{m_u(1)}) * + wpi::sgn(m_u(1)); } + units::ampere_t DifferentialDrivetrainSim::GetCurrentDraw() const { return GetLeftCurrentDraw() + GetRightCurrentDraw(); } diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/motorcontrol/Victor.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/motorcontrol/Victor.java index 97578d5de4c..d9bd15264f8 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/motorcontrol/Victor.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/motorcontrol/Victor.java @@ -17,7 +17,8 @@ * 884 controllers also but if users experience issues such as asymmetric behavior around the * deadband or inability to saturate the controller in either direction, calibration is recommended. * The calibration procedure can be found in the Victor 884 User Manual available from VEX Robotics: - * ... + * http://content.vexrobotics.com/docs/ifi-v884-users-manual-9-25-06.pdf * *