api: add Axis.ALL identifier

This commit is contained in:
Laurens Valk
2019-07-02 13:08:20 +02:00
parent 240d21bcca
commit e722451af1
2 changed files with 11 additions and 4 deletions
+6 -4
View File
@@ -628,17 +628,19 @@ class Accelerometer():
"""
pass
def acceleration(self, axis=None):
"""Measure the acceleration of the device along a given axis in the
def acceleration(self, axis=Axis.ALL):
"""acceleration(axis=Axis.ALL)
Measure the acceleration of the device along a given axis in the
:ref:`robot reference frame <robotframe>`.
Arguments:
axis (Axis): Axis along which the acceleration is
measured. (*Default*: ``None``)
measured. (*Default*: ``axis=Axis.ALL``)
Returns:
:ref:`linacceleration`. Returns a :ref:`scalar` of the acceleration
along the specified axis.
If ``axis`` is ``None``, you get a :ref:`vector` with the
If you choose ``axis=Axis.ALL``, you get a :ref:`vector` with the
accelerations along all three axes (x, y, z).
"""
+5
View File
@@ -192,10 +192,15 @@ class Axis():
.. data:: X
.. data:: Y
.. data:: Z
Some methods let you measure along all axes at once:
.. data:: ALL
"""
X = (1, 0, 0)
Y = (0, 1, 0)
Z = (0, 0, 1)
ALL = None
class Align():