isar 1.28.4__py3-none-any.whl → 1.30.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.

@@ -12,7 +12,7 @@ from robot_interface.models.mission.task import (
12
12
  TASKS,
13
13
  RecordAudio,
14
14
  ReturnToHome,
15
- TakeGasMeasurement,
15
+ TakeCO2Measurement,
16
16
  TakeImage,
17
17
  TakeThermalImage,
18
18
  TakeThermalVideo,
@@ -28,7 +28,7 @@ class InspectionTypes(str, Enum):
28
28
  video = "Video"
29
29
  thermal_video = "ThermalVideo"
30
30
  audio = "Audio"
31
- gas_measurement = "GasMeasurement"
31
+ co2_measurement = "CO2Measurement"
32
32
 
33
33
 
34
34
  class TaskType(str, Enum):
@@ -148,8 +148,8 @@ def to_inspection_task(task_definition: StartMissionTaskDefinition) -> TASKS:
148
148
  target=task_definition.inspection.inspection_target.to_alitra_position(),
149
149
  duration=inspection_definition.duration,
150
150
  )
151
- elif inspection_definition.type == InspectionTypes.gas_measurement:
152
- return TakeGasMeasurement(
151
+ elif inspection_definition.type == InspectionTypes.co2_measurement:
152
+ return TakeCO2Measurement(
153
153
  id=task_definition.id if task_definition.id else uuid4_string(),
154
154
  robot_pose=task_definition.pose.to_alitra_pose(),
155
155
  tag_id=task_definition.tag,
isar/config/settings.py CHANGED
@@ -228,6 +228,9 @@ class Settings(BaseSettings):
228
228
  TOPIC_ISAR_INSPECTION_RESULT: str = Field(
229
229
  default="inspection_result", validate_default=True
230
230
  )
231
+ TOPIC_ISAR_INSPECTION_VALUE: str = Field(
232
+ default="inspection_value", validate_default=True
233
+ )
231
234
  TOPIC_ISAR_ROBOT_INFO: str = Field(default="robot_info", validate_default=True)
232
235
  TOPIC_ISAR_ROBOT_HEARTBEAT: str = Field(
233
236
  default="robot_heartbeat", validate_default=True
@@ -102,7 +102,7 @@ class SlimmStorage(StorageInterface):
102
102
  filename: str, inspection: Inspection, mission: Mission
103
103
  ) -> MultipartEncoder:
104
104
  array_of_orientation = (
105
- inspection.metadata.pose.orientation.to_quat_array().tolist()
105
+ inspection.metadata.robot_pose.orientation.to_quat_array().tolist()
106
106
  )
107
107
  multiform_body: MultipartEncoder = MultipartEncoder(
108
108
  fields={
@@ -118,9 +118,9 @@ class SlimmStorage(StorageInterface):
118
118
  "Mission.MissionId": mission.id,
119
119
  "Mission.Client": "Equinor",
120
120
  "ImageMetadata.Timestamp": inspection.metadata.start_time.isoformat(), # noqa: E501
121
- "ImageMetadata.X": str(inspection.metadata.pose.position.x),
122
- "ImageMetadata.Y": str(inspection.metadata.pose.position.y),
123
- "ImageMetadata.Z": str(inspection.metadata.pose.position.z),
121
+ "ImageMetadata.X": str(inspection.metadata.robot_pose.position.x),
122
+ "ImageMetadata.Y": str(inspection.metadata.robot_pose.position.y),
123
+ "ImageMetadata.Z": str(inspection.metadata.robot_pose.position.z),
124
124
  "ImageMetadata.CameraOrientation1": str(array_of_orientation[0]),
125
125
  "ImageMetadata.CameraOrientation2": str(array_of_orientation[1]),
126
126
  "ImageMetadata.CameraOrientation3": str(array_of_orientation[2]),
@@ -148,7 +148,7 @@ class SlimmStorage(StorageInterface):
148
148
  mission: Mission,
149
149
  ) -> MultipartEncoder:
150
150
  array_of_orientation = (
151
- inspection.metadata.pose.orientation.to_quat_array().tolist()
151
+ inspection.metadata.robot_pose.orientation.to_quat_array().tolist()
152
152
  )
153
153
  multiform_body: MultipartEncoder = MultipartEncoder(
154
154
  fields={
@@ -166,9 +166,9 @@ class SlimmStorage(StorageInterface):
166
166
  "VideoMetadata.Timestamp": inspection.metadata.start_time.isoformat(), # noqa: E501
167
167
  # Converting to int because SLIMM expects an int, while we use floats in operations.
168
168
  "VideoMetadata.Duration": str(int(inspection.metadata.duration)), # type: ignore
169
- "VideoMetadata.X": str(inspection.metadata.pose.position.x),
170
- "VideoMetadata.Y": str(inspection.metadata.pose.position.y),
171
- "VideoMetadata.Z": str(inspection.metadata.pose.position.z),
169
+ "VideoMetadata.X": str(inspection.metadata.robot_pose.position.x),
170
+ "VideoMetadata.Y": str(inspection.metadata.robot_pose.position.y),
171
+ "VideoMetadata.Z": str(inspection.metadata.robot_pose.position.z),
172
172
  "VideoMetadata.CameraOrientation1": str(array_of_orientation[0]),
173
173
  "VideoMetadata.CameraOrientation2": str(array_of_orientation[1]),
174
174
  "VideoMetadata.CameraOrientation3": str(array_of_orientation[2]),
isar/storage/uploader.py CHANGED
@@ -11,10 +11,17 @@ from dependency_injector.wiring import inject
11
11
  from isar.config.settings import settings
12
12
  from isar.models.communication.queues.events import Events
13
13
  from isar.storage.storage_interface import StorageException, StorageInterface
14
- from robot_interface.models.inspection.inspection import Inspection
14
+ from robot_interface.models.inspection.inspection import (
15
+ Inspection,
16
+ InspectionBlob,
17
+ InspectionValue,
18
+ )
15
19
  from robot_interface.models.mission.mission import Mission
16
20
  from robot_interface.telemetry.mqtt_client import MqttClientInterface
17
- from robot_interface.telemetry.payloads import InspectionResultPayload
21
+ from robot_interface.telemetry.payloads import (
22
+ InspectionResultPayload,
23
+ InspectionValuePayload,
24
+ )
18
25
  from robot_interface.utilities.json_service import EnhancedJSONEncoder
19
26
 
20
27
 
@@ -22,6 +29,16 @@ from robot_interface.utilities.json_service import EnhancedJSONEncoder
22
29
  class UploaderQueueItem:
23
30
  inspection: Inspection
24
31
  mission: Mission
32
+
33
+
34
+ @dataclass
35
+ class ValueItem(UploaderQueueItem):
36
+ inspection: InspectionValue
37
+
38
+
39
+ @dataclass
40
+ class BlobItem(UploaderQueueItem):
41
+ inspection: InspectionBlob
25
42
  storage_handler: StorageInterface
26
43
  _retry_count: int
27
44
  _next_retry_time: datetime = datetime.now(timezone.utc)
@@ -100,56 +117,116 @@ class Uploader:
100
117
  )
101
118
  continue
102
119
 
103
- # If new item from thread queue, add one per handler to internal queue:
104
- for storage_handler in self.storage_handlers:
105
- new_item: UploaderQueueItem = UploaderQueueItem(
106
- inspection, mission, storage_handler, _retry_count=-1
107
- )
120
+ new_item: UploaderQueueItem
121
+ if isinstance(inspection, InspectionValue):
122
+ new_item = ValueItem(inspection, mission)
108
123
  self._internal_upload_queue.append(new_item)
124
+
125
+ elif isinstance(inspection, InspectionBlob):
126
+ # If new item from thread queue, add one per handler to internal queue:
127
+ for storage_handler in self.storage_handlers:
128
+ new_item = BlobItem(
129
+ inspection, mission, storage_handler, _retry_count=-1
130
+ )
131
+ self._internal_upload_queue.append(new_item)
132
+ else:
133
+ self.logger.warning(
134
+ f"Unable to add UploaderQueueItem as its type {type(inspection).__name__} is unsupported"
135
+ )
109
136
  except Empty:
110
137
  continue
111
138
 
112
- def _upload(self, upload_item: UploaderQueueItem) -> Union[str, dict]:
139
+ def _upload(self, item: BlobItem) -> Union[str, dict]:
113
140
  inspection_path: Union[str, dict] = ""
114
141
  try:
115
- inspection_path = upload_item.storage_handler.store(
116
- inspection=upload_item.inspection, mission=upload_item.mission
142
+ inspection_path = item.storage_handler.store(
143
+ inspection=item.inspection, mission=item.mission
117
144
  )
118
145
  self.logger.info(
119
- f"Storage handler: {type(upload_item.storage_handler).__name__} "
120
- f"uploaded inspection {str(upload_item.inspection.id)[:8]}"
146
+ f"Storage handler: {type(item.storage_handler).__name__} "
147
+ f"uploaded inspection {str(item.inspection.id)[:8]}"
121
148
  )
122
- self._internal_upload_queue.remove(upload_item)
149
+ self._internal_upload_queue.remove(item)
123
150
  except StorageException:
124
- if upload_item.get_retry_count() < self.max_retry_attempts:
125
- upload_item.increment_retry(self.max_wait_time)
151
+ if item.get_retry_count() < self.max_retry_attempts:
152
+ item.increment_retry(self.max_wait_time)
126
153
  self.logger.warning(
127
- f"Storage handler: {type(upload_item.storage_handler).__name__} "
154
+ f"Storage handler: {type(item.storage_handler).__name__} "
128
155
  f"failed to upload inspection: "
129
- f"{str(upload_item.inspection.id)[:8]}. "
130
- f"Retrying in {upload_item.seconds_until_retry()}s."
156
+ f"{str(item.inspection.id)[:8]}. "
157
+ f"Retrying in {item.seconds_until_retry()}s."
131
158
  )
132
159
  else:
133
- self._internal_upload_queue.remove(upload_item)
134
160
  self.logger.error(
135
- f"Storage handler: {type(upload_item.storage_handler).__name__} "
161
+ f"Storage handler: {type(item.storage_handler).__name__} "
136
162
  f"exceeded max retries to upload inspection: "
137
- f"{str(upload_item.inspection.id)[:8]}. Aborting upload."
163
+ f"{str(item.inspection.id)[:8]}. Aborting upload."
138
164
  )
165
+ self._internal_upload_queue.remove(item)
139
166
  return inspection_path
140
167
 
141
168
  def _process_upload_queue(self) -> None:
169
+ def should_upload(_item):
170
+ if isinstance(_item, ValueItem):
171
+ return True
172
+ if _item.is_ready_for_upload():
173
+ return True
174
+ return False
175
+
142
176
  ready_items: List[UploaderQueueItem] = [
143
- item for item in self._internal_upload_queue if item.is_ready_for_upload()
177
+ item for item in self._internal_upload_queue if should_upload(item)
144
178
  ]
145
179
  for item in ready_items:
146
- inspection_path = self._upload(item)
147
- self._publish_inspection_result(
148
- inspection=item.inspection, inspection_path=inspection_path
180
+ if isinstance(item, ValueItem):
181
+ self._publish_inspection_value(item.inspection)
182
+ self.logger.info(
183
+ f"Published value for inspection {str(item.inspection.id)[:8]}"
184
+ )
185
+ self._internal_upload_queue.remove(item)
186
+ elif isinstance(item, BlobItem):
187
+ inspection_path = self._upload(item)
188
+ self._publish_inspection_result(
189
+ inspection=item.inspection, inspection_path=inspection_path
190
+ )
191
+ else:
192
+ self.logger.warning(
193
+ f"Unable to process upload item as its type {type(item).__name__} is not supported"
194
+ )
195
+
196
+ def _publish_inspection_value(self, inspection: InspectionValue) -> None:
197
+ if not self.mqtt_publisher:
198
+ return
199
+
200
+ if not isinstance(inspection, InspectionValue):
201
+ logging.warning(
202
+ f"Excpected type InspectionValue but got {type(inspection).__name__} instead"
149
203
  )
204
+ return
205
+
206
+ payload: InspectionValuePayload = InspectionValuePayload(
207
+ isar_id=settings.ISAR_ID,
208
+ robot_name=settings.ROBOT_NAME,
209
+ inspection_id=inspection.id,
210
+ installation_code=settings.PLANT_SHORT_NAME,
211
+ tag_id=inspection.metadata.tag_id,
212
+ inspection_type=type(inspection).__name__,
213
+ inspection_description=inspection.metadata.inspection_description,
214
+ value=inspection.value,
215
+ unit=inspection.unit,
216
+ x=inspection.metadata.robot_pose.position.x,
217
+ y=inspection.metadata.robot_pose.position.y,
218
+ z=inspection.metadata.robot_pose.position.z,
219
+ timestamp=inspection.metadata.start_time,
220
+ )
221
+ self.mqtt_publisher.publish(
222
+ topic=settings.TOPIC_ISAR_INSPECTION_VALUE,
223
+ payload=json.dumps(payload, cls=EnhancedJSONEncoder),
224
+ qos=1,
225
+ retain=True,
226
+ )
150
227
 
151
228
  def _publish_inspection_result(
152
- self, inspection: Inspection, inspection_path: Union[str, dict]
229
+ self, inspection: InspectionBlob, inspection_path: Union[str, dict]
153
230
  ) -> None:
154
231
  """Publishes the reference of the inspection result to the MQTT Broker
155
232
  along with the analysis type
isar/storage/utilities.py CHANGED
@@ -41,23 +41,26 @@ def construct_metadata_file(
41
41
  "isar_id": settings.ISAR_ID,
42
42
  "robot_name": settings.ROBOT_NAME,
43
43
  "inspection_description": inspection.metadata.inspection_description,
44
+ "tag": inspection.metadata.tag_id,
45
+ "robot_pose": {
46
+ "position": {
47
+ "x": inspection.metadata.robot_pose.position.x,
48
+ "y": inspection.metadata.robot_pose.position.y,
49
+ "z": inspection.metadata.robot_pose.position.z,
50
+ },
51
+ "orientation": inspection.metadata.robot_pose.orientation.to_quat_array(),
52
+ },
53
+ "target_position": {
54
+ "x": inspection.metadata.target_position.x,
55
+ "y": inspection.metadata.target_position.y,
56
+ "z": inspection.metadata.target_position.z,
57
+ },
58
+ "timestamp": inspection.metadata.start_time,
44
59
  },
45
- "data": [
60
+ "data_files": [
46
61
  {
47
62
  "folder": f"/{get_foldername(mission=mission)}",
48
- "files": [
49
- {
50
- "file_name": filename,
51
- "timestamp": inspection.metadata.start_time,
52
- "x": inspection.metadata.pose.position.x,
53
- "y": inspection.metadata.pose.position.y,
54
- "z": inspection.metadata.pose.position.z,
55
- "tag": inspection.metadata.tag_id,
56
- "additional_media_metadata": {
57
- "orientation": inspection.metadata.pose.orientation.to_quat_array() # noqa: E501
58
- },
59
- }
60
- ],
63
+ "file_name": filename,
61
64
  }
62
65
  ],
63
66
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: isar
3
- Version: 1.28.4
3
+ Version: 1.30.0
4
4
  Summary: Integration and Supervisory control of Autonomous Robots
5
5
  Author-email: Equinor ASA <fg_robots_dev@equinor.com>
6
6
  License: Eclipse Public License version 2.0
@@ -5,7 +5,7 @@ isar/apis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  isar/apis/api.py,sha256=1-RmRH7NReCpOo_NSwP5hS2lDQm6_Dx2ZWe2460GhJY,13770
6
6
  isar/apis/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  isar/apis/models/models.py,sha256=HzLaWhjAv0uJRBWipIgYg_F75eaQ5jl9Pi4UnYbDJ-M,1749
8
- isar/apis/models/start_mission_definition.py,sha256=5Ri4rW0iu8_PffMYaNCj-epVIKyg7TMttkos8UaUCLc,6152
8
+ isar/apis/models/start_mission_definition.py,sha256=S87i_vrgXTY1nTMTiXMJAnx_q5uVxuiRNcrQrAYWKeo,6152
9
9
  isar/apis/robot_control/robot_controller.py,sha256=7EVukShJDhYez12wYeGWZXH-BrfQ4Wu2so0-fSWN2Zo,1277
10
10
  isar/apis/schedule/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  isar/apis/schedule/scheduling_controller.py,sha256=ggoWjYKxgMwJ5trs8gsU8SGj6CQlmb7Ee1SjRg7hSTw,9671
@@ -16,7 +16,7 @@ isar/config/configuration_error.py,sha256=rO6WOhafX6xvVib8WxV-eY483Z0PpN-9PxGsq5
16
16
  isar/config/log.py,sha256=SzEWbzXU1DpN7YONIRT8k0zBOGm_qVkXlJuuZtb8STc,2300
17
17
  isar/config/logging.conf,sha256=mYO1xf27gAopEMHhGzY7-mwyfN16rwRLkPNMvy3zn2g,1127
18
18
  isar/config/settings.env,sha256=cLIlcXTM8x0N-6XjXmC0Qclx5dfDC6myqa25tvVwmRw,500
19
- isar/config/settings.py,sha256=Scr9clvqarBGzLceAcjPivBMAZ3GGPuaV5OB3J6B5_s,12966
19
+ isar/config/settings.py,sha256=pXRWjvnLIlOJIXlYVJq16AqZPjotkTH7-y6dVj3cQew,13076
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
@@ -99,11 +99,11 @@ isar/state_machine/transitions/functions/utils.py,sha256=Wa72Ocq4QT1E6qkpEJZQ3h5
99
99
  isar/storage/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
100
100
  isar/storage/blob_storage.py,sha256=Qci6bO508nlTHKPuPtVU5QcvGA4T7mv8cFrKWRcfw4g,3226
101
101
  isar/storage/local_storage.py,sha256=Bnmoi5gyN8r-oRh0aHrOdGqaH3JqRScFKMRXYojW5kY,1855
102
- isar/storage/slimm_storage.py,sha256=4YsQ1RBztfx6n3pEblwb5G3ndoQN_IZm7bujRktpTx4,8748
102
+ isar/storage/slimm_storage.py,sha256=DwrryuiddMf5eRmjt3Di0f1GuoTG2faQTfRh378GHu0,8796
103
103
  isar/storage/storage_interface.py,sha256=DYDry4I7aZpDHJhsBF6s8zrgokFAc7fdKJKfA8AvL7o,828
104
- isar/storage/uploader.py,sha256=XoNnDS7_ILRZMGnQCBpRERmgSbFYPfgKRYk1tNHSFxQ,6868
105
- isar/storage/utilities.py,sha256=TcNYyF4nj7egEzBvYblr3IWFXLeqlXS6V7DQxgxNzj0,3340
106
- isar-1.28.4.dist-info/licenses/LICENSE,sha256=3fc2-ebLwHWwzfQbulGNRdcNob3SBQeCfEVUDYxsuqw,14058
104
+ isar/storage/uploader.py,sha256=HAC3ssuPQCQ1xH4aTQfHIaq-ZoEzKwONWmsAOpNXOzw,9523
105
+ isar/storage/utilities.py,sha256=oLH0Rp7UtrQQdilfITnmXO1Z0ExdeDhBImYHid55vBA,3449
106
+ isar-1.30.0.dist-info/licenses/LICENSE,sha256=3fc2-ebLwHWwzfQbulGNRdcNob3SBQeCfEVUDYxsuqw,14058
107
107
  robot_interface/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
108
108
  robot_interface/robot_interface.py,sha256=9I6c_7Qi8lOwb8M96p12iX2KwrRhcAXz1Ug_tnBEKcU,7821
109
109
  robot_interface/test_robot_interface.py,sha256=FV1urn7SbsMyWBIcTKjsBwAG4IsXeZ6pLHE0mA9EGGs,692
@@ -112,23 +112,23 @@ robot_interface/models/exceptions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeR
112
112
  robot_interface/models/exceptions/robot_exceptions.py,sha256=VrsWPf4g0qN5sJRKhc3ER_Wt5drK0MZRuECU-csIlDA,10026
113
113
  robot_interface/models/initialize/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
114
114
  robot_interface/models/inspection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
115
- robot_interface/models/inspection/inspection.py,sha256=AKyca_j2TMQSF-LEjU1_obZTpFS03e8xSH9qWqVVmg4,2254
115
+ robot_interface/models/inspection/inspection.py,sha256=2T8czQcNt9J1M96tKGQA6P3s5CikdZ7-0RevXQ4-CfA,2520
116
116
  robot_interface/models/mission/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
117
117
  robot_interface/models/mission/mission.py,sha256=MQ9p5cuclLXexaZu9bkDh5-aN99eunvYC0vP-Z_kUwI,960
118
118
  robot_interface/models/mission/status.py,sha256=UOCARLfLxLFXJEjfIH7aXYXO7xajOKBJsxz-Wd6gZQ4,740
119
- robot_interface/models/mission/task.py,sha256=tEvgq15lcRA0AHHtQGNe-GWc_e-V5BlDsA4IYJ1djN0,4864
119
+ robot_interface/models/mission/task.py,sha256=7g4Xu-2yn3A7JVqrqg-XHHIX1uwYuIrRB00GrOchjio,4820
120
120
  robot_interface/models/robots/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
121
121
  robot_interface/models/robots/battery_state.py,sha256=ktOtJ8ltdK0k_i7BoqYfhc5dbOzIG6Oo-uWC67fCWio,98
122
122
  robot_interface/models/robots/media.py,sha256=8A-CuuubfngzPprs6zWB9hSaqe3jzgsE8rcCzRX2Uto,227
123
123
  robot_interface/models/robots/robot_model.py,sha256=-0jNKWPcEgtF_2klb1It3u0SCoAR0hSW9nce58Zq0Co,417
124
124
  robot_interface/telemetry/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
125
125
  robot_interface/telemetry/mqtt_client.py,sha256=ueXdtIFNCwciTj4spvdJj9emd-IOmUuJjpsXQSSWZPY,2987
126
- robot_interface/telemetry/payloads.py,sha256=75hR-FYwmcbQVqorLzaStOrx_6DI3_CTxFpNIe2xFUc,2394
126
+ robot_interface/telemetry/payloads.py,sha256=78EVedDyRhYIquwXWdwjhA3RntMboCcuPWE7TI_gDf0,2721
127
127
  robot_interface/utilities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
128
128
  robot_interface/utilities/json_service.py,sha256=qkzVkb60Gi_pto-b5n1vNzCrQze2yqgIJqSLNLYj1Fg,1034
129
129
  robot_interface/utilities/uuid_string_factory.py,sha256=_NQIbBQ56w0qqO0MUDP6aPpHbxW7ATRhK8HnQiBSLkc,76
130
- isar-1.28.4.dist-info/METADATA,sha256=o2dqDYzeonSya0kYVlQ0llx9ZZlRoWJ0CgkHtOo83Es,30709
131
- isar-1.28.4.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
132
- isar-1.28.4.dist-info/entry_points.txt,sha256=TFam7uNNw7J0iiDYzsH2gfG0u1eV1wh3JTw_HkhgKLk,49
133
- isar-1.28.4.dist-info/top_level.txt,sha256=UwIML2RtuQKCyJJkatcSnyp6-ldDjboB9k9JgKipO-U,21
134
- isar-1.28.4.dist-info/RECORD,,
130
+ isar-1.30.0.dist-info/METADATA,sha256=Kj9vQrIn0f8Ykkq6J9BSOfnvbKnPk2lI8aRDi6YnVuo,30709
131
+ isar-1.30.0.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
132
+ isar-1.30.0.dist-info/entry_points.txt,sha256=TFam7uNNw7J0iiDYzsH2gfG0u1eV1wh3JTw_HkhgKLk,49
133
+ isar-1.30.0.dist-info/top_level.txt,sha256=UwIML2RtuQKCyJJkatcSnyp6-ldDjboB9k9JgKipO-U,21
134
+ isar-1.30.0.dist-info/RECORD,,
@@ -3,14 +3,15 @@ from dataclasses import dataclass, field
3
3
  from datetime import datetime
4
4
  from typing import Optional, Type
5
5
 
6
- from alitra import Pose
6
+ from alitra import Pose, Position
7
7
  from pydantic import BaseModel, Field
8
8
 
9
9
 
10
10
  @dataclass
11
11
  class InspectionMetadata(ABC):
12
12
  start_time: datetime
13
- pose: Pose
13
+ robot_pose: Pose
14
+ target_position: Position
14
15
  file_type: str
15
16
  tag_id: Optional[str] = field(default=None, init=False)
16
17
  inspection_description: Optional[str] = field(default=None, init=False)
@@ -49,14 +50,22 @@ class GasMeasurementMetadata(InspectionMetadata):
49
50
  class Inspection(BaseModel):
50
51
  metadata: InspectionMetadata
51
52
  id: str = Field(frozen=True)
52
- data: Optional[bytes] = Field(default=None, frozen=True)
53
53
 
54
54
  @staticmethod
55
55
  def get_metadata_type() -> Type[InspectionMetadata]:
56
56
  return InspectionMetadata
57
57
 
58
58
 
59
- class Image(Inspection):
59
+ class InspectionValue(Inspection):
60
+ value: float = Field(frozen=True)
61
+ unit: str = Field(frozen=True)
62
+
63
+
64
+ class InspectionBlob(Inspection):
65
+ data: Optional[bytes] = Field(default=None, frozen=True)
66
+
67
+
68
+ class Image(InspectionBlob):
60
69
  metadata: ImageMetadata
61
70
 
62
71
  @staticmethod
@@ -64,7 +73,7 @@ class Image(Inspection):
64
73
  return ImageMetadata
65
74
 
66
75
 
67
- class ThermalImage(Inspection):
76
+ class ThermalImage(InspectionBlob):
68
77
  metadata: ThermalImageMetadata
69
78
 
70
79
  @staticmethod
@@ -72,7 +81,7 @@ class ThermalImage(Inspection):
72
81
  return ThermalImageMetadata
73
82
 
74
83
 
75
- class Video(Inspection):
84
+ class Video(InspectionBlob):
76
85
  metadata: VideoMetadata
77
86
 
78
87
  @staticmethod
@@ -80,7 +89,7 @@ class Video(Inspection):
80
89
  return VideoMetadata
81
90
 
82
91
 
83
- class ThermalVideo(Inspection):
92
+ class ThermalVideo(InspectionBlob):
84
93
  metadata: ThermalVideoMetadata
85
94
 
86
95
  @staticmethod
@@ -88,7 +97,7 @@ class ThermalVideo(Inspection):
88
97
  return ThermalVideoMetadata
89
98
 
90
99
 
91
- class Audio(Inspection):
100
+ class Audio(InspectionBlob):
92
101
  metadata: AudioMetadata
93
102
 
94
103
  @staticmethod
@@ -96,9 +105,13 @@ class Audio(Inspection):
96
105
  return AudioMetadata
97
106
 
98
107
 
99
- class GasMeasurement(Inspection):
108
+ class GasMeasurement(InspectionValue):
100
109
  metadata: GasMeasurementMetadata
101
110
 
102
111
  @staticmethod
103
112
  def get_metadata_type() -> Type[InspectionMetadata]:
104
113
  return GasMeasurementMetadata
114
+
115
+
116
+ class CO2Measurement(GasMeasurement):
117
+ pass
@@ -7,7 +7,7 @@ from pydantic import BaseModel, Field
7
7
  from robot_interface.models.exceptions.robot_exceptions import ErrorMessage
8
8
  from robot_interface.models.inspection.inspection import (
9
9
  Audio,
10
- GasMeasurement,
10
+ CO2Measurement,
11
11
  Image,
12
12
  Inspection,
13
13
  ThermalImage,
@@ -25,7 +25,7 @@ class TaskTypes(str, Enum):
25
25
  TakeThermalImage = "take_thermal_image"
26
26
  TakeVideo = "take_video"
27
27
  TakeThermalVideo = "take_thermal_video"
28
- TakeGasMeasurement = "take_gas_measurement"
28
+ TakeCO2Measurement = "take_co2_measurement"
29
29
  RecordAudio = "record_audio"
30
30
 
31
31
 
@@ -160,18 +160,16 @@ class RecordAudio(InspectionTask):
160
160
  return Audio
161
161
 
162
162
 
163
- class TakeGasMeasurement(InspectionTask):
163
+ class TakeCO2Measurement(InspectionTask):
164
164
  """
165
165
  Task which causes the robot to take a CO2 measurement at its position.
166
-
167
- Duration of audio is given in seconds.
168
166
  """
169
167
 
170
- type: Literal[TaskTypes.TakeGasMeasurement] = TaskTypes.TakeGasMeasurement
168
+ type: Literal[TaskTypes.TakeCO2Measurement] = TaskTypes.TakeCO2Measurement
171
169
 
172
170
  @staticmethod
173
171
  def get_inspection_type() -> Type[Inspection]:
174
- return GasMeasurement
172
+ return CO2Measurement
175
173
 
176
174
 
177
175
  TASKS = Union[
@@ -181,6 +179,6 @@ TASKS = Union[
181
179
  TakeThermalImage,
182
180
  TakeVideo,
183
181
  TakeThermalVideo,
184
- TakeGasMeasurement,
182
+ TakeCO2Measurement,
185
183
  RecordAudio,
186
184
  ]
@@ -115,3 +115,20 @@ class InspectionResultPayload:
115
115
  inspection_type: Optional[str]
116
116
  inspection_description: Optional[str]
117
117
  timestamp: datetime
118
+
119
+
120
+ @dataclass
121
+ class InspectionValuePayload:
122
+ isar_id: str
123
+ robot_name: str
124
+ inspection_id: str
125
+ installation_code: str
126
+ tag_id: Optional[str]
127
+ inspection_type: Optional[str]
128
+ inspection_description: Optional[str]
129
+ value: float
130
+ unit: str
131
+ x: float
132
+ y: float
133
+ z: float
134
+ timestamp: datetime
File without changes