Skip to content

Commit

Permalink
Add possibility of RobotStatus as Stuck into interface
Browse files Browse the repository at this point in the history
  • Loading branch information
MuhammadUsama-afk-equinor committed Oct 6, 2023
1 parent b3f2088 commit 2bb11d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,16 @@
target=uploader.run, name="ISAR Uploader", daemon=True
)
threads.append(uploader_thread)

print(settings.MQTT_ENABLED)
if settings.MQTT_ENABLED:
print("Entered MQTT Enabled block")
mqtt_client: MqttClient = MqttClient(mqtt_queue=queues.mqtt_queue)

mqtt_thread: Thread = Thread(
target=mqtt_client.run, name="ISAR MQTT Client", daemon=True
)
threads.append(mqtt_thread)

print("Seeing up robot status publisher now")
robot_status_publisher: RobotStatusPublisher = RobotStatusPublisher(
mqtt_queue=queues.mqtt_queue, robot=robot, state_machine=state_machine
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ def _get_combined_robot_status(
return RobotStatus.Offline
elif current_state == States.Idle and robot_status == RobotStatus.Available:
return RobotStatus.Available
elif current_state != States.Idle or robot_status == RobotStatus.Busy:
return RobotStatus.Busy
elif current_state != States.Idle or robot_status == RobotStatus.Stuck:
return RobotStatus.Stuck
elif current_state != States.Idle or robot_status == RobotStatus.Busy:
return RobotStatus.Busy
return None

Expand Down

0 comments on commit 2bb11d4

Please sign in to comment.