isar 1.20.2__py3-none-any.whl → 1.34.13__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.
Files changed (134) hide show
  1. isar/apis/api.py +135 -86
  2. isar/apis/models/__init__.py +0 -1
  3. isar/apis/models/models.py +21 -11
  4. isar/apis/models/start_mission_definition.py +115 -170
  5. isar/apis/robot_control/robot_controller.py +41 -0
  6. isar/apis/schedule/scheduling_controller.py +123 -187
  7. isar/apis/security/authentication.py +5 -5
  8. isar/config/certs/ca-cert.pem +33 -31
  9. isar/config/keyvault/keyvault_service.py +4 -2
  10. isar/config/log.py +45 -40
  11. isar/config/logging.conf +16 -31
  12. isar/config/open_telemetry.py +102 -0
  13. isar/config/settings.py +74 -117
  14. isar/eventhandlers/eventhandler.py +123 -0
  15. isar/models/events.py +184 -0
  16. isar/models/status.py +22 -0
  17. isar/modules.py +117 -200
  18. isar/robot/robot.py +383 -0
  19. isar/robot/robot_battery.py +60 -0
  20. isar/robot/robot_monitor_mission.py +357 -0
  21. isar/robot/robot_pause_mission.py +74 -0
  22. isar/robot/robot_resume_mission.py +67 -0
  23. isar/robot/robot_start_mission.py +66 -0
  24. isar/robot/robot_status.py +61 -0
  25. isar/robot/robot_stop_mission.py +68 -0
  26. isar/robot/robot_upload_inspection.py +75 -0
  27. isar/script.py +58 -41
  28. isar/services/service_connections/mqtt/mqtt_client.py +47 -11
  29. isar/services/service_connections/mqtt/robot_heartbeat_publisher.py +5 -2
  30. isar/services/service_connections/mqtt/robot_info_publisher.py +3 -3
  31. isar/services/service_connections/persistent_memory.py +69 -0
  32. isar/services/utilities/mqtt_utilities.py +93 -0
  33. isar/services/utilities/robot_utilities.py +20 -0
  34. isar/services/utilities/scheduling_utilities.py +386 -100
  35. isar/state_machine/state_machine.py +242 -539
  36. isar/state_machine/states/__init__.py +0 -8
  37. isar/state_machine/states/await_next_mission.py +114 -0
  38. isar/state_machine/states/blocked_protective_stop.py +60 -0
  39. isar/state_machine/states/going_to_lockdown.py +95 -0
  40. isar/state_machine/states/going_to_recharging.py +92 -0
  41. isar/state_machine/states/home.py +115 -0
  42. isar/state_machine/states/intervention_needed.py +77 -0
  43. isar/state_machine/states/lockdown.py +38 -0
  44. isar/state_machine/states/maintenance.py +43 -0
  45. isar/state_machine/states/monitor.py +137 -247
  46. isar/state_machine/states/offline.py +51 -53
  47. isar/state_machine/states/paused.py +92 -23
  48. isar/state_machine/states/pausing.py +48 -0
  49. isar/state_machine/states/pausing_return_home.py +48 -0
  50. isar/state_machine/states/recharging.py +80 -0
  51. isar/state_machine/states/resuming.py +57 -0
  52. isar/state_machine/states/resuming_return_home.py +64 -0
  53. isar/state_machine/states/return_home_paused.py +109 -0
  54. isar/state_machine/states/returning_home.py +217 -0
  55. isar/state_machine/states/stopping.py +69 -0
  56. isar/state_machine/states/stopping_due_to_maintenance.py +61 -0
  57. isar/state_machine/states/stopping_go_to_lockdown.py +60 -0
  58. isar/state_machine/states/stopping_go_to_recharge.py +51 -0
  59. isar/state_machine/states/stopping_paused_mission.py +36 -0
  60. isar/state_machine/states/stopping_paused_return_home.py +59 -0
  61. isar/state_machine/states/stopping_return_home.py +59 -0
  62. isar/state_machine/states/unknown_status.py +74 -0
  63. isar/state_machine/states_enum.py +23 -5
  64. isar/state_machine/transitions/mission.py +225 -0
  65. isar/state_machine/transitions/return_home.py +108 -0
  66. isar/state_machine/transitions/robot_status.py +87 -0
  67. isar/state_machine/utils/common_event_handlers.py +138 -0
  68. isar/storage/blob_storage.py +70 -52
  69. isar/storage/local_storage.py +25 -12
  70. isar/storage/storage_interface.py +28 -7
  71. isar/storage/uploader.py +174 -55
  72. isar/storage/utilities.py +32 -29
  73. {isar-1.20.2.dist-info → isar-1.34.13.dist-info}/METADATA +119 -123
  74. isar-1.34.13.dist-info/RECORD +120 -0
  75. {isar-1.20.2.dist-info → isar-1.34.13.dist-info}/WHEEL +1 -1
  76. {isar-1.20.2.dist-info → isar-1.34.13.dist-info}/entry_points.txt +1 -0
  77. robot_interface/models/exceptions/robot_exceptions.py +91 -41
  78. robot_interface/models/inspection/__init__.py +0 -13
  79. robot_interface/models/inspection/inspection.py +42 -33
  80. robot_interface/models/mission/mission.py +14 -15
  81. robot_interface/models/mission/status.py +20 -26
  82. robot_interface/models/mission/task.py +154 -121
  83. robot_interface/models/robots/battery_state.py +6 -0
  84. robot_interface/models/robots/media.py +13 -0
  85. robot_interface/models/robots/robot_model.py +7 -7
  86. robot_interface/robot_interface.py +119 -84
  87. robot_interface/telemetry/mqtt_client.py +74 -12
  88. robot_interface/telemetry/payloads.py +91 -13
  89. robot_interface/utilities/json_service.py +7 -1
  90. isar/config/configuration_error.py +0 -2
  91. isar/config/keyvault/keyvault_error.py +0 -2
  92. isar/config/predefined_mission_definition/__init__.py +0 -0
  93. isar/config/predefined_mission_definition/default_exr.json +0 -51
  94. isar/config/predefined_mission_definition/default_mission.json +0 -91
  95. isar/config/predefined_mission_definition/default_turtlebot.json +0 -124
  96. isar/config/predefined_missions/__init__.py +0 -0
  97. isar/config/predefined_missions/default.json +0 -92
  98. isar/config/predefined_missions/default_turtlebot.json +0 -110
  99. isar/config/predefined_poses/__init__.py +0 -0
  100. isar/config/predefined_poses/predefined_poses.py +0 -616
  101. isar/config/settings.env +0 -25
  102. isar/mission_planner/__init__.py +0 -0
  103. isar/mission_planner/local_planner.py +0 -82
  104. isar/mission_planner/mission_planner_interface.py +0 -26
  105. isar/mission_planner/sequential_task_selector.py +0 -23
  106. isar/mission_planner/task_selector_interface.py +0 -31
  107. isar/models/communication/__init__.py +0 -0
  108. isar/models/communication/message.py +0 -12
  109. isar/models/communication/queues/__init__.py +0 -4
  110. isar/models/communication/queues/queue_io.py +0 -12
  111. isar/models/communication/queues/queue_timeout_error.py +0 -2
  112. isar/models/communication/queues/queues.py +0 -19
  113. isar/models/communication/queues/status_queue.py +0 -20
  114. isar/models/mission_metadata/__init__.py +0 -0
  115. isar/services/auth/__init__.py +0 -0
  116. isar/services/auth/azure_credentials.py +0 -14
  117. isar/services/readers/__init__.py +0 -0
  118. isar/services/readers/base_reader.py +0 -37
  119. isar/services/service_connections/request_handler.py +0 -153
  120. isar/services/service_connections/stid/__init__.py +0 -0
  121. isar/services/utilities/queue_utilities.py +0 -39
  122. isar/services/utilities/threaded_request.py +0 -68
  123. isar/state_machine/states/idle.py +0 -85
  124. isar/state_machine/states/initialize.py +0 -71
  125. isar/state_machine/states/initiate.py +0 -142
  126. isar/state_machine/states/off.py +0 -18
  127. isar/state_machine/states/stop.py +0 -95
  128. isar/storage/slimm_storage.py +0 -191
  129. isar-1.20.2.dist-info/RECORD +0 -116
  130. robot_interface/models/initialize/__init__.py +0 -1
  131. robot_interface/models/initialize/initialize_params.py +0 -9
  132. robot_interface/models/mission/step.py +0 -234
  133. {isar-1.20.2.dist-info → isar-1.34.13.dist-info/licenses}/LICENSE +0 -0
  134. {isar-1.20.2.dist-info → isar-1.34.13.dist-info}/top_level.txt +0 -0
