Skip to content

Commit

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

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,10 +37,10 @@ def _get_combined_robot_status(
return RobotStatus.Offline
elif current_state == States.Idle and robot_status == RobotStatus.Available:
return RobotStatus.Available
elif robot_status == RobotStatus.Blocked:
return RobotStatus.Blocked
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.Busy
return None

def run(self) -> None:
Expand Down
2 changes: 1 addition & 1 deletion src/robot_interface/models/mission/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ class RobotStatus(Enum):
Available: str = "available"
Busy: str = "busy"
Offline: str = "offline"
Stuck: str = "stuck"
Blocked: str = "blocked"

0 comments on commit f94deab

Please sign in to comment.