From b077d0ce29273ce5e38e3d89ddf0f79cff9798a7 Mon Sep 17 00:00:00 2001 From: ahiuchingau <20424172+ahiuchingau@users.noreply.github.com> Date: Thu, 27 Jul 2023 16:39:24 -0400 Subject: [PATCH] searpate disengage and stop --- api/src/opentrons/hardware_control/ot3api.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/api/src/opentrons/hardware_control/ot3api.py b/api/src/opentrons/hardware_control/ot3api.py index 465a161801d..19f391a98e3 100644 --- a/api/src/opentrons/hardware_control/ot3api.py +++ b/api/src/opentrons/hardware_control/ot3api.py @@ -692,14 +692,25 @@ async def _chained_calls() -> None: asyncio.run_coroutine_threadsafe(_chained_calls(), self._loop) - async def halt(self) -> None: - """Immediately stop motion.""" + async def stop_motors(self) -> None: + """Immediately stop motors.""" await self._backend.halt() + + def stop_modules(self) -> None: + """Immediately stop modules.""" asyncio.run_coroutine_threadsafe(self._execution_manager.cancel(), self._loop) + async def halt(self) -> None: + """Immediately disengage all present motors and clear motor and module tasks.""" + await self.disengage_axes( + [ax for ax in Axis if self._backend.axis_is_present(ax)] + ) + await self.stop_motors() + self.stop_modules() + async def stop(self, home_after: bool = True) -> None: """Stop motion as soon as possible, reset, and optionally home.""" - await self._backend.halt() + await self.stop_motors() self._log.info("Recovering from halt") await self.reset()