pybricks.common.Accelerometer: Move tilt to simple.

The Move Hub has it too now.
This commit is contained in:
Laurens Valk
2023-11-13 08:49:15 +01:00
parent 0d0d479a86
commit d7f9723f6f
+14 -14
View File
@@ -998,6 +998,20 @@ class SimpleAccelerometer:
``Side.FRONT`` or ``Side.BACK``.
"""
def tilt(self) -> Tuple[int, int]:
"""tilt() -> Tuple[int, int]
Gets the pitch and roll angles. This is relative to the
:ref:`user-specified neutral orientation <robotframe>`.
The order of rotation is pitch-then-roll. This is equivalent to a
positive rotation along the robot y-axis and then a positive rotation
along the x-axis.
Returns:
Tuple of pitch and roll angles in degrees.
"""
class Accelerometer(SimpleAccelerometer):
"""Get measurements from an accelerometer."""
@@ -1027,20 +1041,6 @@ class Accelerometer(SimpleAccelerometer):
this returns a vector of accelerations along all axes.
"""
def tilt(self) -> Tuple[int, int]:
"""tilt() -> Tuple[int, int]
Gets the pitch and roll angles. This is relative to the
:ref:`user-specified neutral orientation <robotframe>`.
The order of rotation is pitch-then-roll. This is equivalent to a
positive rotation along the robot y-axis and then a positive rotation
along the x-axis.
Returns:
Tuple of pitch and roll angles in degrees.
"""
class IMU(Accelerometer):
def ready(self) -> bool: