mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-12 09:37:25 +00:00
api: add heading for devices with a gyro
This commit is contained in:
+26
-1
@@ -655,7 +655,7 @@ class Accelerometer():
|
||||
along the y-axis.
|
||||
|
||||
Returns:
|
||||
(:ref:`angle`, :ref:`angle`). Pitch and roll angles.
|
||||
(:ref:`angle`, :ref:`angle`): Pitch and roll angles.
|
||||
|
||||
"""
|
||||
pass
|
||||
@@ -685,6 +685,31 @@ class Accelerometer():
|
||||
pass
|
||||
|
||||
|
||||
class IMU(Accelerometer):
|
||||
|
||||
def heading(self):
|
||||
"""Get the heading angle relative to the starting orientation. It is a
|
||||
a positive rotation around the :ref:`z-axis in the robot
|
||||
frame <robotframe>`, prior to applying any tilt rotation.
|
||||
|
||||
For a vehicle viewed from the top, this means that
|
||||
a positive heading value corresponds to a counterclockwise rotation.
|
||||
|
||||
Returns:
|
||||
:ref:`angle`: Heading angle relative to starting orientation.
|
||||
|
||||
"""
|
||||
pass
|
||||
|
||||
def reset_heading(self, angle):
|
||||
"""Reset the accumulated heading angle of the robot.
|
||||
|
||||
Arguments:
|
||||
angle (:ref:`angle`): Value to which the heading should be reset.
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
# Workaround for documenting instance attributes such as <self.light> of the
|
||||
# the ColorDistanceSensor. Autodoc does not pick those up, so instantiate them
|
||||
# here. Modules can just import them as needed.
|
||||
|
||||
Reference in New Issue
Block a user