mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-12 01:24:17 +00:00
31 lines
2.3 KiB
ReStructuredText
31 lines
2.3 KiB
ReStructuredText
Stop
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
.. autoclass:: pybricks.parameters.Stop
|
|
:no-members:
|
|
|
|
The following table shows how each stop type adds an extra level of
|
|
resistance to motion. In these examples, ``m`` is a
|
|
:class:`Motor <pybricks.pupdevices.Motor>` and
|
|
and ``d`` is a :class:`DriveBase <pybricks.robotics.DriveBase>`. The
|
|
examples also show how running at zero speed compares to these stop types.
|
|
|
|
+--------+------------+--------+-------------+---------------+-----------------------------------------+
|
|
| | Type | | Friction | | Back | | Speed | | Angle kept | | Examples |
|
|
| | | | EMF | | kept at 0 | | at target | |
|
|
+========+============+========+=============+===============+=========================================+
|
|
| Coast | + | | | | | ``m.stop()`` |
|
|
| | | | | | | ``m.run_target(500, 90, Stop.COAST)`` |
|
|
+--------+------------+--------+-------------+---------------+-----------------------------------------+
|
|
| Brake | + | + | | | | ``m.brake()`` |
|
|
| | | | | | | ``m.run_target(500, 90, Stop.BRAKE)`` |
|
|
+--------+------------+--------+-------------+---------------+-----------------------------------------+
|
|
| | + | + | + | | | ``m.run(0)`` |
|
|
| | | | | | | ``d.drive(0, 0)`` |
|
|
+--------+------------+--------+-------------+---------------+-----------------------------------------+
|
|
| Hold | + | + | + | + | | ``m.hold()`` |
|
|
| | | | | | | ``m.run_target(500, 90, Stop.HOLD)`` |
|
|
| | | | | | | ``d.straight(0)`` |
|
|
| | | | | | | ``d.straight(100)`` |
|
|
+--------+------------+--------+-------------+---------------+-----------------------------------------+
|