diff --git a/wpilibc/src/main/native/include/frc/simulation/LinearSystemSim.h b/wpilibc/src/main/native/include/frc/simulation/LinearSystemSim.h index 9023f44f14..e24d2ad9cc 100644 --- a/wpilibc/src/main/native/include/frc/simulation/LinearSystemSim.h +++ b/wpilibc/src/main/native/include/frc/simulation/LinearSystemSim.h @@ -99,13 +99,11 @@ class LinearSystemSim { void SetInput(const Eigen::Matrix& u) { m_u = u; } /** - * Resets the system state. + * Sets the system state. * - * @param state The state to reset to. + * @param state The state. */ - void ResetState(const Eigen::Matrix& state) { - m_x = state; - } + void SetState(const Eigen::Matrix& state) { m_x = state; } protected: /** diff --git a/wpilibc/src/test/native/cpp/simulation/SingleJointedArmSimTest.cpp b/wpilibc/src/test/native/cpp/simulation/SingleJointedArmSimTest.cpp index 8c4c659b6d..12bbfdbded 100644 --- a/wpilibc/src/test/native/cpp/simulation/SingleJointedArmSimTest.cpp +++ b/wpilibc/src/test/native/cpp/simulation/SingleJointedArmSimTest.cpp @@ -14,7 +14,7 @@ TEST(SingleJointedArmTest, Disabled) { frc::sim::SingleJointedArmSim sim(frc::DCMotor::Vex775Pro(2), 100, 10_kg, 9.5_in, -180_deg, 0_deg, false, {0.0}, true); - sim.ResetState(frc::MakeMatrix<2, 1>(0.0, 0.0)); + sim.SetState(frc::MakeMatrix<2, 1>(0.0, 0.0)); for (size_t i = 0; i < 12 / 0.02; ++i) { sim.SetInput(frc::MakeMatrix<1, 1>(0.0)); diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/simulation/LinearSystemSim.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/simulation/LinearSystemSim.java index 315c530483..a82ea6a58f 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/simulation/LinearSystemSim.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/simulation/LinearSystemSim.java @@ -121,7 +121,12 @@ public class LinearSystemSim state) { + /** + * Sets the system state. + * + * @param state The state. + */ + public void setState(Matrix state) { m_x = state; } diff --git a/wpilibj/src/test/java/edu/wpi/first/wpilibj/simulation/ArmSimTest.java b/wpilibj/src/test/java/edu/wpi/first/wpilibj/simulation/ArmSimTest.java index c519c73e9f..e185b3809c 100644 --- a/wpilibj/src/test/java/edu/wpi/first/wpilibj/simulation/ArmSimTest.java +++ b/wpilibj/src/test/java/edu/wpi/first/wpilibj/simulation/ArmSimTest.java @@ -25,7 +25,7 @@ public class ArmSimTest { @Test public void testArmDisabled() { - m_sim.resetState(VecBuilder.fill(0.0, 0.0)); + m_sim.setState(VecBuilder.fill(0.0, 0.0)); for (int i = 0; i < 12 / 0.02; i++) { m_sim.setInput(0.0);