isar 1.33.9__py3-none-any.whl → 1.34.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of isar might be problematic. Click here for more details.
- isar/apis/models/models.py +2 -5
- isar/config/settings.py +0 -7
- isar/models/events.py +9 -10
- isar/modules.py +5 -11
- isar/robot/robot.py +109 -24
- isar/robot/robot_monitor_mission.py +399 -0
- isar/robot/robot_status.py +0 -10
- isar/robot/robot_stop_mission.py +7 -7
- isar/robot/robot_upload_inspection.py +80 -0
- isar/services/utilities/scheduling_utilities.py +30 -10
- isar/state_machine/state_machine.py +7 -223
- isar/state_machine/states/going_to_lockdown.py +23 -34
- isar/state_machine/states/home.py +4 -9
- isar/state_machine/states/monitor.py +20 -38
- isar/state_machine/states/paused.py +2 -2
- isar/state_machine/states/pausing.py +6 -22
- isar/state_machine/states/pausing_return_home.py +6 -22
- isar/state_machine/states/returning_home.py +40 -37
- isar/state_machine/states/stopping.py +2 -22
- isar/state_machine/states/stopping_go_to_lockdown.py +1 -21
- isar/state_machine/states/stopping_return_home.py +0 -2
- isar/state_machine/transitions/functions/fail_mission.py +1 -9
- isar/state_machine/transitions/functions/finish_mission.py +2 -32
- isar/state_machine/transitions/functions/pause.py +8 -7
- isar/state_machine/transitions/functions/resume.py +3 -12
- isar/state_machine/transitions/functions/return_home.py +1 -16
- isar/state_machine/transitions/functions/robot_status.py +2 -12
- isar/state_machine/transitions/functions/start_mission.py +2 -44
- isar/state_machine/transitions/functions/stop.py +4 -33
- isar/state_machine/transitions/mission.py +2 -17
- isar/state_machine/transitions/return_home.py +3 -24
- isar/state_machine/utils/common_event_handlers.py +4 -96
- {isar-1.33.9.dist-info → isar-1.34.0.dist-info}/METADATA +1 -63
- {isar-1.33.9.dist-info → isar-1.34.0.dist-info}/RECORD +40 -41
- robot_interface/models/mission/task.py +0 -10
- robot_interface/robot_interface.py +25 -1
- isar/mission_planner/sequential_task_selector.py +0 -23
- isar/mission_planner/task_selector_interface.py +0 -31
- isar/robot/robot_task_status.py +0 -87
- {isar-1.33.9.dist-info → isar-1.34.0.dist-info}/WHEEL +0 -0
- {isar-1.33.9.dist-info → isar-1.34.0.dist-info}/entry_points.txt +0 -0
- {isar-1.33.9.dist-info → isar-1.34.0.dist-info}/licenses/LICENSE +0 -0
- {isar-1.33.9.dist-info → isar-1.34.0.dist-info}/top_level.txt +0 -0
isar/robot/robot_task_status.py
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import logging
|
|
2
|
-
import time
|
|
3
|
-
from threading import Event, Thread
|
|
4
|
-
from typing import Optional
|
|
5
|
-
|
|
6
|
-
from isar.config.settings import settings
|
|
7
|
-
from isar.models.events import RobotServiceEvents
|
|
8
|
-
from isar.services.utilities.threaded_request import ThreadedRequest
|
|
9
|
-
from robot_interface.models.exceptions.robot_exceptions import (
|
|
10
|
-
ErrorMessage,
|
|
11
|
-
RobotCommunicationException,
|
|
12
|
-
RobotCommunicationTimeoutException,
|
|
13
|
-
RobotException,
|
|
14
|
-
RobotTaskStatusException,
|
|
15
|
-
)
|
|
16
|
-
from robot_interface.models.mission.status import TaskStatus
|
|
17
|
-
from robot_interface.robot_interface import RobotInterface
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
class RobotTaskStatusThread(Thread):
|
|
21
|
-
def __init__(
|
|
22
|
-
self,
|
|
23
|
-
robot_service_events: RobotServiceEvents,
|
|
24
|
-
robot: RobotInterface,
|
|
25
|
-
signal_thread_quitting: Event,
|
|
26
|
-
task_id: str,
|
|
27
|
-
):
|
|
28
|
-
self.logger = logging.getLogger("robot")
|
|
29
|
-
self.robot_service_events: RobotServiceEvents = robot_service_events
|
|
30
|
-
self.robot: RobotInterface = robot
|
|
31
|
-
self.start_mission_thread: Optional[ThreadedRequest] = None
|
|
32
|
-
self.signal_thread_quitting: Event = signal_thread_quitting
|
|
33
|
-
self.task_id: str = task_id
|
|
34
|
-
Thread.__init__(self, name="Robot task status thread")
|
|
35
|
-
|
|
36
|
-
def run(self) -> None:
|
|
37
|
-
task_status: TaskStatus = TaskStatus.NotStarted
|
|
38
|
-
failed_task_error: Optional[ErrorMessage] = None
|
|
39
|
-
request_status_failure_counter: int = 0
|
|
40
|
-
|
|
41
|
-
while (
|
|
42
|
-
request_status_failure_counter
|
|
43
|
-
< settings.REQUEST_STATUS_FAILURE_COUNTER_LIMIT
|
|
44
|
-
):
|
|
45
|
-
if self.signal_thread_quitting.wait(0):
|
|
46
|
-
return
|
|
47
|
-
if request_status_failure_counter > 0:
|
|
48
|
-
time.sleep(settings.REQUEST_STATUS_COMMUNICATION_RECONNECT_DELAY)
|
|
49
|
-
|
|
50
|
-
try:
|
|
51
|
-
task_status = self.robot.task_status(self.task_id)
|
|
52
|
-
request_status_failure_counter = 0
|
|
53
|
-
except (
|
|
54
|
-
RobotCommunicationTimeoutException,
|
|
55
|
-
RobotCommunicationException,
|
|
56
|
-
) as e:
|
|
57
|
-
request_status_failure_counter += 1
|
|
58
|
-
self.logger.error(
|
|
59
|
-
f"Failed to get task status "
|
|
60
|
-
f"{request_status_failure_counter} times because: "
|
|
61
|
-
f"{e.error_description}"
|
|
62
|
-
)
|
|
63
|
-
|
|
64
|
-
failed_task_error = ErrorMessage(
|
|
65
|
-
error_reason=e.error_reason,
|
|
66
|
-
error_description=e.error_description,
|
|
67
|
-
)
|
|
68
|
-
continue
|
|
69
|
-
|
|
70
|
-
except RobotTaskStatusException as e:
|
|
71
|
-
failed_task_error = ErrorMessage(
|
|
72
|
-
error_reason=e.error_reason,
|
|
73
|
-
error_description=e.error_description,
|
|
74
|
-
)
|
|
75
|
-
break
|
|
76
|
-
|
|
77
|
-
except RobotException as e:
|
|
78
|
-
failed_task_error = ErrorMessage(
|
|
79
|
-
error_reason=e.error_reason,
|
|
80
|
-
error_description=e.error_description,
|
|
81
|
-
)
|
|
82
|
-
break
|
|
83
|
-
|
|
84
|
-
self.robot_service_events.task_status_updated.trigger_event(task_status)
|
|
85
|
-
return
|
|
86
|
-
|
|
87
|
-
self.robot_service_events.task_status_failed.trigger_event(failed_task_error)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|