isar 1.33.3__py3-none-any.whl → 1.33.5__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/robot_control/robot_controller.py +5 -0
- isar/apis/schedule/scheduling_controller.py +11 -0
- isar/config/settings.py +1 -1
- isar/services/service_connections/mqtt/mqtt_client.py +9 -9
- isar/storage/uploader.py +15 -0
- {isar-1.33.3.dist-info → isar-1.33.5.dist-info}/METADATA +1 -1
- {isar-1.33.3.dist-info → isar-1.33.5.dist-info}/RECORD +12 -12
- robot_interface/models/exceptions/robot_exceptions.py +11 -0
- {isar-1.33.3.dist-info → isar-1.33.5.dist-info}/WHEEL +0 -0
- {isar-1.33.3.dist-info → isar-1.33.5.dist-info}/entry_points.txt +0 -0
- {isar-1.33.3.dist-info → isar-1.33.5.dist-info}/licenses/LICENSE +0 -0
- {isar-1.33.3.dist-info → isar-1.33.5.dist-info}/top_level.txt +0 -0
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
|
|
3
3
|
from fastapi import HTTPException
|
|
4
|
+
from opentelemetry import trace
|
|
4
5
|
|
|
5
6
|
from isar.apis.models.models import RobotInfoResponse
|
|
6
7
|
from isar.config.settings import robot_settings, settings
|
|
7
8
|
from isar.services.utilities.robot_utilities import RobotUtilities
|
|
8
9
|
from robot_interface.models.robots.media import MediaConfig
|
|
9
10
|
|
|
11
|
+
tracer = trace.get_tracer(__name__)
|
|
12
|
+
|
|
10
13
|
|
|
11
14
|
class RobotController:
|
|
12
15
|
def __init__(
|
|
@@ -16,6 +19,7 @@ class RobotController:
|
|
|
16
19
|
self.robot_utilities: RobotUtilities = robot_utilities
|
|
17
20
|
self.logger = logging.getLogger("api")
|
|
18
21
|
|
|
22
|
+
@tracer.start_as_current_span("generate_media_config")
|
|
19
23
|
def generate_media_config(self) -> MediaConfig:
|
|
20
24
|
media_config: MediaConfig = self.robot_utilities.generate_media_config()
|
|
21
25
|
if media_config is None:
|
|
@@ -25,6 +29,7 @@ class RobotController:
|
|
|
25
29
|
)
|
|
26
30
|
return media_config
|
|
27
31
|
|
|
32
|
+
@tracer.start_as_current_span("get_info")
|
|
28
33
|
def get_info(self) -> RobotInfoResponse:
|
|
29
34
|
return RobotInfoResponse(
|
|
30
35
|
robot_package=settings.ROBOT_PACKAGE,
|
|
@@ -2,6 +2,7 @@ import logging
|
|
|
2
2
|
from http import HTTPStatus
|
|
3
3
|
|
|
4
4
|
from fastapi import Body, HTTPException, Path
|
|
5
|
+
from opentelemetry import trace
|
|
5
6
|
|
|
6
7
|
from isar.apis.models.models import (
|
|
7
8
|
ControlMissionResponse,
|
|
@@ -20,6 +21,8 @@ from isar.state_machine.states_enum import States
|
|
|
20
21
|
from robot_interface.models.mission.mission import Mission
|
|
21
22
|
from robot_interface.models.mission.task import TASKS, InspectionTask, MoveArm
|
|
22
23
|
|
|
24
|
+
tracer = trace.get_tracer(__name__)
|
|
25
|
+
|
|
23
26
|
|
|
24
27
|
class SchedulingController:
|
|
25
28
|
def __init__(
|
|
@@ -29,6 +32,7 @@ class SchedulingController:
|
|
|
29
32
|
self.scheduling_utilities: SchedulingUtilities = scheduling_utilities
|
|
30
33
|
self.logger = logging.getLogger("api")
|
|
31
34
|
|
|
35
|
+
@tracer.start_as_current_span("start_mission_by_id")
|
|
32
36
|
def start_mission_by_id(
|
|
33
37
|
self,
|
|
34
38
|
mission_id: str = Path(
|
|
@@ -54,6 +58,7 @@ class SchedulingController:
|
|
|
54
58
|
|
|
55
59
|
return self._api_response(mission)
|
|
56
60
|
|
|
61
|
+
@tracer.start_as_current_span("start_mission")
|
|
57
62
|
def start_mission(
|
|
58
63
|
self,
|
|
59
64
|
mission_definition: StartMissionDefinition = Body(
|
|
@@ -98,6 +103,7 @@ class SchedulingController:
|
|
|
98
103
|
self.scheduling_utilities.start_mission(mission=mission)
|
|
99
104
|
return self._api_response(mission)
|
|
100
105
|
|
|
106
|
+
@tracer.start_as_current_span("return_home")
|
|
101
107
|
def return_home(self) -> None:
|
|
102
108
|
self.logger.info("Received request to return home")
|
|
103
109
|
|
|
@@ -108,6 +114,7 @@ class SchedulingController:
|
|
|
108
114
|
|
|
109
115
|
self.scheduling_utilities.return_home()
|
|
110
116
|
|
|
117
|
+
@tracer.start_as_current_span("pause_mission")
|
|
111
118
|
def pause_mission(self) -> ControlMissionResponse:
|
|
112
119
|
self.logger.info("Received request to pause current mission")
|
|
113
120
|
|
|
@@ -131,6 +138,7 @@ class SchedulingController:
|
|
|
131
138
|
)
|
|
132
139
|
return pause_mission_response
|
|
133
140
|
|
|
141
|
+
@tracer.start_as_current_span("resume_mission")
|
|
134
142
|
def resume_mission(self) -> ControlMissionResponse:
|
|
135
143
|
self.logger.info("Received request to resume current mission")
|
|
136
144
|
|
|
@@ -148,6 +156,7 @@ class SchedulingController:
|
|
|
148
156
|
)
|
|
149
157
|
return resume_mission_response
|
|
150
158
|
|
|
159
|
+
@tracer.start_as_current_span("stop_mission")
|
|
151
160
|
def stop_mission(
|
|
152
161
|
self,
|
|
153
162
|
mission_id: StopMissionDefinition = Body(
|
|
@@ -181,6 +190,7 @@ class SchedulingController:
|
|
|
181
190
|
)
|
|
182
191
|
return stop_mission_response
|
|
183
192
|
|
|
193
|
+
@tracer.start_as_current_span("start_move_arm_mission")
|
|
184
194
|
def start_move_arm_mission(
|
|
185
195
|
self,
|
|
186
196
|
arm_pose_literal: str = Path(
|
|
@@ -227,6 +237,7 @@ class SchedulingController:
|
|
|
227
237
|
self.scheduling_utilities.start_mission(mission=mission)
|
|
228
238
|
return self._api_response(mission)
|
|
229
239
|
|
|
240
|
+
@tracer.start_as_current_span("release_intervention_needed")
|
|
230
241
|
def release_intervention_needed(self) -> None:
|
|
231
242
|
self.logger.info("Received request to release intervention needed state")
|
|
232
243
|
|
isar/config/settings.py
CHANGED
|
@@ -30,7 +30,7 @@ class Settings(BaseSettings):
|
|
|
30
30
|
REQUEST_TIMEOUT: int = Field(default=30)
|
|
31
31
|
|
|
32
32
|
# Timeout in seconds for checking whether there is a message on a queue
|
|
33
|
-
QUEUE_TIMEOUT: int = Field(default=
|
|
33
|
+
QUEUE_TIMEOUT: int = Field(default=10)
|
|
34
34
|
|
|
35
35
|
# Sleep time for while loops in the finite state machine in seconds
|
|
36
36
|
# The sleep is used to throttle the system on every iteration in the loop
|
|
@@ -106,15 +106,15 @@ class MqttClient(MqttClientInterface):
|
|
|
106
106
|
)
|
|
107
107
|
|
|
108
108
|
def on_connect(self, client, userdata, flags, reason_code, properties):
|
|
109
|
-
self.logger.info(
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
if
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
)
|
|
109
|
+
self.logger.info(f"Connected: {reason_code}")
|
|
110
|
+
|
|
111
|
+
def on_disconnect(self, client, userdata, *args):
|
|
112
|
+
if not args:
|
|
113
|
+
return
|
|
114
|
+
reason_code = args[0] if len(args) < 3 else args[1]
|
|
115
|
+
rc = getattr(reason_code, "value", reason_code)
|
|
116
|
+
if rc != 0:
|
|
117
|
+
self.logger.warning(f"Unexpected disconnect: {reason_code}.")
|
|
118
118
|
|
|
119
119
|
@backoff.on_exception(
|
|
120
120
|
backoff.expo,
|
isar/storage/uploader.py
CHANGED
|
@@ -29,6 +29,14 @@ from robot_interface.telemetry.payloads import (
|
|
|
29
29
|
from robot_interface.utilities.json_service import EnhancedJSONEncoder
|
|
30
30
|
|
|
31
31
|
|
|
32
|
+
def has_empty_blob_storage_path(storage_paths: StoragePaths):
|
|
33
|
+
for path in (storage_paths.data_path, storage_paths.metadata_path):
|
|
34
|
+
for value in (path.storage_account, path.blob_container, path.blob_name):
|
|
35
|
+
if not (value and value.strip()):
|
|
36
|
+
return True
|
|
37
|
+
return False
|
|
38
|
+
|
|
39
|
+
|
|
32
40
|
@dataclass
|
|
33
41
|
class UploaderQueueItem:
|
|
34
42
|
inspection: Inspection
|
|
@@ -192,6 +200,13 @@ class Uploader:
|
|
|
192
200
|
inspection_paths = self._upload(item)
|
|
193
201
|
if isinstance(inspection_paths.data_path, LocalStoragePath):
|
|
194
202
|
self.logger.info("Skipping publishing when using local storage")
|
|
203
|
+
elif isinstance(
|
|
204
|
+
inspection_paths.data_path, BlobStoragePath
|
|
205
|
+
) and has_empty_blob_storage_path(inspection_paths):
|
|
206
|
+
self.logger.warning(
|
|
207
|
+
"Skipping publishing: Blob storage paths are empty for inspection %s",
|
|
208
|
+
str(item.inspection.id)[:8],
|
|
209
|
+
)
|
|
195
210
|
else:
|
|
196
211
|
self._publish_inspection_result(
|
|
197
212
|
inspection=item.inspection,
|
|
@@ -6,9 +6,9 @@ isar/apis/api.py,sha256=VM_WBlHJ4Juv9A0FvaUTeaMVYCN6a7pAojxIGCmDtf0,14154
|
|
|
6
6
|
isar/apis/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
7
|
isar/apis/models/models.py,sha256=iRyqflpjGopm4KJjgRrOnC2swNEk3a-iwVynzw3Nm6c,1992
|
|
8
8
|
isar/apis/models/start_mission_definition.py,sha256=v-wt1XDd53Sw7DCdFAkxBBut-xd_uGJa7qMJnE3VI9k,6364
|
|
9
|
-
isar/apis/robot_control/robot_controller.py,sha256=
|
|
9
|
+
isar/apis/robot_control/robot_controller.py,sha256=RSVlxbw9D668tHWItVLtyjvAnsJkCs2yUSkU3iqeAcY,1393
|
|
10
10
|
isar/apis/schedule/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
|
-
isar/apis/schedule/scheduling_controller.py,sha256=
|
|
11
|
+
isar/apis/schedule/scheduling_controller.py,sha256=w7YJfN5vSRfnd_56ilPi0WRnScsGzo1m8pTQyj2w7bA,9980
|
|
12
12
|
isar/apis/security/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
13
|
isar/apis/security/authentication.py,sha256=Se2puhe2TUBmfio2RLma52-VSLRhqvWgu0Cd1bhdwMo,2000
|
|
14
14
|
isar/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -16,7 +16,7 @@ isar/config/configuration_error.py,sha256=rO6WOhafX6xvVib8WxV-eY483Z0PpN-9PxGsq5
|
|
|
16
16
|
isar/config/log.py,sha256=f_mLLz5RSa0kZkdpi1m0iMdwwDc4RQp12mnT6gu2exE,1303
|
|
17
17
|
isar/config/logging.conf,sha256=a7ZBvZkrMDaPU3eRGAjL_eZz6hZsa6BaRJOfx8mbnnM,629
|
|
18
18
|
isar/config/open_telemetry.py,sha256=Lgu0lbRQA-zz6ZDoBKKk0whQex5w18jl1wjqWzHUGdg,3634
|
|
19
|
-
isar/config/settings.py,sha256=
|
|
19
|
+
isar/config/settings.py,sha256=5A_hxq6AFzg94ROz8yIK8KKZcygwJAosM4ROKJOeCfU,14243
|
|
20
20
|
isar/config/certs/ca-cert.pem,sha256=qoNljfad_qcMxhXJIUMLd7nT-Qwf_d4dYSdoOFEOE8I,2179
|
|
21
21
|
isar/config/keyvault/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
22
22
|
isar/config/keyvault/keyvault_error.py,sha256=zvPCsZLjboxsxthYkxpRERCTFxYV8R5WmACewAUQLwk,41
|
|
@@ -54,7 +54,7 @@ isar/services/auth/azure_credentials.py,sha256=9PlwGe5FrPRbW2dp0go7LMp8_l_FRvL8x
|
|
|
54
54
|
isar/services/service_connections/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
55
55
|
isar/services/service_connections/request_handler.py,sha256=0LxC0lu_HXeEf_xmJWjfEsh14oAUI97cpG1IWtBlcs4,4278
|
|
56
56
|
isar/services/service_connections/mqtt/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
57
|
-
isar/services/service_connections/mqtt/mqtt_client.py,sha256=
|
|
57
|
+
isar/services/service_connections/mqtt/mqtt_client.py,sha256=8Dr65JNwPx5-kRY8UsRtZ_nrQ2gXXSUH6LWFOYlnluo,4482
|
|
58
58
|
isar/services/service_connections/mqtt/robot_heartbeat_publisher.py,sha256=SKPvY2QwBxqnhL9aGuZQDGQ8F_NDqPtQI5bzRBIUxkQ,1203
|
|
59
59
|
isar/services/service_connections/mqtt/robot_info_publisher.py,sha256=AxokGk51hRPTxxD2r0P9braPJCMrf1InaCxrUBKkF4g,1402
|
|
60
60
|
isar/services/utilities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -95,15 +95,15 @@ isar/storage/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
95
95
|
isar/storage/blob_storage.py,sha256=d44z3XpZDUbiKwN8Av2gytTJxnefMXrp5VhiGm4PWxU,3703
|
|
96
96
|
isar/storage/local_storage.py,sha256=Rn-iiiz9DI7PzIhevOMshPIaqzJaqBXeVJMQRhVSl2M,2191
|
|
97
97
|
isar/storage/storage_interface.py,sha256=x-imVeQTdL6dCaTaPTHpXwCR6N4e27WxK_Vpumg0x-Y,1230
|
|
98
|
-
isar/storage/uploader.py,sha256=
|
|
98
|
+
isar/storage/uploader.py,sha256=oaGhHqYrtyvJoFUuD7ZyBgdPNkYaSgQokQZkAjmd4vI,10702
|
|
99
99
|
isar/storage/utilities.py,sha256=oLH0Rp7UtrQQdilfITnmXO1Z0ExdeDhBImYHid55vBA,3449
|
|
100
|
-
isar-1.33.
|
|
100
|
+
isar-1.33.5.dist-info/licenses/LICENSE,sha256=3fc2-ebLwHWwzfQbulGNRdcNob3SBQeCfEVUDYxsuqw,14058
|
|
101
101
|
robot_interface/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
102
102
|
robot_interface/robot_interface.py,sha256=A6t19lcNU_6AfkYKY5DaF0sheym_SZEAawbfaj36Kjk,8997
|
|
103
103
|
robot_interface/test_robot_interface.py,sha256=FV1urn7SbsMyWBIcTKjsBwAG4IsXeZ6pLHE0mA9EGGs,692
|
|
104
104
|
robot_interface/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
105
105
|
robot_interface/models/exceptions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
106
|
-
robot_interface/models/exceptions/robot_exceptions.py,sha256=
|
|
106
|
+
robot_interface/models/exceptions/robot_exceptions.py,sha256=UFya2u-slcf2ebc3ZVCs-Kp1SS9PQvKdWInYMBEQ8BY,10404
|
|
107
107
|
robot_interface/models/initialize/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
108
108
|
robot_interface/models/inspection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
109
109
|
robot_interface/models/inspection/inspection.py,sha256=cjAvekL8r82s7bgukWeXpYylHvJG_oRSCJNISPVCvZg,2238
|
|
@@ -121,8 +121,8 @@ robot_interface/telemetry/payloads.py,sha256=RfLlm_te-bV_xcLtbBx27bgE8gkwPAhWBTF
|
|
|
121
121
|
robot_interface/utilities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
122
122
|
robot_interface/utilities/json_service.py,sha256=9N1zijW7K4d3WFR2autpaS8U9o1ibymiOX-6stTKCyk,1243
|
|
123
123
|
robot_interface/utilities/uuid_string_factory.py,sha256=_NQIbBQ56w0qqO0MUDP6aPpHbxW7ATRhK8HnQiBSLkc,76
|
|
124
|
-
isar-1.33.
|
|
125
|
-
isar-1.33.
|
|
126
|
-
isar-1.33.
|
|
127
|
-
isar-1.33.
|
|
128
|
-
isar-1.33.
|
|
124
|
+
isar-1.33.5.dist-info/METADATA,sha256=NsNwJPhbo_FDVWvBhXwlElPGRsgIXk7-kVlchgZNnXw,31190
|
|
125
|
+
isar-1.33.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
126
|
+
isar-1.33.5.dist-info/entry_points.txt,sha256=TFam7uNNw7J0iiDYzsH2gfG0u1eV1wh3JTw_HkhgKLk,49
|
|
127
|
+
isar-1.33.5.dist-info/top_level.txt,sha256=UwIML2RtuQKCyJJkatcSnyp6-ldDjboB9k9JgKipO-U,21
|
|
128
|
+
isar-1.33.5.dist-info/RECORD,,
|
|
@@ -8,6 +8,7 @@ class ErrorReason(str, Enum):
|
|
|
8
8
|
RobotCommunicationTimeoutException = "robot_communication_timeout_exception"
|
|
9
9
|
RobotInfeasibleTaskException = "robot_infeasible_task_exception"
|
|
10
10
|
RobotInfeasibleMissionException = "robot_infeasible_mission_exception"
|
|
11
|
+
RobotUnreliableDockingStatusException = "robot_unreliable_docking_status_exception"
|
|
11
12
|
RobotMissionStatusException = "robot_mission_status_exception"
|
|
12
13
|
RobotTaskStatusException = "robot_task_status_exception"
|
|
13
14
|
RobotAPIException = "robot_api_exception"
|
|
@@ -88,6 +89,16 @@ class RobotInfeasibleMissionException(RobotException):
|
|
|
88
89
|
pass
|
|
89
90
|
|
|
90
91
|
|
|
92
|
+
class RobotUnreliableDockingStatusException(RobotException):
|
|
93
|
+
def __init__(self, error_description: str) -> None:
|
|
94
|
+
super().__init__(
|
|
95
|
+
error_reason=ErrorReason.RobotUnreliableDockingStatusException,
|
|
96
|
+
error_description=error_description,
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
pass
|
|
100
|
+
|
|
101
|
+
|
|
91
102
|
# An exception which should be thrown by the robot package if it is unable to collect
|
|
92
103
|
# the status of the current mission.
|
|
93
104
|
class RobotMissionStatusException(RobotException):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|