mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-12 01:24:17 +00:00
api/robotics: add DriveBase state getters
This commit is contained in:
+14
-6
@@ -8,12 +8,6 @@
|
||||
.. autoclass:: pybricks.robotics.DriveBase
|
||||
:no-members:
|
||||
|
||||
.. rubric:: Manual drive control
|
||||
|
||||
.. automethod:: pybricks.robotics.DriveBase.start
|
||||
|
||||
.. automethod:: pybricks.robotics.DriveBase.stop
|
||||
|
||||
.. rubric:: Automatic drive control
|
||||
|
||||
.. automethod:: pybricks.robotics.DriveBase.straight
|
||||
@@ -23,3 +17,17 @@
|
||||
.. automethod:: pybricks.robotics.DriveBase.arc
|
||||
|
||||
.. automethod:: pybricks.robotics.DriveBase.set_drive_settings
|
||||
|
||||
.. rubric:: Manual drive control
|
||||
|
||||
.. automethod:: pybricks.robotics.DriveBase.start
|
||||
|
||||
.. automethod:: pybricks.robotics.DriveBase.stop
|
||||
|
||||
.. rubric:: Measuring
|
||||
|
||||
.. automethod:: pybricks.robotics.DriveBase.distance
|
||||
|
||||
.. automethod:: pybricks.robotics.DriveBase.angle
|
||||
|
||||
.. automethod:: pybricks.robotics.DriveBase.reset
|
||||
|
||||
@@ -42,6 +42,26 @@ class DriveBase():
|
||||
"""
|
||||
pass
|
||||
|
||||
def distance(self):
|
||||
"""Get the estimated accumulated driven distance.
|
||||
|
||||
Returns:
|
||||
:ref:`distance`: Driven distance since last reset.
|
||||
"""
|
||||
pass
|
||||
|
||||
def angle(self):
|
||||
"""Get the estimated accumulated rotation angle of the drivebase.
|
||||
|
||||
Returns:
|
||||
:ref:`angle`: Accumulated angle since last reset.
|
||||
"""
|
||||
pass
|
||||
|
||||
def reset(self):
|
||||
"""Reset the accumulated driven distance and angle to 0."""
|
||||
pass
|
||||
|
||||
def set_drive_settings(self, drive_speed, drive_acceleration, turn_rate,
|
||||
turn_acceleration, stop_type):
|
||||
"""Configure the behavior of the :meth:`.straight`, :meth:`.turn`,
|
||||
|
||||
Reference in New Issue
Block a user