isar 1.32.2__py3-none-any.whl → 1.32.3__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/config/settings.py CHANGED
@@ -89,6 +89,9 @@ class Settings(BaseSettings):
89
89
  # Determines how long delay time should be allowed before returning home
90
90
  RETURN_HOME_DELAY: int = Field(default=10)
91
91
 
92
+ # Sets how many times the robot should try to return home if a return home fails
93
+ RETURN_HOME_RETRY_LIMIT: int = Field(default=5)
94
+
92
95
  # Determines which mission planner module is used by ISAR
93
96
  MISSION_PLANNER: str = Field(default="local")
94
97
 
@@ -20,6 +20,7 @@ if TYPE_CHECKING:
20
20
  class ReturningHome(EventHandlerBase):
21
21
 
22
22
  def __init__(self, state_machine: "StateMachine"):
23
+ self.failed_return_home_attemps: int = 0
23
24
  events = state_machine.events
24
25
 
25
26
  def _handle_task_completed(status: TaskStatus):
@@ -28,7 +29,9 @@ class ReturningHome(EventHandlerBase):
28
29
  error_reason=ErrorReason.RobotActionException,
29
30
  error_description="Return home failed.",
30
31
  )
32
+ self.failed_return_home_attemps += 1
31
33
  return state_machine.return_home_failed # type: ignore
34
+
32
35
  return state_machine.returned_home # type: ignore
33
36
 
34
37
  def _start_mission_event_handler(
@@ -5,8 +5,9 @@ if TYPE_CHECKING:
5
5
 
6
6
  from typing import TYPE_CHECKING
7
7
 
8
+ from isar.config.settings import settings
8
9
  from robot_interface.models.mission.mission import Mission
9
- from robot_interface.models.mission.status import MissionStatus, TaskStatus
10
+ from robot_interface.models.mission.status import MissionStatus, RobotStatus, TaskStatus
10
11
  from robot_interface.models.mission.task import ReturnToHome
11
12
 
12
13
  if TYPE_CHECKING:
@@ -23,6 +24,21 @@ def start_return_home_mission(state_machine: "StateMachine") -> bool:
23
24
  return True
24
25
 
25
26
 
27
+ def should_retry_return_home(state_machine: "StateMachine") -> bool:
28
+ if state_machine.shared_state.robot_status.check() != RobotStatus.Available:
29
+ return False
30
+
31
+ return (
32
+ state_machine.returning_home_state.failed_return_home_attemps
33
+ < settings.RETURN_HOME_RETRY_LIMIT
34
+ )
35
+
36
+
37
+ def reset_return_home_failure_counter(state_machine: "StateMachine") -> bool:
38
+ state_machine.returning_home_state.failed_return_home_attemps = 0
39
+ return True
40
+
41
+
26
42
  def set_return_home_status(state_machine: "StateMachine") -> bool:
27
43
  state_machine.log_mission_overview(mission=state_machine.current_mission)
28
44
  state_machine.current_mission.status = MissionStatus.InProgress
@@ -5,8 +5,10 @@ from isar.state_machine.transitions.functions.fail_mission import (
5
5
  report_failed_return_home_and_intervention_needed,
6
6
  )
7
7
  from isar.state_machine.transitions.functions.return_home import (
8
+ reset_return_home_failure_counter,
8
9
  return_home_finished,
9
10
  set_return_home_status,
11
+ should_retry_return_home,
10
12
  start_return_home_mission,
11
13
  )
12
14
  from isar.state_machine.transitions.functions.start_mission import (
@@ -34,6 +36,7 @@ def get_return_home_transitions(state_machine: "StateMachine") -> List[dict]:
34
36
  def_transition(state_machine, start_return_home_mission),
35
37
  def_transition(state_machine, set_return_home_status),
36
38
  def_transition(state_machine, initialize_robot),
39
+ def_transition(state_machine, initialize_robot),
37
40
  ],
38
41
  "before": def_transition(state_machine, trigger_start_mission_event),
39
42
  },
@@ -59,7 +62,25 @@ def get_return_home_transitions(state_machine: "StateMachine") -> List[dict]:
59
62
  "trigger": "returned_home",
60
63
  "source": state_machine.returning_home_state,
61
64
  "dest": state_machine.home_state,
