Skip to content

Commit

Permalink
Update descriptions of localization methods
Browse files Browse the repository at this point in the history
  • Loading branch information
sktometometo committed Jun 29, 2023
1 parent 8ea1d4d commit e18dd9b
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions spot_wrapper/wrapper.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from distutils.dist import command_re
import functools
import logging
import math
Expand Down Expand Up @@ -1667,33 +1666,31 @@ def download_graph(self, download_path: str) -> typing.Tuple[bool, str]:
)

def set_localization_fiducial(self) -> typing.Tuple[bool, str]:
"""Localize a robot according to near fiducials.
"""Localize a robot according to near fiducials based on current graph and snapshots in the robot.
Returns:
success (bool): success flag
message (str): message about result
(bool, str) tuple indicating whether the command was successfully sent, and a message.
"""
try:
self._set_initial_localization_fiducial()
return True, "Success"
except Exception as e:
return False, f"Error: {e}"
return False, f"Got an error while localizing the robot with fiducials: {e}"

def set_localization_waypoint(self, waypoint_id: str) -> typing.Tuple[bool, str]:
"""Localize a robot to specified waypoint.
"""Localize a robot to specified waypoint based on current graph and snapshots in the robot..
Args:
waypoint_id (int): ID of waypoint to be localized.
Returns:
result (bool): success flag of localization
message (str): message about result.
(bool, str) tuple indicating whether the command was successfully sent, and a message.
"""
try:
resp = self._set_initial_localization_waypoint(waypoint_id)
return resp[0], resp[1]
except Exception as e:
return False, f"Error: {e}"
return False, f"Got an error while localizing the robot to the waypoint {waypoint_id}: {e}"

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

0 comments on commit e18dd9b

Please sign in to comment.