Skip to content

Commit

Permalink
Rename missed step entries to task
Browse files Browse the repository at this point in the history
  • Loading branch information
haakonsf committed Oct 14, 2024
1 parent b4078bf commit 33618f8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
8 changes: 3 additions & 5 deletions src/isar/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down Expand 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
)
Expand Down Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/isar/state_machine/states/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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}"
)
Expand Down
10 changes: 5 additions & 5 deletions src/robot_interface/models/exceptions/robot_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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__(
Expand Down Expand Up @@ -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,
)

Expand Down Expand Up @@ -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__(
Expand Down

0 comments on commit 33618f8

Please sign in to comment.