tests: Update for IMU changes.

This commit is contained in:
Laurens Valk
2025-02-25 11:16:27 +01:00
parent 827eda031b
commit c5cfcd0ac8
9 changed files with 85 additions and 50 deletions
+7 -7
View File
@@ -1028,7 +1028,7 @@ class SimpleAccelerometer:
class IMU:
def up(self, calibrated=True) -> Side:
def up(self, calibrated: bool = True) -> Side:
"""up(calibrated=True) -> Side
Checks which side of the hub currently faces upward.
@@ -1043,7 +1043,7 @@ class IMU:
``Side.FRONT`` or ``Side.BACK``.
"""
def tilt(self, calibrated=True) -> Tuple[int, int]:
def tilt(self, calibrated: bool = True) -> Tuple[int, int]:
"""tilt(calibrated=True) -> Tuple[int, int]
Gets the pitch and roll angles. This is relative to the
@@ -1063,10 +1063,10 @@ class IMU:
"""
@overload
def acceleration(self, axis: Axis = None, calibrated=True) -> float: ...
def acceleration(self, axis: Axis = None, calibrated: bool = True) -> float: ...
@overload
def acceleration(self, calibrated=True) -> Matrix: ...
def acceleration(self, calibrated: bool = True) -> Matrix: ...
def acceleration(self, *args):
"""
@@ -1246,10 +1246,10 @@ class IMU:
"""
@overload
def angular_velocity(self, axis: Axis = None, calibrated=True) -> float: ...
def angular_velocity(self, axis: Axis = None, calibrated: bool = True) -> float: ...
@overload
def angular_velocity(self, calibrated=True) -> Matrix: ...
def angular_velocity(self, calibrated: bool = True) -> Matrix: ...
def angular_velocity(self, *args):
"""
@@ -1271,7 +1271,7 @@ class IMU:
this returns a vector of accelerations along all axes.
"""
def rotation(self, axis: Axis, calibrated=True) -> float:
def rotation(self, axis: Axis, calibrated: bool = True) -> float:
"""
rotation(axis, calibrated=True) -> float: deg
+1 -1
View File
@@ -119,7 +119,7 @@ class DriveBase:
Tuple of distance, drive speed, angle, and turn rate of the robot.
"""
def reset(self, distance=0, angle=0) -> None:
def reset(self, distance: Number = 0, angle: Number = 0) -> None:
"""reset(distance=0, angle=0)
Resets the estimated driven distance and heading angle.