mirror of
https://github.com/bjoernellens1/rmp220_middleware.git
synced 2024-11-22 07:43:48 +00:00
changes in operation: testing
This commit is contained in:
parent
f588a72960
commit
1104c8024c
@ -65,22 +65,25 @@ class StateMachineNode(Node):
|
|||||||
self.get_logger().info('Got chassis_mode from chassis_mode_fb topic')
|
self.get_logger().info('Got chassis_mode from chassis_mode_fb topic')
|
||||||
self.get_logger().info(str(msg.chassis_mode))
|
self.get_logger().info(str(msg.chassis_mode))
|
||||||
|
|
||||||
if msg.chassis_mode == 0:
|
if self.state == State.PAUSED:
|
||||||
self.chassis_mode = State.DISABLED
|
return
|
||||||
self.state = State.DISABLED
|
else:
|
||||||
self.get_logger().info('Set chassis_mode to ' + str(self.state.value))
|
if msg.chassis_mode == 0:
|
||||||
if msg.chassis_mode == 1: # Assuming 1 represents enabled and 0 represents disabled
|
self.chassis_mode = State.DISABLED
|
||||||
self.chassis_mode = State.ENABLED
|
self.state = State.DISABLED
|
||||||
self.state = State.ENABLED
|
self.get_logger().info('Set chassis_mode to ' + str(self.state.value))
|
||||||
self.get_logger().info('Set chassis_mode to ' + str(self.state.value))
|
if msg.chassis_mode == 1: # Assuming 1 represents enabled and 0 represents disabled
|
||||||
if msg.chassis_mode == 2:
|
self.chassis_mode = State.ENABLED
|
||||||
self.chassis_mode = State.PASSIVE
|
self.state = State.ENABLED
|
||||||
self.state = State.PASSIVE
|
self.get_logger().info('Set chassis_mode to ' + str(self.state.value))
|
||||||
self.get_logger().info('Set chassis_mode to ' + str(self.state.value))
|
if msg.chassis_mode == 2:
|
||||||
if msg.chassis_mode == 3:
|
self.chassis_mode = State.PASSIVE
|
||||||
self.chassis_mode = State.STOPPED
|
self.state = State.PASSIVE
|
||||||
self.state = State.STOPPED
|
self.get_logger().info('Set chassis_mode to ' + str(self.state.value))
|
||||||
self.get_logger().info('Set chassis_mode to ' + str(self.state.value))
|
if msg.chassis_mode == 3:
|
||||||
|
self.chassis_mode = State.STOPPED
|
||||||
|
self.state = State.STOPPED
|
||||||
|
self.get_logger().info('Set chassis_mode to ' + str(self.state.value))
|
||||||
|
|
||||||
def get_chassis_mode(self):
|
def get_chassis_mode(self):
|
||||||
return self.chassis_mode
|
return self.chassis_mode
|
||||||
|
Loading…
Reference in New Issue
Block a user