Skip to content

Commit

Permalink
Add start_navigation() and cancel_navigation()
Browse files Browse the repository at this point in the history
  • Loading branch information
sktometometo committed Jun 29, 2023
1 parent 493b9a5 commit 64d1123
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions spot_wrapper/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -1695,6 +1695,27 @@ def set_localization_waypoint(self, waypoint_id: str) -> typing.Tuple[bool, str]
except Exception as e:
return False, f"Error: {e}"

def cancel_navigation(self) -> None:
"""Cancel navigation of a robot from start_navigation()
"""
self._cancel_navigate_to()

@try_claim
def start_navigation(self, target_waypoint_id: str) -> tuple(bool, str, str):
"""Navigate a robot to specified waypoint id with GraphNav
Args:
target_waypoint_id (str) : Waypont id string for where to goal
Returns:
result (bool) : success flag
message (str) : message about result
state (str) : state of result. options are 'aborted', 'failed', 'preempted', 'succeeded'.
"""
self._get_localization_state()
resp = self._start_navigate_to(target_waypoint_id)
return resp

@try_claim
def navigate_to(
self,
Expand Down

0 comments on commit 64d1123

Please sign in to comment.