Skip to content

Commit a4c8bc3

Browse files
committed
Add start_navigation() and cancel_navigation()
1 parent 226ca3d commit a4c8bc3

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

spot_wrapper/wrapper.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1729,6 +1729,27 @@ def set_localization_waypoint(self, waypoint_id: str) -> typing.Tuple[bool, str]
17291729
except Exception as e:
17301730
return False, f"Error: {e}"
17311731

1732+
def cancel_navigation(self) -> None:
1733+
"""Cancel navigation of a robot from start_navigation()
1734+
"""
1735+
self._cancel_navigate_to()
1736+
1737+
@try_claim
1738+
def start_navigation(self, target_waypoint_id: str) -> tuple(bool, str, str):
1739+
"""Navigate a robot to specified waypoint id with GraphNav
1740+
1741+
Args:
1742+
target_waypoint_id (str) : Waypont id string for where to goal
1743+
1744+
Returns:
1745+
result (bool) : success flag
1746+
message (str) : message about result
1747+
state (str) : state of result. options are 'aborted', 'failed', 'preempted', 'succeeded'.
1748+
"""
1749+
self._get_localization_state()
1750+
resp = self._start_navigate_to(target_waypoint_id)
1751+
return resp
1752+
17321753
@try_claim
17331754
def navigate_to(
17341755
self,

0 commit comments

Comments
 (0)