Skip to content

Commit

Permalink
Add telemetry no update exception
Browse files Browse the repository at this point in the history
  • Loading branch information
oysand committed Nov 29, 2024
1 parent adb701a commit 6371500
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/robot_interface/models/exceptions/robot_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,16 @@ def __init__(self, error_description: str) -> None:
pass


# An exception which should be thrown by the robot package if there is no new telemetry update.
class RobotTelemetryNoUpdateException(RobotException):
def __init__(self, error_description: str) -> None:
super().__init__(
error_reason=ErrorReason.RobotTelemetryPoseException,
error_description=error_description,
)

pass

# An exception which should be thrown by the robot package if it is unable to load the
# configuration for maps and transformations. This could be caused by faulty
# configuration and this exception will cause ISAR to crash as further execution is not
Expand Down
3 changes: 2 additions & 1 deletion src/robot_interface/telemetry/mqtt_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from robot_interface.models.exceptions.robot_exceptions import (
RobotTelemetryException,
RobotTelemetryNoUpdateException,
RobotTelemetryPoseException,
)
from robot_interface.telemetry.payloads import CloudHealthPayload
Expand Down Expand Up @@ -74,7 +75,7 @@ def run(self, isar_id: str, robot_name: str) -> None:
try:
payload = self.telemetry_method(isar_id=isar_id, robot_name=robot_name)
topic = self.topic
except RobotTelemetryPoseException:
except (RobotTelemetryPoseException, RobotTelemetryNoUpdateException):
time.sleep(self.interval)
continue
except RobotTelemetryException:
Expand Down

0 comments on commit 6371500

Please sign in to comment.