Skip to content

Commit

Permalink
Switch robot status when its stuck
Browse files Browse the repository at this point in the history
  • Loading branch information
MuhammadUsama-afk-equinor committed Oct 31, 2023
1 parent a9246e5 commit 785ee35
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/isar_robot/robotinterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,10 @@ def _get_pressure_telemetry(self, isar_id: str, robot_name: str) -> str:
return json.dumps(pressure_payload, cls=EnhancedJSONEncoder)

def robot_status(self) -> RobotStatus:
return RobotStatus.Available
if self._update_obstacle_status():
return RobotStatus.Stuck
else:
return RobotStatus.Available

def _create_image(self, step: Union[TakeImage, TakeThermalImage]):
now: datetime = datetime.utcnow()
Expand Down Expand Up @@ -329,5 +332,5 @@ def _update_pressure_level(self) -> float:
return self.pressure_level

def _update_obstacle_status(self) -> bool:
self.obstacle_status = False
self.obstacle_status = True
return self.obstacle_status

0 comments on commit 785ee35

Please sign in to comment.