pybricks.robotics.DriveBase: Add brake.

This commit is contained in:
Laurens Valk
2023-10-26 14:18:56 +02:00
parent 3335042218
commit d935841399
3 changed files with 9 additions and 0 deletions
+2
View File
@@ -39,6 +39,8 @@
.. automethod:: pybricks.robotics.DriveBase.stop
.. automethod:: pybricks.robotics.DriveBase.brake
.. rubric:: Measuring
.. automethod:: pybricks.robotics.DriveBase.distance
+1
View File
@@ -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(
+6
View File
@@ -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