isar 1.23.3__py3-none-any.whl → 1.23.4__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/api.py +1 -0
- isar/config/settings.py +3 -0
- isar/script.py +17 -1
- isar/state_machine/states/monitor.py +12 -5
- {isar-1.23.3.dist-info → isar-1.23.4.dist-info}/METADATA +1 -1
- {isar-1.23.3.dist-info → isar-1.23.4.dist-info}/RECORD +12 -12
- {isar-1.23.3.dist-info → isar-1.23.4.dist-info}/WHEEL +1 -1
- robot_interface/models/exceptions/robot_exceptions.py +1 -1
- robot_interface/robot_interface.py +19 -1
- {isar-1.23.3.dist-info → isar-1.23.4.dist-info}/LICENSE +0 -0
- {isar-1.23.3.dist-info → isar-1.23.4.dist-info}/entry_points.txt +0 -0
- {isar-1.23.3.dist-info → isar-1.23.4.dist-info}/top_level.txt +0 -0
isar/apis/api.py
CHANGED
isar/config/settings.py
CHANGED
|
@@ -140,6 +140,9 @@ class Settings(BaseSettings):
|
|
|
140
140
|
# Keyvault name
|
|
141
141
|
KEYVAULT_NAME: str = Field(default="IsarDevKv")
|
|
142
142
|
|
|
143
|
+
# Determines whether inspections are uploaded asynchronously or get_inspections in robotinterface
|
|
144
|
+
UPLOAD_INSPECTIONS_ASYNC: bool = Field(default=False)
|
|
145
|
+
|
|
143
146
|
# URL to storage account for Azure Blob Storage
|
|
144
147
|
BLOB_STORAGE_ACCOUNT_URL: str = Field(
|
|
145
148
|
default="https://eqrobotdevstorage.blob.core.windows.net"
|
isar/script.py
CHANGED
|
@@ -2,7 +2,7 @@ import logging
|
|
|
2
2
|
import time
|
|
3
3
|
from logging import Logger
|
|
4
4
|
from threading import Thread
|
|
5
|
-
from typing import Any, List
|
|
5
|
+
from typing import Any, List, Tuple
|
|
6
6
|
|
|
7
7
|
from injector import Injector
|
|
8
8
|
|
|
@@ -20,6 +20,8 @@ from isar.services.service_connections.mqtt.robot_heartbeat_publisher import (
|
|
|
20
20
|
from isar.services.service_connections.mqtt.robot_info_publisher import (
|
|
21
21
|
RobotInfoPublisher,
|
|
22
22
|
)
|
|
23
|
+
from robot_interface.models.inspection.inspection import Inspection
|
|
24
|
+
from robot_interface.models.mission.mission import Mission
|
|
23
25
|
from isar.state_machine.state_machine import StateMachine, main
|
|
24
26
|
from isar.storage.uploader import Uploader
|
|
25
27
|
from robot_interface.robot_interface import RobotInterface
|
|
@@ -69,6 +71,7 @@ def print_startup_info():
|
|
|
69
71
|
print_setting("Using local storage", settings.STORAGE_LOCAL_ENABLED)
|
|
70
72
|
print_setting("Using blob storage", settings.STORAGE_BLOB_ENABLED)
|
|
71
73
|
print_setting("Using SLIMM storage", settings.STORAGE_SLIMM_ENABLED)
|
|
74
|
+
print_setting("Using async inspection uploading", settings.UPLOAD_INSPECTIONS_ASYNC)
|
|
72
75
|
print_setting("Plant code", settings.PLANT_CODE)
|
|
73
76
|
print_setting("Plant name", settings.PLANT_NAME)
|
|
74
77
|
print_setting("Plant shortname", settings.PLANT_SHORT_NAME)
|
|
@@ -103,6 +106,18 @@ def start():
|
|
|
103
106
|
target=uploader.run, name="ISAR Uploader", daemon=True
|
|
104
107
|
)
|
|
105
108
|
threads.append(uploader_thread)
|
|
109
|
+
|
|
110
|
+
if settings.UPLOAD_INSPECTIONS_ASYNC:
|
|
111
|
+
|
|
112
|
+
def inspections_callback(inspection: Inspection):
|
|
113
|
+
message: Tuple[Inspection, Mission] = (
|
|
114
|
+
inspection,
|
|
115
|
+
state_machine.current_mission,
|
|
116
|
+
)
|
|
117
|
+
state_machine.queues.upload_queue.put(message)
|
|
118
|
+
|
|
119
|
+
robot.register_inspection_callback(inspections_callback)
|
|
120
|
+
|
|
106
121
|
if settings.MQTT_ENABLED:
|
|
107
122
|
mqtt_client: MqttClient = MqttClient(mqtt_queue=queues.mqtt_queue)
|
|
108
123
|
|
|
@@ -137,6 +152,7 @@ def start():
|
|
|
137
152
|
robot_name=settings.ROBOT_NAME,
|
|
138
153
|
isar_id=settings.ISAR_ID,
|
|
139
154
|
)
|
|
155
|
+
|
|
140
156
|
if publishers:
|
|
141
157
|
threads.extend(publishers)
|
|
142
158
|
|
|
@@ -17,6 +17,7 @@ from robot_interface.models.exceptions.robot_exceptions import (
|
|
|
17
17
|
RobotException,
|
|
18
18
|
RobotRetrieveInspectionException,
|
|
19
19
|
RobotTaskStatusException,
|
|
20
|
+
RobotCommunicationException,
|
|
20
21
|
)
|
|
21
22
|
from robot_interface.models.inspection.inspection import Inspection
|
|
22
23
|
from robot_interface.models.mission.mission import Mission
|
|
@@ -75,8 +76,11 @@ class Monitor(State):
|
|
|
75
76
|
time.sleep(self.state_machine.sleep_time)
|
|
76
77
|
continue
|
|
77
78
|
|
|
78
|
-
except
|
|
79
|
-
|
|
79
|
+
except (
|
|
80
|
+
RobotCommunicationTimeoutException,
|
|
81
|
+
RobotCommunicationException,
|
|
82
|
+
) as e:
|
|
83
|
+
task_failed: bool = self._handle_communication_retry(e)
|
|
80
84
|
if task_failed:
|
|
81
85
|
status = TaskStatus.Failed
|
|
82
86
|
else:
|
|
@@ -111,7 +115,10 @@ class Monitor(State):
|
|
|
111
115
|
|
|
112
116
|
self.state_machine.current_task.status = status
|
|
113
117
|
|
|
114
|
-
if
|
|
118
|
+
if (
|
|
119
|
+
not settings.UPLOAD_INSPECTIONS_ASYNC
|
|
120
|
+
and self._should_upload_inspections()
|
|
121
|
+
):
|
|
115
122
|
get_inspection_thread = ThreadedRequest(
|
|
116
123
|
self._queue_inspections_for_upload
|
|
117
124
|
)
|
|
@@ -207,8 +214,8 @@ class Monitor(State):
|
|
|
207
214
|
)
|
|
208
215
|
self.state_machine.current_task.error_message = error_message
|
|
209
216
|
|
|
210
|
-
def
|
|
211
|
-
self, e: RobotCommunicationTimeoutException
|
|
217
|
+
def _handle_communication_retry(
|
|
218
|
+
self, e: Union[RobotCommunicationTimeoutException, RobotCommunicationException]
|
|
212
219
|
) -> bool:
|
|
213
220
|
self.state_machine.current_mission.error_message = ErrorMessage(
|
|
214
221
|
error_reason=e.error_reason, error_description=e.error_description
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
isar/__init__.py,sha256=cH8p8bVveu3FUL6kBhldcSlLaoHgD82Kd0-SwSNfGXw,87
|
|
2
2
|
isar/modules.py,sha256=aO8bLSC4i_Qo4bOJ6aFfwAZRTJAw8o9SOOfkceUGCiU,6708
|
|
3
|
-
isar/script.py,sha256=
|
|
3
|
+
isar/script.py,sha256=UT-JVu25vOiGaTjGR7hESlfBBITZF6dCy4frtMSUc6Y,5969
|
|
4
4
|
isar/apis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
-
isar/apis/api.py,sha256=
|
|
5
|
+
isar/apis/api.py,sha256=PYJggz9Xh0alo2DWU3QD4lEBQY3PkEs335JE2qG87WQ,13170
|
|
6
6
|
isar/apis/models/__init__.py,sha256=NI1BYyN__Ogr00Qqe0XJ-9gEVPva2brXo2RJsbrS4tM,52
|
|
7
7
|
isar/apis/models/models.py,sha256=6E8VhGBti6EKJefYTDNVERxRu_g_omg4J2MriPUPkaw,1709
|
|
8
8
|
isar/apis/models/start_mission_definition.py,sha256=oY2CRKNkf4DQys0lbz-WTib1Ppw_OUwHqhBTrBhUJQk,8044
|
|
@@ -15,7 +15,7 @@ isar/config/configuration_error.py,sha256=rO6WOhafX6xvVib8WxV-eY483Z0PpN-9PxGsq5
|
|
|
15
15
|
isar/config/log.py,sha256=zHFLmGWQRn8TrcsxUS6KHpJt2JE86kYazU7b-bkcN9o,2285
|
|
16
16
|
isar/config/logging.conf,sha256=mYO1xf27gAopEMHhGzY7-mwyfN16rwRLkPNMvy3zn2g,1127
|
|
17
17
|
isar/config/settings.env,sha256=hJFfyl4S84nmcyf70Pz8nbGlPf4KTVx0UkgP3uf6T8E,534
|
|
18
|
-
isar/config/settings.py,sha256=
|
|
18
|
+
isar/config/settings.py,sha256=0FA0hXqfcJHcfbCJVbbGvSUJGfFX5a0PGTTq8TI6hnw,13539
|
|
19
19
|
isar/config/certs/ca-cert.pem,sha256=ijutWtGOAnKx3xPydNLOVoCLip3tGkNKUpr6pTPQfJA,2179
|
|
20
20
|
isar/config/keyvault/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
21
21
|
isar/config/keyvault/keyvault_error.py,sha256=zvPCsZLjboxsxthYkxpRERCTFxYV8R5WmACewAUQLwk,41
|
|
@@ -73,7 +73,7 @@ isar/state_machine/states/__init__.py,sha256=kErbKPDTwNfCLijvdyN6_AuOqDwR23nu9F0
|
|
|
73
73
|
isar/state_machine/states/idle.py,sha256=iAKESjETKUt9x3inE7TAPIohVM1iRsYyJjOoBeB3sVw,3079
|
|
74
74
|
isar/state_machine/states/initialize.py,sha256=TVXV5Ps3N4_flM88j9pQiX88kZgLzLwzlJy_6hPbgcA,2359
|
|
75
75
|
isar/state_machine/states/initiate.py,sha256=j1wvSC3zVODgRkKOVsQROiuWkjihSBtwCs5GsoivLvc,5655
|
|
76
|
-
isar/state_machine/states/monitor.py,sha256=
|
|
76
|
+
isar/state_machine/states/monitor.py,sha256=mQyJrmsjuMFwcit10SPmJFEbDAMRoSAtFUlooWb6vT0,9530
|
|
77
77
|
isar/state_machine/states/off.py,sha256=jjqN_oJMpBtWuY7hP-c9f0w3p2CYCfe-NpmYHHPnmyI,544
|
|
78
78
|
isar/state_machine/states/offline.py,sha256=ur5wDo4NWRLn7n-p5IUY6aSYcGApmqe_0IbRRywA6qA,2169
|
|
79
79
|
isar/state_machine/states/paused.py,sha256=TIg1iJvAxGUIfzE_qWp0wrq4Ka0a3zEf3GNwIWLIK0M,1177
|
|
@@ -86,11 +86,11 @@ isar/storage/storage_interface.py,sha256=DYDry4I7aZpDHJhsBF6s8zrgokFAc7fdKJKfA8A
|
|
|
86
86
|
isar/storage/uploader.py,sha256=_f-uIiL5ye6GLc7nYQxHrqDXrIquoL_t5tt9SSaYoDA,6440
|
|
87
87
|
isar/storage/utilities.py,sha256=AGqOzhnyPXSStpJjBstqQ4QgUoHJioQB2DJ1NqeWn_w,3136
|
|
88
88
|
robot_interface/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
89
|
-
robot_interface/robot_interface.py,sha256=
|
|
89
|
+
robot_interface/robot_interface.py,sha256=H1hsuiFDcB5tTfan3VsXQyWy2jArWeBkMTr1VvZ4vIs,9061
|
|
90
90
|
robot_interface/test_robot_interface.py,sha256=FV1urn7SbsMyWBIcTKjsBwAG4IsXeZ6pLHE0mA9EGGs,692
|
|
91
91
|
robot_interface/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
92
92
|
robot_interface/models/exceptions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
93
|
-
robot_interface/models/exceptions/robot_exceptions.py,sha256=
|
|
93
|
+
robot_interface/models/exceptions/robot_exceptions.py,sha256=tL3Pf45Nuh9dc9QDRt43SF4qZT3f2NVaRpYj1POVjsA,10093
|
|
94
94
|
robot_interface/models/initialize/__init__.py,sha256=rz5neEDr59GDbzzI_FF0DId-C-I-50l113P-h-C_QBY,48
|
|
95
95
|
robot_interface/models/initialize/initialize_params.py,sha256=2eG5Aq5bDKU6tVkaUMAoc46GERBgyaKkqv6yLupdRLc,164
|
|
96
96
|
robot_interface/models/inspection/__init__.py,sha256=14wfuj4XZazrigKD7fL98khFKz-eckIpEgPcYRj40Kg,227
|
|
@@ -108,9 +108,9 @@ robot_interface/telemetry/payloads.py,sha256=FafpIwsOvcTNtaBZqyOX7r5EjG7nZ2uLNhy
|
|
|
108
108
|
robot_interface/utilities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
109
109
|
robot_interface/utilities/json_service.py,sha256=nU2Q_3P9Fq9hs6F_wtUjWtHfl_g1Siy-yDhXXSKwHwg,1018
|
|
110
110
|
robot_interface/utilities/uuid_string_factory.py,sha256=_NQIbBQ56w0qqO0MUDP6aPpHbxW7ATRhK8HnQiBSLkc,76
|
|
111
|
-
isar-1.23.
|
|
112
|
-
isar-1.23.
|
|
113
|
-
isar-1.23.
|
|
114
|
-
isar-1.23.
|
|
115
|
-
isar-1.23.
|
|
116
|
-
isar-1.23.
|
|
111
|
+
isar-1.23.4.dist-info/LICENSE,sha256=3fc2-ebLwHWwzfQbulGNRdcNob3SBQeCfEVUDYxsuqw,14058
|
|
112
|
+
isar-1.23.4.dist-info/METADATA,sha256=QffW0qReds1tlXA-Zb7bzrWkezchNIx2IiK1rkXhz6s,30674
|
|
113
|
+
isar-1.23.4.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
|
114
|
+
isar-1.23.4.dist-info/entry_points.txt,sha256=TFam7uNNw7J0iiDYzsH2gfG0u1eV1wh3JTw_HkhgKLk,49
|
|
115
|
+
isar-1.23.4.dist-info/top_level.txt,sha256=UwIML2RtuQKCyJJkatcSnyp6-ldDjboB9k9JgKipO-U,21
|
|
116
|
+
isar-1.23.4.dist-info/RECORD,,
|
|
@@ -43,7 +43,7 @@ class RobotException(Exception):
|
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
# An exception which should be thrown by the robot package if it is unable to
|
|
46
|
-
# communicate with the robot API.
|
|
46
|
+
# communicate with the robot API. ISAR will retry the request.
|
|
47
47
|
class RobotCommunicationException(RobotException):
|
|
48
48
|
def __init__(self, error_description: str) -> None:
|
|
49
49
|
super().__init__(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from abc import ABCMeta, abstractmethod
|
|
2
2
|
from queue import Queue
|
|
3
3
|
from threading import Thread
|
|
4
|
-
from typing import List
|
|
4
|
+
from typing import Callable, List
|
|
5
5
|
|
|
6
6
|
from robot_interface.models.initialize import InitializeParams
|
|
7
7
|
from robot_interface.models.inspection.inspection import Inspection
|
|
@@ -180,6 +180,24 @@ class RobotInterface(metaclass=ABCMeta):
|
|
|
180
180
|
"""
|
|
181
181
|
raise NotImplementedError
|
|
182
182
|
|
|
183
|
+
@abstractmethod
|
|
184
|
+
def register_inspection_callback(
|
|
185
|
+
self, callback_function: Callable[[Inspection], None]
|
|
186
|
+
) -> None:
|
|
187
|
+
"""Register a function which should be run when inspection data is received
|
|
188
|
+
asynchronously. This function should expect to receive an Inspection from.
|
|
189
|
+
|
|
190
|
+
Parameters
|
|
191
|
+
----------
|
|
192
|
+
callback_function : Callable[[Inspection]
|
|
193
|
+
|
|
194
|
+
Returns
|
|
195
|
+
-------
|
|
196
|
+
None
|
|
197
|
+
|
|
198
|
+
"""
|
|
199
|
+
raise NotImplementedError
|
|
200
|
+
|
|
183
201
|
@abstractmethod
|
|
184
202
|
def initialize(self, params: InitializeParams) -> None:
|
|
185
203
|
"""Initializes the robot. The initialization needed is robot dependent and the
|
|
File without changes
|
|
File without changes
|
|
File without changes
|