|
1 | | -from distutils.dist import command_re |
2 | 1 | import functools |
3 | 2 | import logging |
4 | 3 | import math |
@@ -1701,33 +1700,31 @@ def download_graph(self, download_path: str) -> typing.Tuple[bool, str]: |
1701 | 1700 | ) |
1702 | 1701 |
|
1703 | 1702 | def set_localization_fiducial(self) -> typing.Tuple[bool, str]: |
1704 | | - """Localize a robot according to near fiducials. |
| 1703 | + """Localize a robot according to near fiducials based on current graph and snapshots in the robot. |
1705 | 1704 |
|
1706 | 1705 | Returns: |
1707 | | - success (bool): success flag |
1708 | | - message (str): message about result |
| 1706 | + (bool, str) tuple indicating whether the command was successfully sent, and a message. |
1709 | 1707 | """ |
1710 | 1708 | try: |
1711 | 1709 | self._set_initial_localization_fiducial() |
1712 | 1710 | return True, "Success" |
1713 | 1711 | except Exception as e: |
1714 | | - return False, f"Error: {e}" |
| 1712 | + return False, f"Got an error while localizing the robot with fiducials: {e}" |
1715 | 1713 |
|
1716 | 1714 | def set_localization_waypoint(self, waypoint_id: str) -> typing.Tuple[bool, str]: |
1717 | | - """Localize a robot to specified waypoint. |
| 1715 | + """Localize a robot to specified waypoint based on current graph and snapshots in the robot.. |
1718 | 1716 |
|
1719 | 1717 | Args: |
1720 | 1718 | waypoint_id (int): ID of waypoint to be localized. |
1721 | 1719 |
|
1722 | 1720 | Returns: |
1723 | | - result (bool): success flag of localization |
1724 | | - message (str): message about result. |
| 1721 | + (bool, str) tuple indicating whether the command was successfully sent, and a message. |
1725 | 1722 | """ |
1726 | 1723 | try: |
1727 | 1724 | resp = self._set_initial_localization_waypoint(waypoint_id) |
1728 | 1725 | return resp[0], resp[1] |
1729 | 1726 | except Exception as e: |
1730 | | - return False, f"Error: {e}" |
| 1727 | + return False, f"Got an error while localizing the robot to the waypoint {waypoint_id}: {e}" |
1731 | 1728 |
|
1732 | 1729 | def cancel_navigation(self) -> None: |
1733 | 1730 | """Cancel navigation of a robot from start_navigation()""" |
|
0 commit comments