10
10
11
11
# Note: depending on the test, the expected tolerance can be very strict or depend on the requested tolerance of a goto command.
12
12
13
- DEFAULT_DIST_TOL = 0.01 # in meters (sometimes used as m/s)
14
- DEFAULT_ANGLE_TOL = 1.0 # in degrees (sometimes used as rad/s)
13
+ DEFAULT_DIST_TOL = 0.01 # in meters (sometimes used as m/s)
14
+ DEFAULT_ANGLE_TOL = 1.0 # in degrees (sometimes used as rad/s)
15
15
16
- GOTO_DIST_TOL = 0.05 # in meters (default value when no tolerance is provided in goto command)
17
- GOTO_ANGLE_TOL = 5 # in degrees (default value when no tolerance is provided in goto command)
16
+ GOTO_DIST_TOL = 0.05 # in meters (default value when no tolerance is provided in goto command)
17
+ GOTO_ANGLE_TOL = 5 # in degrees (default value when no tolerance is provided in goto command)
18
18
19
19
HIGH_PRECISION_TOL = 0.0001
20
20
@@ -97,7 +97,9 @@ def test_reset_odometry(reachy_sdk_zeroed: ReachySDK) -> None:
97
97
98
98
dist_tol = 0.01
99
99
angle_tol = 0.1
100
- reachy_sdk_zeroed .mobile_base .goto (x = 0.5 , y = 0.5 , theta = 50 , wait = True , distance_tolerance = dist_tol , angle_tolerance = angle_tol )
100
+ reachy_sdk_zeroed .mobile_base .goto (
101
+ x = 0.5 , y = 0.5 , theta = 50 , wait = True , distance_tolerance = dist_tol , angle_tolerance = angle_tol
102
+ )
101
103
time .sleep (0.2 )
102
104
odom = reachy_sdk_zeroed .mobile_base .get_current_odometry ()
103
105
assert np .isclose (odom ["x" ], 0.5 , atol = dist_tol )
@@ -380,7 +382,7 @@ def test_mobile_base_goto_timeout(reachy_sdk_zeroed: ReachySDK) -> None:
380
382
assert not np .isclose (odom ["x" ], 0.8 , atol = GOTO_DIST_TOL )
381
383
assert not np .isclose (odom ["y" ], 0.5 , atol = GOTO_DIST_TOL )
382
384
assert not np .isclose (odom ["theta" ], 80 , atol = GOTO_ANGLE_TOL )
383
- time .sleep (0.5 ) # Giving it some time to get closer
385
+ time .sleep (0.5 ) # Giving it some time to get closer
384
386
odom = reachy_sdk_zeroed .mobile_base .get_current_odometry ()
385
387
assert not np .isclose (odom ["x" ], 0.8 , atol = DEFAULT_DIST_TOL )
386
388
assert not np .isclose (odom ["y" ], 0.5 , atol = DEFAULT_DIST_TOL )
@@ -410,6 +412,7 @@ def test_mobile_base_goto_timeout(reachy_sdk_zeroed: ReachySDK) -> None:
410
412
assert np .isclose (request2 .request .target ["theta" ], 0 , atol = DEFAULT_ANGLE_TOL )
411
413
assert np .isclose (request2 .request .timeout , 0.8 , atol = DEFAULT_DIST_TOL )
412
414
415
+
413
416
@pytest .mark .online
414
417
def test_mobile_base_goto_tolerances (reachy_sdk_zeroed : ReachySDK ) -> None :
415
418
if reachy_sdk_zeroed .mobile_base is not None :
@@ -640,6 +643,7 @@ def test_set_max_xy_goto(reachy_sdk_zeroed: ReachySDK) -> None:
640
643
641
644
reachy_sdk_zeroed .mobile_base .set_max_xy_goto (1.0 )
642
645
646
+
643
647
@pytest .mark .mobile_base
644
648
def test_get_map (reachy_sdk_zeroed : ReachySDK ) -> None :
645
649
if reachy_sdk_zeroed .mobile_base is not None :
@@ -651,4 +655,4 @@ def test_get_map(reachy_sdk_zeroed: ReachySDK) -> None:
651
655
def test_obstacle_detection (reachy_sdk_zeroed : ReachySDK ) -> None :
652
656
if reachy_sdk_zeroed .mobile_base is not None :
653
657
status = reachy_sdk_zeroed .mobile_base .lidar .obstacle_detection_status
654
- assert status == "NO_OBJECT_DETECTED"
658
+ assert status == "NO_OBJECT_DETECTED"
0 commit comments