mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-07-28 04:07:46 +00:00
pybricks.common.Accelerometer: Move tilt to simple.
The Move Hub has it too now.
This commit is contained in:
+14
-14
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user