@@ -44,6 +44,9 @@ def __init__(self, motor_ids: list[int] | None = None) -> None:
4444 "i_coefficient" : [0 ] * 6 ,
4545 "d_coefficient" : [32 ] * 6 ,
4646 "return_delay_time" : [250 ] * 6 ,
47+ "maximum_acceleration" : [50 ] * 6 ,
48+ "max_torque_limit" : [1000 ] * 6 ,
49+ "protection_current" : [310 ] * 6 ,
4750 "lock" : [0 ] * 6 ,
4851 }
4952 self .writes : list [tuple [int , str , int ]] = []
@@ -118,6 +121,10 @@ def test_draft_is_read_only_and_save_creates_a_standalone_configuration(
118121 assert (session .state .backup / "registers.json" ).is_file ()
119122 assert bus .registers ["p_coefficient" ] == [16 , 32 , 32 , 16 , 16 , 16 ]
120123 assert bus .registers ["return_delay_time" ] == [0 ] * 6
124+ assert bus .registers ["maximum_acceleration" ] == [254 ] * 6
125+ assert bus .registers ["max_torque_limit" ] == [1000 ] * 5 + [500 ]
126+ assert bus .registers ["protection_current" ] == [310 ] * 5 + [250 ]
127+ assert not (session .directory / "servo-overrides.toml" ).exists ()
121128 assert bus .registers ["torque_enable" ] == [0 ] * 6
122129 assert not any (register in {"torque_enable" , "goal_position" } for _ , register , _ in bus .writes )
123130 assert bus .closed
@@ -212,6 +219,7 @@ def test_matching_saved_calibration_skips_manual_steps_and_preserves_tuned_endpo
212219 assert "servos" not in document
213220 document ["servos" ] = {"expected_position_gains_by_motor" : {"2" : [24 , 0 , 32 ]}}
214221 (session .directory / "setup.toml" ).write_text (tomli_w .dumps (document ))
222+ (session .directory / "servo-overrides.toml" ).write_text ("maximum_acceleration = 100\n " )
215223 setup = NativeSetupStore ().load (session .directory , "ARM_A" )
216224 writes_before_reconnect = list (bus .writes )
217225 reconnected = CalibrationSession (setup , session .directory , session .calibration_root , bus )
@@ -223,6 +231,7 @@ def test_matching_saved_calibration_skips_manual_steps_and_preserves_tuned_endpo
223231 assert saved_setup .gripper .open_position_radians == 1.0
224232 assert saved_setup .servos .expected_position_gains_by_motor [2 ] == [32 , 0 , 32 ]
225233 assert bus .registers ["p_coefficient" ][1 ] == 32
234+ assert bus .registers ["maximum_acceleration" ] == [100 ] * 6
226235 assert "servos" not in tomllib .loads ((session .directory / "setup.toml" ).read_text ())
227236
228237
0 commit comments