From f588a729607f6a9d015a33c32756101c2cf8678e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ellensohn?= Date: Tue, 22 Aug 2023 10:23:48 +0200 Subject: [PATCH] changes in operation: testing --- rmp220_middleware/rmp220_middleware.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/rmp220_middleware/rmp220_middleware.py b/rmp220_middleware/rmp220_middleware.py index 60043b7..3bf9219 100644 --- a/rmp220_middleware/rmp220_middleware.py +++ b/rmp220_middleware/rmp220_middleware.py @@ -115,7 +115,7 @@ class StateMachineNode(Node): self.get_logger().info("State: ENABLED (Button 'start')") self.enable_chassis() if select_button == 1: - self.state = State.DISABLED + self.state = State.PAUSED self.get_logger().info("State: DISABLED (Button 'select')") self.disable_chassis() @@ -133,10 +133,12 @@ class StateMachineNode(Node): def timer_callback(self): # if self.chassis_mode == State.DISABLED or self.chassis_mode == State.STOPPED or self.chassis_mode == State.PASSIVE: # return # Do nothing if chassis is disabled, stopped or passive --> should save processing power + if self.state == State.PAUSED: + return # Do nothing if state is paused --> should save processing power if self.state == State.ENABLED: if self.timeout <= 0: - self.state = State.PAUSED - self.get_logger().info("State: PAUSED (Timeout)") + self.state = State.DISABLED + self.get_logger().info("State: DISABLED (Timeout)") self.disable_chassis() else: self.timeout -= 0.01