mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[examples] Fix flaky ArmSimulationTest (#7170)
Co-authored-by: Starlight220 <53231611+Starlight220@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
fc83d4868c
commit
5acb4109ff
@@ -50,11 +50,11 @@ class ArmSimulationTest : public testing::TestWithParam<units::degree_t> {
|
||||
TEST_P(ArmSimulationTest, Teleop) {
|
||||
EXPECT_TRUE(frc::Preferences::ContainsKey(kArmPositionKey));
|
||||
EXPECT_TRUE(frc::Preferences::ContainsKey(kArmPKey));
|
||||
EXPECT_DOUBLE_EQ(kDefaultArmSetpoint.value(),
|
||||
frc::Preferences::GetDouble(kArmPositionKey, NAN));
|
||||
|
||||
frc::Preferences::SetDouble(kArmPositionKey, GetParam().value());
|
||||
units::degree_t setpoint = GetParam();
|
||||
EXPECT_DOUBLE_EQ(setpoint.value(),
|
||||
frc::Preferences::GetDouble(kArmPositionKey, NAN));
|
||||
|
||||
// teleop init
|
||||
{
|
||||
frc::sim::DriverStationSim::SetAutonomous(false);
|
||||
@@ -68,7 +68,7 @@ TEST_P(ArmSimulationTest, Teleop) {
|
||||
{
|
||||
frc::sim::StepTiming(3_s);
|
||||
|
||||
// Ensure elevator is still at 0.
|
||||
// Ensure arm is still at minimum angle.
|
||||
EXPECT_NEAR(kMinAngle.value(), m_encoderSim.GetDistance(), 2.0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user