62
- "before": def_transition(state_machine, return_home_finished),
65
+ "before": [
66
+ def_transition(state_machine, reset_return_home_failure_counter),
67
+ def_transition(state_machine, return_home_finished),
68
+ ],
69
+ },
70
+ {
71
+ "trigger": "return_home_failed",
72
+ "source": state_machine.returning_home_state,
73
+ "dest": state_machine.returning_home_state,
74
+ "conditions": [
75
+ def_transition(state_machine, should_retry_return_home),
76
+ ],
77
+ "before": [
78
+ def_transition(state_machine, report_failed_mission_and_finalize),
79
+ def_transition(state_machine, start_return_home_mission),
80
+ def_transition(state_machine, set_return_home_status),
81
+ def_transition(state_machine, initialize_robot),
82
+ def_transition(state_machine, trigger_start_mission_event),
83
+ ],
63
84
  },
64
85
  {
65
86
  "trigger": "return_home_failed",
@@ -69,6 +90,7 @@ def get_return_home_transitions(state_machine: "StateMachine") -> List[dict]:
69
90
  def_transition(
70
91
  state_machine, report_failed_return_home_and_intervention_needed
71
92
  ),
93
+ def_transition(state_machine, reset_return_home_failure_counter),
72
94
  def_transition(state_machine, report_failed_mission_and_finalize),
73
95
  ],
74
96
  },
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: isar
3
- Version: 1.32.2
3
+ Version: 1.32.3
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
@@ -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=965IlPi7urVTL0Yy4uYu4e1P2Ne6HC_RXizM2vCX9kY,2371
19
- isar/config/settings.py,sha256=dRQwL6qCnFoyJkMiBxzVv_JwTfs8UJTnuPnwPlQFhUM,13187
19
+ isar/config/settings.py,sha256=LTY_1ReDOaIpCH_B3s3Jzz7CniZBE7upYUOKkW5gd3g,13325
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
@@ -72,18 +72,18 @@ isar/state_machine/states/intervention_needed.py,sha256=A0QYz1vD1tDKAealihXDuoGu
72
72
  isar/state_machine/states/monitor.py,sha256=366CZSEf1HRVqpm0RkFjIDGnc_9fjeer7qwu1fvbcKQ,3670
73
73
  isar/state_machine/states/offline.py,sha256=5wdNzC1wG0cWrpuT_r_mk8UNFHA4QSyg8ejXUTAg4Io,1137
74
74
  isar/state_machine/states/paused.py,sha256=osmLZhm0-2jcZmNRauveeidCBYayDZvLy-1TNYv6CgQ,1091
75
- isar/state_machine/states/returning_home.py,sha256=6NEszX7phRN46ST25YFZZja75Z1RHSswWSv7V1-26wU,3424
75
+ isar/state_machine/states/returning_home.py,sha256=xs6iWrscar3rWiLejJUy3kTfE-w2ak52gDHLMYX8k30,3527
76
76
  isar/state_machine/states/robot_standing_still.py,sha256=78W465FlVBCTUpmjQHzO5MT7fI6_M8Rh9gS-M8Y9irs,1903
77
77
  isar/state_machine/states/stopping.py,sha256=fMXXvcXtzML-Q5A-uRD_gXePy51fnt9jhOTVFN-3qqA,2420
78
78
  isar/state_machine/states/unknown_status.py,sha256=Y-g9cgme5zriyZ6YUzFRYhOvv9ZylCSwfaY8MJ7xEJ0,1791
79
79
  isar/state_machine/transitions/mission.py,sha256=mUOtEyK2UX_kdK-_L4wq5a60882H2KnlxImO72YMtuo,5557
80
- isar/state_machine/transitions/return_home.py,sha256=Vy_Q_mmTj4wsWL8qxUkmC1CTXEzGsdKNYb4V4rw2IeE,3202
80
+ isar/state_machine/transitions/return_home.py,sha256=AAkpCBMlnHolwtlz-GQQcB9_DzzJqVKTD9UR1-uzZgI,4237
81
81
  isar/state_machine/transitions/robot_status.py,sha256=c1ceyWRGCtx-KTDtxHXRD7oPbt8TQ2ej24A0wyim8vc,2720
82
82
  isar/state_machine/transitions/functions/fail_mission.py,sha256=jHHXhfQVYQEzCXgTEhv5e6uEK9p6iDPFFXqS9bzs_-A,720
83
83
  isar/state_machine/transitions/functions/finish_mission.py,sha256=TRQrk7HdllmAkwsp25HRZAFAk46Y1hLx3jmkIAKrHDI,1442
84
84
  isar/state_machine/transitions/functions/pause.py,sha256=gWr-s76gL0-otrZxCBNmTxUicrAVsdNWDQmHSAOvs6E,1977
