From 1d5956a58ab540b59d0f70119b13585d2fc39887 Mon Sep 17 00:00:00 2001 From: Laurens Valk Date: Mon, 28 Nov 2022 17:01:06 +0100 Subject: [PATCH] pybricks.parameters.Stop: Document COAST_SMART. See https://github.com/pybricks/pybricks-api/issues/104 --- doc/main/parameters/stop.rst | 3 +++ src/pybricks/parameters.py | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/doc/main/parameters/stop.rst b/doc/main/parameters/stop.rst index 50b5a2d..010c714 100644 --- a/doc/main/parameters/stop.rst +++ b/doc/main/parameters/stop.rst @@ -10,6 +10,9 @@ Stop .. autoattribute:: pybricks.parameters.Stop.COAST :annotation: + .. autoattribute:: pybricks.parameters.Stop.COAST_SMART + :annotation: + .. autoattribute:: pybricks.parameters.Stop.BRAKE :annotation: diff --git a/src/pybricks/parameters.py b/src/pybricks/parameters.py index d6a301a..83aaa22 100644 --- a/src/pybricks/parameters.py +++ b/src/pybricks/parameters.py @@ -157,6 +157,12 @@ class Stop(_PybricksEnum): COAST: Stop = 0 """Let the motor move freely.""" + COAST_SMART: Stop = 4 + """Let the motor move freely. For the next relative angle maneuver, + take the last target angle (instead of the current angle) as the new + starting point. This reduces cumulative errors. This will apply only if the + current angle is less than twice the configured position tolerance.""" + BRAKE: Stop = 1 """Passively resist small external forces."""