From 33618f8fcd7cdcad0476ed37d216480c42ecb6c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20Fadum?= Date: Mon, 14 Oct 2024 13:26:23 +0200 Subject: [PATCH] Rename missed step entries to task --- src/isar/config/settings.py | 8 +++----- src/isar/state_machine/states/monitor.py | 4 ++-- .../models/exceptions/robot_exceptions.py | 10 +++++----- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/isar/config/settings.py b/src/isar/config/settings.py index bcc94c4f..fd6a4f6a 100644 --- a/src/isar/config/settings.py +++ b/src/isar/config/settings.py @@ -8,7 +8,7 @@ from isar.config import predefined_missions from robot_interface.models.robots.robot_model import RobotModel -from robot_interface.telemetry.payloads import VideoStream, DocumentInfo +from robot_interface.telemetry.payloads import DocumentInfo, VideoStream class Settings(BaseSettings): @@ -54,10 +54,10 @@ def __init__(self) -> None: # Determines the number of state transitions that are kept in the log STATE_TRANSITIONS_LOG_LENGTH: int = Field(default=20) - # Number of attempts to initiate a step or mission before cancelling + # Number of attempts to initiate a task or mission before cancelling INITIATE_FAILURE_COUNTER_LIMIT: int = Field(default=10) - # Number of attempts to request a step status in monitor before cancelling + # Number of attempts to request a task status in monitor before cancelling REQUEST_STATUS_FAILURE_COUNTER_LIMIT: int = Field(default=3) # Number of attempts to stop the robot before giving up @@ -236,7 +236,6 @@ def __init__(self) -> None: TOPIC_ISAR_STATUS: str = Field(default="status", validate_default=True) TOPIC_ISAR_MISSION: str = Field(default="mission", validate_default=True) TOPIC_ISAR_TASK: str = Field(default="task", validate_default=True) - TOPIC_ISAR_STEP: str = Field(default="step", validate_default=True) TOPIC_ISAR_INSPECTION_RESULT: str = Field( default="inspection_result", validate_default=True ) @@ -290,7 +289,6 @@ def set_log_levels(cls, v: Any, info: ValidationInfo) -> dict: "TOPIC_ISAR_STATUS", "TOPIC_ISAR_MISSION", "TOPIC_ISAR_TASK", - "TOPIC_ISAR_STEP", "TOPIC_ISAR_ROBOT_INFO", "TOPIC_ISAR_ROBOT_HEARTBEAT", "TOPIC_ISAR_INSPECTION_RESULT", diff --git a/src/isar/state_machine/states/monitor.py b/src/isar/state_machine/states/monitor.py index 48e96800..b3eb4935 100644 --- a/src/isar/state_machine/states/monitor.py +++ b/src/isar/state_machine/states/monitor.py @@ -67,7 +67,7 @@ def _run(self) -> None: self._run_get_status_thread( status_function=self.state_machine.robot.task_status, function_argument=self.state_machine.current_task.id, - thread_name="State Machine Monitor Get Step Status", + thread_name="State Machine Monitor Get Task Status", ) try: status: TaskStatus = self.task_status_thread.get_output() @@ -229,7 +229,7 @@ def _handle_communication_timeout( error_description=e.error_description, ) self.logger.error( - f"Step will be cancelled after failing to get task status " + f"Task will be cancelled after failing to get task status " f"{self.request_status_failure_counter} times because: " f"{e.error_description}" ) diff --git a/src/robot_interface/models/exceptions/robot_exceptions.py b/src/robot_interface/models/exceptions/robot_exceptions.py index 78f0279e..9e66090c 100644 --- a/src/robot_interface/models/exceptions/robot_exceptions.py +++ b/src/robot_interface/models/exceptions/robot_exceptions.py @@ -9,7 +9,7 @@ class ErrorReason(str, Enum): RobotInfeasibleTaskException: str = "robot_infeasible_step_exception" RobotInfeasibleMissionException: str = "robot_infeasible_mission_exception" RobotMissionStatusException: str = "robot_mission_status_exception" - RobotStepStatusException: str = "robot_step_status_exception" + RobotTaskStatusException: str = "robot_task_status_exception" RobotAPIException: str = "robot_api_exception" RobotActionException: str = "robot_action_exception" RobotInitializeException: str = "robot_initialize_exception" @@ -66,7 +66,7 @@ def __init__(self, error_description: str) -> None: # An exception which should be thrown by the robot package if it is unable to start the -# current step. +# current task. class RobotInfeasibleTaskException(RobotException): def __init__(self, error_description: str) -> None: super().__init__( @@ -102,11 +102,11 @@ def __init__(self, error_description: str) -> None: # An exception which should be thrown by the robot package if it is unable to collect -# the status of the current step. +# the status of the current task. class RobotTaskStatusException(RobotException): def __init__(self, error_description: str) -> None: super().__init__( - error_reason=ErrorReason.RobotStepStatusException, + error_reason=ErrorReason.RobotTaskStatusException, error_description=error_description, ) @@ -165,7 +165,7 @@ def __init__(self, error_description: str) -> None: # An exception which should be thrown by the robot package if it is unable to collect -# the inspections that were generated for the currently executing step or mission. +# the inspections that were generated for the currently executing task or mission. class RobotRetrieveInspectionException(RobotException): def __init__(self, error_description: str) -> None: super().__init__(