Skip to content

Commit

Permalink
update simple test for compatibility with M5
Browse files Browse the repository at this point in the history
  • Loading branch information
yconst committed Apr 26, 2024
1 parent 0abc02a commit 69638a3
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions studio/Python/tests/test_base_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,23 @@ def test_position_control(self):
"""
Test position control
"""
hw_rev = self.tm.hw_revision
self.check_state(0)
self.tm.motor.I_cal = 5
if hw_rev > 20:
self.tm.motor.I_cal = 0.8
else:
self.tm.motor.I_cal = 5
self.tm.controller.current.Iq_limit = 5
self.try_calibrate()
self.tm.controller.position_mode()
self.check_state(2)

for i in range(5):
self.tm.controller.position.setpoint = i * 3000 * ticks
time.sleep(0.25)
if hw_rev > 20:
time.sleep(0.50)
else:
time.sleep(0.25)
self.assertAlmostEqual(
i * 3000 * ticks, self.tm.sensors.user_frame.position_estimate, delta=1000 * ticks
)
Expand Down

0 comments on commit 69638a3

Please sign in to comment.