isar 1.16.18__py3-none-any.whl → 1.18.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/start_mission_definition.py +11 -1
- isar/apis/schedule/scheduling_controller.py +6 -1
- isar/config/settings.py +3 -0
- isar/state_machine/states/monitor.py +36 -1
- {isar-1.16.18.dist-info → isar-1.18.0.dist-info}/METADATA +1 -1
- {isar-1.16.18.dist-info → isar-1.18.0.dist-info}/RECORD +11 -11
- robot_interface/models/exceptions/robot_exceptions.py +13 -0
- robot_interface/models/mission/step.py +11 -0
- {isar-1.16.18.dist-info → isar-1.18.0.dist-info}/LICENSE +0 -0
- {isar-1.16.18.dist-info → isar-1.18.0.dist-info}/WHEEL +0 -0
- {isar-1.16.18.dist-info → isar-1.18.0.dist-info}/top_level.txt +0 -0
|
@@ -10,11 +10,12 @@ from isar.config.settings import settings
|
|
|
10
10
|
from isar.mission_planner.mission_planner_interface import MissionPlannerError
|
|
11
11
|
from robot_interface.models.mission.mission import Mission
|
|
12
12
|
from robot_interface.models.mission.step import (
|
|
13
|
+
STEPS,
|
|
13
14
|
DockingProcedure,
|
|
14
15
|
DriveToPose,
|
|
15
16
|
Localize,
|
|
16
17
|
RecordAudio,
|
|
17
|
-
|
|
18
|
+
ReturnToHome,
|
|
18
19
|
TakeImage,
|
|
19
20
|
TakeThermalImage,
|
|
20
21
|
TakeThermalVideo,
|
|
@@ -35,6 +36,7 @@ class TaskType(str, Enum):
|
|
|
35
36
|
Inspection: str = "inspection"
|
|
36
37
|
DriveTo: str = "drive_to"
|
|
37
38
|
Localization: str = "localization"
|
|
39
|
+
ReturnToHome: str = "return_to_home"
|
|
38
40
|
Dock: str = "dock"
|
|
39
41
|
|
|
40
42
|
|
|
@@ -112,6 +114,8 @@ def generate_steps(task) -> List[STEPS]:
|
|
|
112
114
|
steps.append(generate_steps_for_drive_to_task(task=task))
|
|
113
115
|
case TaskType.Localization:
|
|
114
116
|
steps.append(generate_steps_for_localization_task(task=task))
|
|
117
|
+
case TaskType.ReturnToHome:
|
|
118
|
+
steps.append(generate_steps_for_return_to_home_task(task=task))
|
|
115
119
|
case TaskType.Dock:
|
|
116
120
|
steps.append(generate_steps_for_dock_task())
|
|
117
121
|
except ValueError as e:
|
|
@@ -146,6 +150,12 @@ def generate_steps_for_localization_task(task: StartMissionTaskDefinition) -> Lo
|
|
|
146
150
|
return Localize(localization_pose=task.pose.to_alitra_pose())
|
|
147
151
|
|
|
148
152
|
|
|
153
|
+
def generate_steps_for_return_to_home_task(
|
|
154
|
+
task: StartMissionTaskDefinition,
|
|
155
|
+
) -> ReturnToHome:
|
|
156
|
+
return ReturnToHome(pose=task.pose.to_alitra_pose())
|
|
157
|
+
|
|
158
|
+
|
|
149
159
|
def generate_steps_for_dock_task() -> DockingProcedure:
|
|
150
160
|
return DockingProcedure(behavior="dock")
|
|
151
161
|
|
|
@@ -21,7 +21,12 @@ from isar.mission_planner.mission_planner_interface import MissionPlannerError
|
|
|
21
21
|
from isar.services.utilities.scheduling_utilities import SchedulingUtilities
|
|
22
22
|
from isar.state_machine.states_enum import States
|
|
23
23
|
from robot_interface.models.mission.mission import Mission
|
|
24
|
-
from robot_interface.models.mission.step import
|
|
24
|
+
from robot_interface.models.mission.step import (
|
|
25
|
+
DriveToPose,
|
|
26
|
+
Localize,
|
|
27
|
+
MoveArm,
|
|
28
|
+
ReturnToHome,
|
|
29
|
+
)
|
|
25
30
|
from robot_interface.models.mission.task import Task
|
|
26
31
|
|
|
27
32
|
|
isar/config/settings.py
CHANGED
|
@@ -56,6 +56,9 @@ class Settings(BaseSettings):
|
|
|
56
56
|
# Number of attempts to initiate a step or mission before cancelling
|
|
57
57
|
INITIATE_FAILURE_COUNTER_LIMIT: int = Field(default=10)
|
|
58
58
|
|
|
59
|
+
# Number of attempts to request a step status in monitor before cancelling
|
|
60
|
+
REQUEST_STATUS_FAILURE_COUNTER_LIMIT: int = Field(default=3)
|
|
61
|
+
|
|
59
62
|
# Number of attempts to stop the robot before giving up
|
|
60
63
|
STOP_ROBOT_ATTEMPTS_LIMIT: int = Field(default=10)
|
|
61
64
|
|
|
@@ -7,6 +7,7 @@ from injector import inject
|
|
|
7
7
|
from transitions import State
|
|
8
8
|
|
|
9
9
|
from isar.mission_planner.task_selector_interface import TaskSelectorStop
|
|
10
|
+
from isar.config.settings import settings
|
|
10
11
|
from isar.services.utilities.threaded_request import (
|
|
11
12
|
ThreadedRequest,
|
|
12
13
|
ThreadedRequestNotFinishedError,
|
|
@@ -17,6 +18,7 @@ from robot_interface.models.exceptions.robot_exceptions import (
|
|
|
17
18
|
RobotMissionStatusException,
|
|
18
19
|
RobotRetrieveInspectionException,
|
|
19
20
|
RobotStepStatusException,
|
|
21
|
+
RobotCommunicationTimeoutException,
|
|
20
22
|
)
|
|
21
23
|
from robot_interface.models.inspection.inspection import Inspection
|
|
22
24
|
from robot_interface.models.mission.mission import Mission
|
|
@@ -32,6 +34,10 @@ class Monitor(State):
|
|
|
32
34
|
def __init__(self, state_machine: "StateMachine") -> None:
|
|
33
35
|
super().__init__(name="monitor", on_enter=self.start, on_exit=self.stop)
|
|
34
36
|
self.state_machine: "StateMachine" = state_machine
|
|
37
|
+
self.request_status_failure_counter: int = 0
|
|
38
|
+
self.request_status_failure_counter_limit: int = (
|
|
39
|
+
settings.REQUEST_STATUS_FAILURE_COUNTER_LIMIT
|
|
40
|
+
)
|
|
35
41
|
|
|
36
42
|
self.logger = logging.getLogger("state_machine")
|
|
37
43
|
self.step_status_thread: Optional[ThreadedRequest] = None
|
|
@@ -61,7 +67,6 @@ class Monitor(State):
|
|
|
61
67
|
status_function=self.state_machine.robot.step_status,
|
|
62
68
|
thread_name="State Machine Monitor Get Step Status",
|
|
63
69
|
)
|
|
64
|
-
|
|
65
70
|
try:
|
|
66
71
|
status: Union[StepStatus, MissionStatus] = (
|
|
67
72
|
self.step_status_thread.get_output()
|
|
@@ -70,6 +75,34 @@ class Monitor(State):
|
|
|
70
75
|
time.sleep(self.state_machine.sleep_time)
|
|
71
76
|
continue
|
|
72
77
|
|
|
78
|
+
except RobotCommunicationTimeoutException as e:
|
|
79
|
+
self.state_machine.current_mission.error_message = ErrorMessage(
|
|
80
|
+
error_reason=e.error_reason, error_description=e.error_description
|
|
81
|
+
)
|
|
82
|
+
self.step_status_thread = None
|
|
83
|
+
self.request_status_failure_counter += 1
|
|
84
|
+
self.logger.warning(
|
|
85
|
+
f"Monitoring step {self.state_machine.current_step.id} failed #: "
|
|
86
|
+
f"{self.request_status_failure_counter} failed because: {e.error_description}"
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
if (
|
|
90
|
+
self.request_status_failure_counter
|
|
91
|
+
>= self.request_status_failure_counter_limit
|
|
92
|
+
):
|
|
93
|
+
self.state_machine.current_step.error_message = ErrorMessage(
|
|
94
|
+
error_reason=e.error_reason,
|
|
95
|
+
error_description=e.error_description,
|
|
96
|
+
)
|
|
97
|
+
self.logger.error(
|
|
98
|
+
f"Step will be cancelled after failing to get step status "
|
|
99
|
+
f"{self.request_status_failure_counter} times because: "
|
|
100
|
+
f"{e.error_description}"
|
|
101
|
+
)
|
|
102
|
+
status = StepStatus.Failed
|
|
103
|
+
else:
|
|
104
|
+
continue
|
|
105
|
+
|
|
73
106
|
except RobotStepStatusException as e:
|
|
74
107
|
self.state_machine.current_step.error_message = ErrorMessage(
|
|
75
108
|
error_reason=e.error_reason, error_description=e.error_description
|
|
@@ -98,6 +131,8 @@ class Monitor(State):
|
|
|
98
131
|
f"Retrieving the status failed because: {e.error_description}"
|
|
99
132
|
)
|
|
100
133
|
|
|
134
|
+
self.request_status_failure_counter = 0
|
|
135
|
+
|
|
101
136
|
if isinstance(status, StepStatus):
|
|
102
137
|
self.state_machine.current_step.status = status
|
|
103
138
|
elif isinstance(status, MissionStatus):
|
|
@@ -4,9 +4,9 @@ isar/apis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
4
4
|
isar/apis/api.py,sha256=vSXfkWR7iITWbh4BsDzjEDtQrz6KS-vi2S8AeaeDc3Q,13112
|
|
5
5
|
isar/apis/models/__init__.py,sha256=NI1BYyN__Ogr00Qqe0XJ-9gEVPva2brXo2RJsbrS4tM,52
|
|
6
6
|
isar/apis/models/models.py,sha256=BRm3Wl6TJHdHEKLRQ2SGDx6Y54qq8IesMbBuVO7RuxE,1757
|
|
7
|
-
isar/apis/models/start_mission_definition.py,sha256=
|
|
7
|
+
isar/apis/models/start_mission_definition.py,sha256=c2nX5Idll935fQ8vdF5hm9Ytblvw2uINBpZVl_VfFmw,6458
|
|
8
8
|
isar/apis/schedule/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
-
isar/apis/schedule/scheduling_controller.py,sha256=
|
|
9
|
+
isar/apis/schedule/scheduling_controller.py,sha256=w2F-6IKBgVN9HVopAOWBb3KUgPjhsnuPLQ3eqjDNfOg,11888
|
|
10
10
|
isar/apis/security/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
11
|
isar/apis/security/authentication.py,sha256=TI8U9Y_L6ihHLMeM50ZONd5EPfuHdw_XMU_Q987W4AY,1975
|
|
12
12
|
isar/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -14,7 +14,7 @@ isar/config/configuration_error.py,sha256=rO6WOhafX6xvVib8WxV-eY483Z0PpN-9PxGsq5
|
|
|
14
14
|
isar/config/log.py,sha256=39G_Cue0qvw0Uv-1NYXvQ83yivPIKcAv-bGNNREFw5o,2251
|
|
15
15
|
isar/config/logging.conf,sha256=mYO1xf27gAopEMHhGzY7-mwyfN16rwRLkPNMvy3zn2g,1127
|
|
16
16
|
isar/config/settings.env,sha256=-kivj0osAAKlInnY81ugySTlcImhVABbnj9kUoBDLu8,535
|
|
17
|
-
isar/config/settings.py,sha256=
|
|
17
|
+
isar/config/settings.py,sha256=eiVXkjcKpUDOTchzWYooaZZ3xdEXjD8Uv4V7ynHuXwY,13201
|
|
18
18
|
isar/config/certs/ca-cert.pem,sha256=gSBTyY0tKSFnssyvrvbFvHpQwii0kEkBryklVmevdtc,2029
|
|
19
19
|
isar/config/keyvault/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
20
|
isar/config/keyvault/keyvault_error.py,sha256=zvPCsZLjboxsxthYkxpRERCTFxYV8R5WmACewAUQLwk,41
|
|
@@ -73,7 +73,7 @@ isar/state_machine/states/__init__.py,sha256=gUikQDu-O-lmunwzwcN9gN6VaEmlCFlqqgd
|
|
|
73
73
|
isar/state_machine/states/idle.py,sha256=tfciqI7NPDVF8WMe5qbSO3c-xDzUTQYLmJinb9e0JS8,1231
|
|
74
74
|
isar/state_machine/states/initialize.py,sha256=Vx7OxWZI_xEkRwHWFh9ymxK_7mDH0Wayt09dGGqBJWk,2359
|
|
75
75
|
isar/state_machine/states/initiate.py,sha256=b0Fq3tN6TZMg5j4192OsYdGbphTXWCkftBsFX57mhrw,5652
|
|
76
|
-
isar/state_machine/states/monitor.py,sha256=
|
|
76
|
+
isar/state_machine/states/monitor.py,sha256=iuGiIEWSp6_rC6CLz5DNfb71Dttlo0KFxfg7xYwiZYE,10665
|
|
77
77
|
isar/state_machine/states/off.py,sha256=jjqN_oJMpBtWuY7hP-c9f0w3p2CYCfe-NpmYHHPnmyI,544
|
|
78
78
|
isar/state_machine/states/paused.py,sha256=xVZM9WMt90FTiP5forSlA3eJ5Vt9LzZYCFDQDPIocKA,1004
|
|
79
79
|
isar/state_machine/states/stop.py,sha256=Sxdo4FGhxc2Pj91jidYtVIjpSNklbEf1sJYJ6x51HgE,3348
|
|
@@ -89,7 +89,7 @@ robot_interface/robot_interface.py,sha256=i2qw1V9mLO-ljtS7LiRliQ7XNmmBJIwD4NG8mD
|
|
|
89
89
|
robot_interface/test_robot_interface.py,sha256=FV1urn7SbsMyWBIcTKjsBwAG4IsXeZ6pLHE0mA9EGGs,692
|
|
90
90
|
robot_interface/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
91
91
|
robot_interface/models/exceptions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
92
|
-
robot_interface/models/exceptions/robot_exceptions.py,sha256=
|
|
92
|
+
robot_interface/models/exceptions/robot_exceptions.py,sha256=l1h62gq7lfLzWoHh2ytdEWgn_4lS4M-GPxHkjgAXcP4,9036
|
|
93
93
|
robot_interface/models/initialize/__init__.py,sha256=rz5neEDr59GDbzzI_FF0DId-C-I-50l113P-h-C_QBY,48
|
|
94
94
|
robot_interface/models/initialize/initialize_params.py,sha256=2eG5Aq5bDKU6tVkaUMAoc46GERBgyaKkqv6yLupdRLc,164
|
|
95
95
|
robot_interface/models/inspection/__init__.py,sha256=14wfuj4XZazrigKD7fL98khFKz-eckIpEgPcYRj40Kg,227
|
|
@@ -97,7 +97,7 @@ robot_interface/models/inspection/inspection.py,sha256=TVqUl5o3d3fp8IravOMwJIuRo
|
|
|
97
97
|
robot_interface/models/mission/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
98
98
|
robot_interface/models/mission/mission.py,sha256=obuV2htwoYlcssZF5IIBUYCrd2pIerIONlJsggBYRVs,776
|
|
99
99
|
robot_interface/models/mission/status.py,sha256=R5jLmmn6M7oNX907QvbrhoAqAo4C1zB653Ed1PcxAtg,922
|
|
100
|
-
robot_interface/models/mission/step.py,sha256=
|
|
100
|
+
robot_interface/models/mission/step.py,sha256=DEzU-LD-i3RTAaXBy5KwJZ6OnN5S0F3wwDaqX2DZ72M,5587
|
|
101
101
|
robot_interface/models/mission/task.py,sha256=bjp-m_Ak6tzgUIQvbGe90Mnwt6QhofTgFxnVPkqHOY4,4352
|
|
102
102
|
robot_interface/models/robots/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
103
103
|
robot_interface/models/robots/robot_model.py,sha256=pZQsqhn9hh6XE3EjMZhWMzYqg5oJ4CJ4CXeOASKvEf8,452
|
|
@@ -107,8 +107,8 @@ robot_interface/telemetry/payloads.py,sha256=eMK7mjZPsLY6yvu7AK-OcdvkeUpChzDrySD
|
|
|
107
107
|
robot_interface/utilities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
108
108
|
robot_interface/utilities/json_service.py,sha256=nU2Q_3P9Fq9hs6F_wtUjWtHfl_g1Siy-yDhXXSKwHwg,1018
|
|
109
109
|
robot_interface/utilities/uuid_string_factory.py,sha256=_NQIbBQ56w0qqO0MUDP6aPpHbxW7ATRhK8HnQiBSLkc,76
|
|
110
|
-
isar-1.
|
|
111
|
-
isar-1.
|
|
112
|
-
isar-1.
|
|
113
|
-
isar-1.
|
|
114
|
-
isar-1.
|
|
110
|
+
isar-1.18.0.dist-info/LICENSE,sha256=3fc2-ebLwHWwzfQbulGNRdcNob3SBQeCfEVUDYxsuqw,14058
|
|
111
|
+
isar-1.18.0.dist-info/METADATA,sha256=wjDHWKgNqxMggWZ3Rboq-AFVnuuRLeY7j0lzV3py7Z0,14751
|
|
112
|
+
isar-1.18.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
113
|
+
isar-1.18.0.dist-info/top_level.txt,sha256=UwIML2RtuQKCyJJkatcSnyp6-ldDjboB9k9JgKipO-U,21
|
|
114
|
+
isar-1.18.0.dist-info/RECORD,,
|
|
@@ -5,6 +5,7 @@ from typing import Optional
|
|
|
5
5
|
|
|
6
6
|
class ErrorReason(str, Enum):
|
|
7
7
|
RobotCommunicationException: str = "robot_communication_exception"
|
|
8
|
+
RobotCommunicationTimeoutException: str = "robot_communication_timeout_exception"
|
|
8
9
|
RobotInfeasibleStepException: str = "robot_infeasible_step_exception"
|
|
9
10
|
RobotInfeasibleMissionException: str = "robot_infeasible_mission_exception"
|
|
10
11
|
RobotMissionStatusException: str = "robot_mission_status_exception"
|
|
@@ -49,6 +50,18 @@ class RobotCommunicationException(RobotException):
|
|
|
49
50
|
pass
|
|
50
51
|
|
|
51
52
|
|
|
53
|
+
# An exception which should be thrown by the robot package if the communication has timed
|
|
54
|
+
# out and ISAR should retry the request.
|
|
55
|
+
class RobotCommunicationTimeoutException(RobotException):
|
|
56
|
+
def __init__(self, error_description: str) -> None:
|
|
57
|
+
super().__init__(
|
|
58
|
+
error_reason=ErrorReason.RobotCommunicationTimeoutException,
|
|
59
|
+
error_description=error_description,
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
pass
|
|
63
|
+
|
|
64
|
+
|
|
52
65
|
# An exception which should be thrown by the robot package if it is unable to start the
|
|
53
66
|
# current step.
|
|
54
67
|
class RobotInfeasibleStepException(RobotException):
|
|
@@ -111,6 +111,16 @@ class DockingProcedure(MotionStep):
|
|
|
111
111
|
type: Literal["docking_procedure"] = "docking_procedure"
|
|
112
112
|
|
|
113
113
|
|
|
114
|
+
@dataclass
|
|
115
|
+
class ReturnToHome(MotionStep):
|
|
116
|
+
"""
|
|
117
|
+
Step which cases the robot to return home
|
|
118
|
+
"""
|
|
119
|
+
|
|
120
|
+
pose: Pose
|
|
121
|
+
type: Literal["return_to_home"] = "return_to_home"
|
|
122
|
+
|
|
123
|
+
|
|
114
124
|
@dataclass
|
|
115
125
|
class Localize(MotionStep):
|
|
116
126
|
"""
|
|
@@ -213,6 +223,7 @@ class RecordAudio(InspectionStep):
|
|
|
213
223
|
STEPS = Union[
|
|
214
224
|
DriveToPose,
|
|
215
225
|
DockingProcedure,
|
|
226
|
+
ReturnToHome,
|
|
216
227
|
Localize,
|
|
217
228
|
TakeImage,
|
|
218
229
|
TakeThermalImage,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|