Skip to content

Commit 4089cbc

Browse files
committed
Black
1 parent 76d84ac commit 4089cbc

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

tests/units/online/test_mobile_base.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010

1111
# Note: depending on the test, the expected tolerance can be very strict or depend on the requested tolerance of a goto command.
1212

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)
1515

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)
1818

1919
HIGH_PRECISION_TOL = 0.0001
2020

@@ -97,7 +97,9 @@ def test_reset_odometry(reachy_sdk_zeroed: ReachySDK) -> None:
9797

9898
dist_tol = 0.01
9999
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+
)
101103
time.sleep(0.2)
102104
odom = reachy_sdk_zeroed.mobile_base.get_current_odometry()
103105
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:
380382
assert not np.isclose(odom["x"], 0.8, atol=GOTO_DIST_TOL)
381383
assert not np.isclose(odom["y"], 0.5, atol=GOTO_DIST_TOL)
382384
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
384386
odom = reachy_sdk_zeroed.mobile_base.get_current_odometry()
385387
assert not np.isclose(odom["x"], 0.8, atol=DEFAULT_DIST_TOL)
386388
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:
410412
assert np.isclose(request2.request.target["theta"], 0, atol=DEFAULT_ANGLE_TOL)
411413
assert np.isclose(request2.request.timeout, 0.8, atol=DEFAULT_DIST_TOL)
412414

415+
413416
@pytest.mark.online
414417
def test_mobile_base_goto_tolerances(reachy_sdk_zeroed: ReachySDK) -> None:
415418
if reachy_sdk_zeroed.mobile_base is not None:
@@ -640,6 +643,7 @@ def test_set_max_xy_goto(reachy_sdk_zeroed: ReachySDK) -> None:
640643

641644
reachy_sdk_zeroed.mobile_base.set_max_xy_goto(1.0)
642645

646+
643647
@pytest.mark.mobile_base
644648
def test_get_map(reachy_sdk_zeroed: ReachySDK) -> None:
645649
if reachy_sdk_zeroed.mobile_base is not None:
@@ -651,4 +655,4 @@ def test_get_map(reachy_sdk_zeroed: ReachySDK) -> None:
651655
def test_obstacle_detection(reachy_sdk_zeroed: ReachySDK) -> None:
652656
if reachy_sdk_zeroed.mobile_base is not None:
653657
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

Comments
 (0)