85
85
  isar/state_machine/transitions/functions/resume.py,sha256=ji4GjQvQQCr_jYRUGYHSYt-vePtO2z7VAUeKF-hyLBw,2106
86
- isar/state_machine/transitions/functions/return_home.py,sha256=UlniwYvpz74hxqgN0TyVv3LCmiMsqsosKEtEGLqkNj0,1139
86
+ isar/state_machine/transitions/functions/return_home.py,sha256=5WPO40MtuRKm9-NtyrS6m0IVEit14MXfMKjgZ2sCXRU,1666
87
87
  isar/state_machine/transitions/functions/robot_status.py,sha256=P1Cu8xVysbiKRKL4E8mSyoL2-72HfxrLvvOcdnBOlvw,889
88
88
  isar/state_machine/transitions/functions/start_mission.py,sha256=PcD9ANNN3Hxyq6hzvpISMiR94-y1BPNupU-wlRysqT8,2581
89
89
  isar/state_machine/transitions/functions/stop.py,sha256=ZG33TK3VuJwT-LAQ0a3thgt714yCIu42_bo-u1-V1J0,2956
@@ -95,7 +95,7 @@ isar/storage/local_storage.py,sha256=-9Bz2WmniLKwKMeAdrgoMzkj781AOLIUsfaqQERqpUk
95
95
  isar/storage/storage_interface.py,sha256=DRIiy0mRZL3KMZysG0R2Cque6hoqd5haZBw11WM53Vc,840
96
96
  isar/storage/uploader.py,sha256=uD1DzvJ2yYtNAwQGa7UD7kNOxZfKxJ1cCdi7sfOVZ10,9443
97
97
  isar/storage/utilities.py,sha256=oLH0Rp7UtrQQdilfITnmXO1Z0ExdeDhBImYHid55vBA,3449
98
- isar-1.32.2.dist-info/licenses/LICENSE,sha256=3fc2-ebLwHWwzfQbulGNRdcNob3SBQeCfEVUDYxsuqw,14058
98
+ isar-1.32.3.dist-info/licenses/LICENSE,sha256=3fc2-ebLwHWwzfQbulGNRdcNob3SBQeCfEVUDYxsuqw,14058
99
99
  robot_interface/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
100
100
  robot_interface/robot_interface.py,sha256=-jCAKkZ2eiyzUyHVQmOzw4hMgLWR7pE8MHj-WZo85ZY,7978
101
101
  robot_interface/test_robot_interface.py,sha256=FV1urn7SbsMyWBIcTKjsBwAG4IsXeZ6pLHE0mA9EGGs,692
@@ -119,8 +119,8 @@ robot_interface/telemetry/payloads.py,sha256=Fqkfv77_T2Ttk5EjWRU5HH0XAxFhIuz7k-L
119
119
  robot_interface/utilities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
120
120
  robot_interface/utilities/json_service.py,sha256=qkzVkb60Gi_pto-b5n1vNzCrQze2yqgIJqSLNLYj1Fg,1034
121
121
  robot_interface/utilities/uuid_string_factory.py,sha256=_NQIbBQ56w0qqO0MUDP6aPpHbxW7ATRhK8HnQiBSLkc,76
122
- isar-1.32.2.dist-info/METADATA,sha256=C5qAqtRjXX1tn05-zP-T56xgi1Gwh0WkjE1yHi_LfhI,31217
123
- isar-1.32.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
124
- isar-1.32.2.dist-info/entry_points.txt,sha256=TFam7uNNw7J0iiDYzsH2gfG0u1eV1wh3JTw_HkhgKLk,49
125
- isar-1.32.2.dist-info/top_level.txt,sha256=UwIML2RtuQKCyJJkatcSnyp6-ldDjboB9k9JgKipO-U,21
126
- isar-1.32.2.dist-info/RECORD,,
122
+ isar-1.32.3.dist-info/METADATA,sha256=M8uIww8u8xCTsjqhdGmJjsF0a7Jrh5CcKx7RBhyDgQc,31217
123
+ isar-1.32.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
124
+ isar-1.32.3.dist-info/entry_points.txt,sha256=TFam7uNNw7J0iiDYzsH2gfG0u1eV1wh3JTw_HkhgKLk,49
125
+ isar-1.32.3.dist-info/top_level.txt,sha256=UwIML2RtuQKCyJJkatcSnyp6-ldDjboB9k9JgKipO-U,21
126
+ isar-1.32.3.dist-info/RECORD,,
File without changes