api: add heading for devices with a gyro

This commit is contained in:
Laurens Valk
2019-07-02 14:07:36 +02:00
parent aa10118cfe
commit d198c45845
+26 -1
View File
@@ -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.