Skip to content

Commit a40a878

Browse files
committed
Fix typo and make navigation to navigate_to
1 parent fae31b5 commit a40a878

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

spot_wrapper/wrapper.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ def __init__(
648648
self._last_velocity_command_time = None
649649
self._last_docking_command = None
650650
self._last_navigate_to_command = None
651-
self._state_navigation_valid = None
651+
self._state_navigate_to_valid = None
652652

653653
self._front_image_requests = []
654654
for source in front_image_sources:
@@ -1729,12 +1729,14 @@ def set_localization_waypoint(self, waypoint_id: str) -> typing.Tuple[bool, str]
17291729
f"Got an error while localizing the robot to the waypoint {waypoint_id}: {e}",
17301730
)
17311731

1732-
def cancel_navigation(self) -> None:
1733-
"""Cancel navigation of a robot from start_navigation()"""
1732+
def cancel_navigate_to(self) -> None:
1733+
"""Cancel navigation of a robot from start_navigate_to()"""
17341734
self._cancel_navigate_to()
17351735

17361736
@try_claim
1737-
def start_navigation(self, target_waypoint_id: str) -> typing.Tuple[bool, str, str]:
1737+
def start_navigate_to(
1738+
self, target_waypoint_id: str
1739+
) -> typing.Tuple[bool, str, str]:
17381740
"""Navigate a robot to specified waypoint id with GraphNav
17391741
17401742
Args:
@@ -2506,7 +2508,7 @@ def _cancel_navigate_to(self):
25062508
self._navigate_to_valid = False
25072509

25082510
@try_claim
2509-
def _start_navigation(self, target_waypoint_id):
2511+
def _start_navigate_to(self, target_waypoint_id) -> typing.Tuple[bool, str, str]:
25102512
self._lease = self._lease_wallet.get_lease()
25112513
destination_waypoint = graph_nav_util.find_unique_waypoint_id(
25122514
target_waypoint_id,
@@ -2531,9 +2533,9 @@ def _start_navigation(self, target_waypoint_id):
25312533
sublease = self._lease.create_sublease()
25322534
self._lease_keepalive.shutdown()
25332535

2534-
self._state_navigation_valid = True
2536+
self._state_navigate_to_valid = True
25352537
nav_to_cmd_id = None
2536-
while self._state_navigation_valid:
2538+
while self._state_navigate_to_valid:
25372539
time.sleep(0.5)
25382540
try:
25392541
nav_to_cmd_id = self._graph_nav_client.navigate_to(
@@ -2554,7 +2556,7 @@ def _start_navigation(self, target_waypoint_id):
25542556
self._lease = self._lease_wallet.advance()
25552557
self._lease_keepalive = LeaseKeepAlive(self._lease_client)
25562558

2557-
if self._state_navigation_valid:
2559+
if self._state_navigate_to_valid:
25582560
return False, "Navigation is canceled", "preempted"
25592561

25602562
status = self._graph_nav_client.navigation_feedback(nav_to_cmd_id)

0 commit comments

Comments
 (0)