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 c8bbca7 commit 4ca54c8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/isar_robot/robotinterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,9 @@ def _get_pressure_telemetry(self, isar_id: str, robot_name: str) -> str:
return json.dumps(pressure_payload, cls=EnhancedJSONEncoder)

def robot_status(self) -> RobotStatus:
obstacle_status = self._update_obstacle_status()
if obstacle_status:
print(self.obstacle_status)
return RobotStatus.Stuck
obstacle_detected = self._update_obstacle_status()
if obstacle_detected:
return RobotStatus.Blocked
else:
return RobotStatus.Available

Expand Down Expand Up @@ -333,6 +332,6 @@ def _update_pressure_level(self) -> float:
self.pressure_level = (100 - randrange(0, 100) * 0.5) * millibar_to_bar
return self.pressure_level

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

0 comments on commit 4ca54c8

Please sign in to comment.