mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-07-28 04:07:46 +00:00
pybricks.robotics.DriveBase: Add brake.
This commit is contained in:
@@ -39,6 +39,8 @@
|
||||
|
||||
.. automethod:: pybricks.robotics.DriveBase.stop
|
||||
|
||||
.. automethod:: pybricks.robotics.DriveBase.brake
|
||||
|
||||
.. rubric:: Measuring
|
||||
|
||||
.. automethod:: pybricks.robotics.DriveBase.distance
|
||||
|
||||
@@ -985,6 +985,7 @@ METHOD_PARAMS = [
|
||||
[(["speed: Number", "turn_rate: Number"], "None")],
|
||||
),
|
||||
pytest.param("pybricks.robotics", "DriveBase", "stop", [([], "None")]),
|
||||
pytest.param("pybricks.robotics", "DriveBase", "brake", [([], "None")]),
|
||||
pytest.param("pybricks.robotics", "DriveBase", "distance", [([], "int")]),
|
||||
pytest.param("pybricks.robotics", "DriveBase", "angle", [([], "int")]),
|
||||
pytest.param(
|
||||
|
||||
@@ -86,6 +86,12 @@ class DriveBase:
|
||||
|
||||
Stops the robot by letting the motors spin freely."""
|
||||
|
||||
def brake(self) -> None:
|
||||
"""brake()
|
||||
|
||||
Stops the robot by passively braking the motors.
|
||||
"""
|
||||
|
||||
def distance(self) -> int:
|
||||
"""distance() -> int: mm
|
||||
|
||||
|
||||
Reference in New Issue
Block a user