Skip to content

Commit

Permalink
add optional precheck callback param
Browse files Browse the repository at this point in the history
  • Loading branch information
yconst committed Apr 5, 2024
1 parent d0c9eec commit 09f577e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion studio/Python/tests/tm_test_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@ def reset_and_wait(cls, timeout=0.5):
cls.tm.reset()
time.sleep(timeout)

def try_calibrate(self, force=False, *args, **kwargs):
def try_calibrate(self, force=False, precheck_callback=None, *args, **kwargs):
if True == force or not self.tm.calibrated:
self.tm.controller.calibrate()
self.wait_for_calibration(*args, **kwargs)
if precheck_callback:
precheck_callback(self.tm)
self.assertTrue(self.tm.calibrated)

def wait_for_calibration(self, check_interval=0.05):
Expand Down

0 comments on commit 09f577e

Please sign in to comment.