mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-12 01:24:17 +00:00
api: add Axis.ALL identifier
This commit is contained in:
+6
-4
@@ -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).
|
||||
|
||||
"""
|
||||
|
||||
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user