diff --git a/python/MotionMagic/tests/pyfrc_test.py b/python/MotionMagic/tests/pyfrc_test.py index 1c813d28..14dae84c 100644 --- a/python/MotionMagic/tests/pyfrc_test.py +++ b/python/MotionMagic/tests/pyfrc_test.py @@ -23,6 +23,9 @@ def assert_almost_equal(a: float, b: float, range_val: float): # PID loop means we should be kinda fast, let's target 10ms LOOP_PERIOD = 0.01 def wait_with_sim(time: float, fx: hardware.TalonFX, dcmotorsim: DCMotorSim): + feed_enable(0.2) + sleep(0.1) + start_time = 0 while start_time < time: feed_enable(0.1) @@ -65,7 +68,7 @@ def test_position_closed_loop(): target_control = controls.MotionMagicVoltage(position=1.0) talonfx.set_control(target_control) - wait_with_sim(1, talonfx, motorsim) + wait_with_sim(2, talonfx, motorsim) # Verify position is close to target pos.wait_for_update(1) diff --git a/python/PositionClosedLoop/tests/pyfrc_test.py b/python/PositionClosedLoop/tests/pyfrc_test.py index 47256591..0796703c 100644 --- a/python/PositionClosedLoop/tests/pyfrc_test.py +++ b/python/PositionClosedLoop/tests/pyfrc_test.py @@ -23,6 +23,9 @@ def assert_almost_equal(a: float, b: float, range_val: float): # PID loop means we should be kinda fast, let's target 10ms LOOP_PERIOD = 0.01 def wait_with_sim(time: float, fx: hardware.TalonFX, dcmotorsim: DCMotorSim): + feed_enable(0.2) + sleep(0.1) + start_time = 0 while start_time < time: feed_enable(0.1) @@ -57,7 +60,7 @@ def test_position_closed_loop(): target_control = controls.PositionVoltage(position=1.0) talonfx.set_control(target_control) - wait_with_sim(1, talonfx, motorsim) + wait_with_sim(2, talonfx, motorsim) # Verify position is close to target pos.wait_for_update(1) diff --git a/python/VelocityClosedLoop/tests/pyfrc_test.py b/python/VelocityClosedLoop/tests/pyfrc_test.py index f64d00d4..8413a739 100644 --- a/python/VelocityClosedLoop/tests/pyfrc_test.py +++ b/python/VelocityClosedLoop/tests/pyfrc_test.py @@ -20,6 +20,9 @@ def assert_almost_equal(a: float, b: float, range_val: float): # PID loop means we should be kinda fast, let's target 10ms LOOP_PERIOD = 0.01 def wait_with_sim(time: float, fx: hardware.TalonFX, dcmotorsim: DCMotorSim): + feed_enable(0.2) + sleep(0.1) + start_time = 0 while start_time < time: feed_enable(0.1) @@ -55,7 +58,7 @@ def test_velocity_closed_loop(): target_control = controls.VelocityVoltage(velocity=10) talonfx.set_control(target_control) - wait_with_sim(1, talonfx, motorsim) + wait_with_sim(2, talonfx, motorsim) # Verify velocity is close to target vel.wait_for_update(1)