Skip to content

Commit

Permalink
Add interface function to get robot status
Browse files Browse the repository at this point in the history
  • Loading branch information
aeshub committed Feb 8, 2023
1 parent 01c9455 commit aa46889
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/isar_robot/config/settings.env
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
CAPABILITIES = '["take_thermal_image", "take_image", "drive_to_pose"]'
ROBOT_MODEL = Robot
9 changes: 5 additions & 4 deletions src/isar_robot/robotinterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
TimeIndexedPose,
)
from robot_interface.models.mission import InspectionStep, Step, StepStatus
from robot_interface.models.mission.status import RobotStatus
from robot_interface.robot_interface import RobotInterface
from robot_interface.telemetry.mqtt_client import MqttTelemetryPublisher
from robot_interface.telemetry.payloads import (
Expand Down Expand Up @@ -88,7 +89,7 @@ def get_telemetry_publishers(self, queue: Queue, robot_id: str) -> List[Thread]:
telemetry_method=self._get_pose_telemetry,
topic=f"isar/{robot_id}/pose",
interval=1,
retain=True,
retain=False,
)
pose_thread: Thread = Thread(
target=pose_publisher.run,
Expand All @@ -103,7 +104,7 @@ def get_telemetry_publishers(self, queue: Queue, robot_id: str) -> List[Thread]:
telemetry_method=self._get_battery_telemetry,
topic=f"isar/{robot_id}/battery",
interval=5,
retain=True,
retain=False,
)
battery_thread: Thread = Thread(
target=battery_publisher.run,
Expand Down Expand Up @@ -140,5 +141,5 @@ def _get_battery_telemetry(self, robot_id: str) -> str:
)
return json.dumps(battery_payload, cls=EnhancedJSONEncoder)

def is_robot_online(self) -> bool:
return True
def robot_status(self) -> RobotStatus:
return RobotStatus.Available

0 comments on commit aa46889

Please sign in to comment.