@@ -1,234 +0,0 @@
1
- from dataclasses import dataclass, field
2
- from typing import Any, List, Literal, Optional, Type, Union
3
-
4
- from alitra import Pose, Position
5
-
6
- from robot_interface.models.exceptions.robot_exceptions import ErrorMessage
7
- from robot_interface.models.inspection import (
8
- Audio,
9
- Image,
10
- Inspection,
11
- ThermalImage,
12
- ThermalVideo,
13
- Video,
14
- )
15
- from robot_interface.models.mission.status import StepStatus
16
- from robot_interface.utilities.uuid_string_factory import uuid4_string
17
-
18
-
19
- @dataclass
20
- class Step:
21
- """
22
- Base class for all steps in a mission.
23
- """
24
-
25
- id: str = field(default_factory=uuid4_string, init=False)
26
- status: StepStatus = field(default=StepStatus.NotStarted, init=False)
27
- error_message: Optional[ErrorMessage] = field(default=None, init=False)
28
-
29
- def __str__(self) -> str:
30
- def add_indent(text: str) -> str:
31
- return "".join(" " + line for line in text.splitlines(True))
32
-
33
- def robot_class_to_pretty_string(obj: Step) -> str:
34
- log_message: str = ""
35
- for attr in dir(obj):
36
- if callable(getattr(obj, attr)) or attr.startswith("__"):
37
- continue
38
-
39
- value: Any = getattr(obj, attr)
40
- try:
41
- package_name: Optional[str] = (
42
- str(value.__class__).split("'")[1].split(".")[0]
43
- )
44
- except (AttributeError, IndexError):
45
- package_name = None
46
-
47
- if package_name == "robot_interface":
48
- log_message += (
49
- "\n" + attr + ": " + robot_class_to_pretty_string(value)
50
- )
51
- else:
52
- log_message += "\n" + str(attr) + ": " + str(value)
53
-
54
- return add_indent(log_message)
55
-
56
- class_name: str = type(self).__name__
57
- return class_name + robot_class_to_pretty_string(self)
58
-
59
-
60
- @dataclass
61
- class InspectionStep(Step):
62
- """
63
- Base class for all inspection steps which produce results to be uploaded.
64
- """
65
-
66
- inspections: List[Inspection] = field(default_factory=list, init=False)
67
- tag_id: Optional[str] = field(default=None, init=False)
68
- type = "inspection_type"
69
- metadata: Optional[dict] = field(default_factory=dict, init=False)
70
-
71
- @staticmethod
72
- def get_inspection_type() -> Type[Inspection]:
73
- return Inspection
74
-
75
-
76
- @dataclass
77
- class MotionStep(Step):
78
- """
79
- Base class for all steps which should move the robot, but not return a result.
80
- """
81
-
82
- pass
83
-
84
-
85
- @dataclass
86
- class ContinousInspectionStep(Step):
87
- """
88
- Base class for all continous inspection steps which produce a result to be uploaded.
89
- """
90
-
91
- pass
92
-
93
-
94
- @dataclass
95
- class DriveToPose(MotionStep):
96
- """
97
- Step which causes the robot to move to the given pose.
98
- """
99
-
100
- pose: Pose
101
- type: Literal["drive_to_pose"] = "drive_to_pose"
102
-
103
-
104
- @dataclass
105
- class DockingProcedure(MotionStep):
106
- """
107
- Step which causes the robot to dock or undock
108
- """
109
-
110
- behavior: Literal["dock", "undock"]
111
- type: Literal["docking_procedure"] = "docking_procedure"
112
-
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
-
124
- @dataclass
125
- class Localize(MotionStep):
126
- """
127
- Step which causes the robot to localize
128
- """
129
-
130
- localization_pose: Pose
131
- type: Literal["localize"] = "localize"
132
-
133
-
134
- @dataclass
135
- class MoveArm(MotionStep):
136
- """
137
- Step which causes the robot to move its arm
138
- """
139
-
140
- arm_pose: str
141
- type: Literal["move_arm"] = "move_arm"
142
-
143
-
144
- @dataclass
145
- class TakeImage(InspectionStep):
146
- """
147
- Step which causes the robot to take an image towards the given coordinate.
148
- """
149
-
150
- target: Position
151
- type: Literal["take_image"] = "take_image"
152
-
153
- @staticmethod
154
- def get_inspection_type() -> Type[Inspection]:
155
- return Image
156
-
157
-
158
- @dataclass
159
- class TakeThermalImage(InspectionStep):
160
- """
161
- Step which causes the robot to take a thermal image towards the given coordinate.
162
- """
163
-
164
- target: Position
165
- type: Literal["take_thermal_image"] = "take_thermal_image"
166
-
167
- @staticmethod
168
- def get_inspection_type() -> Type[Inspection]:
169
- return ThermalImage
170
-
171
-
172
- @dataclass
173
- class TakeVideo(InspectionStep):
174
- """
175
- Step which causes the robot to take a video towards the given coordinate.
176
-
177
- Duration of video is given in seconds.
178
- """
179
-
180
- target: Position
181
- duration: float
182
- type: Literal["take_video"] = "take_video"
183
-
184
- @staticmethod
185
- def get_inspection_type() -> Type[Inspection]:
186
- return Video
187
-
188
-
189
- @dataclass
190
- class TakeThermalVideo(InspectionStep):
191
- """
192
- Step which causes the robot to record thermal video towards the given coordinate
193
-
194
- Duration of video is given in seconds.
195
- """
196
-
197
- target: Position
198
- duration: float
199
- type: Literal["take_thermal_video"] = "take_thermal_video"
200
-
201
- @staticmethod
202
- def get_inspection_type() -> Type[Inspection]:
203
- return ThermalVideo
204
-
205
-
206
- @dataclass
207
- class RecordAudio(InspectionStep):
208
- """
209
- Step which causes the robot to record a video at its position, facing the target.
210
-
211
- Duration of audio is given in seconds.
212
- """
213
-
214
- target: Position
215
- duration: float
216
- type: Literal["record_audio"] = "record_audio"
217
-
218
- @staticmethod
219
- def get_inspection_type() -> Type[Inspection]:
220
- return Audio
221
-
222
-
223
- STEPS = Union[
224
- DriveToPose,
225
- DockingProcedure,
226
- ReturnToHome,
227
- Localize,
228
- TakeImage,
229
- TakeThermalImage,
230
- TakeVideo,
231
- TakeThermalVideo,
232
- RecordAudio,
233
- MoveArm,
234
- ]