Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge ObstacleStatus and RobotStatus #89

Merged
merged 3 commits into from
Oct 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/isar_robot/robotinterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,11 @@ 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
obstacle_detected = self._update_obstacle_status()
if obstacle_detected:
return RobotStatus.Blocked
else:
return RobotStatus.Available

def _create_image(self, step: Union[TakeImage, TakeThermalImage]):
now: datetime = datetime.utcnow()
Expand Down Expand Up @@ -328,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:
self.obstacle_status = False
def _check_obstacle_status(self) -> bool:
self.obstacle_status = True
UsamaEquinorAFK marked this conversation as resolved.
Show resolved Hide resolved
return self.obstacle_status