changes in operation: testing

This commit is contained in:
Björn Ellensohn 2023-08-22 10:23:48 +02:00
parent 1f2f0d7bf9
commit f588a72960

View File

@ -115,7 +115,7 @@ class StateMachineNode(Node):
self.get_logger().info("State: ENABLED (Button 'start')") self.get_logger().info("State: ENABLED (Button 'start')")
self.enable_chassis() self.enable_chassis()
if select_button == 1: if select_button == 1:
self.state = State.DISABLED self.state = State.PAUSED
self.get_logger().info("State: DISABLED (Button 'select')") self.get_logger().info("State: DISABLED (Button 'select')")
self.disable_chassis() self.disable_chassis()
@ -133,10 +133,12 @@ class StateMachineNode(Node):
def timer_callback(self): def timer_callback(self):
# if self.chassis_mode == State.DISABLED or self.chassis_mode == State.STOPPED or self.chassis_mode == State.PASSIVE: # 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 # 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.state == State.ENABLED:
if self.timeout <= 0: if self.timeout <= 0:
self.state = State.PAUSED self.state = State.DISABLED
self.get_logger().info("State: PAUSED (Timeout)") self.get_logger().info("State: DISABLED (Timeout)")
self.disable_chassis() self.disable_chassis()
else: else:
self.timeout -= 0.01 self.timeout -= 0.01