|
1 | | -from distutils.dist import command_re |
2 | 1 | import functools |
3 | 2 | import logging |
4 | 3 | import math |
@@ -1667,33 +1666,31 @@ def download_graph(self, download_path: str) -> typing.Tuple[bool, str]: |
1667 | 1666 | ) |
1668 | 1667 |
|
1669 | 1668 | def set_localization_fiducial(self) -> typing.Tuple[bool, str]: |
1670 | | - """Localize a robot according to near fiducials. |
| 1669 | + """Localize a robot according to near fiducials based on current graph and snapshots in the robot. |
1671 | 1670 |
|
1672 | 1671 | Returns: |
1673 | | - success (bool): success flag |
1674 | | - message (str): message about result |
| 1672 | + (bool, str) tuple indicating whether the command was successfully sent, and a message. |
1675 | 1673 | """ |
1676 | 1674 | try: |
1677 | 1675 | self._set_initial_localization_fiducial() |
1678 | 1676 | return True, "Success" |
1679 | 1677 | except Exception as e: |
1680 | | - return False, f"Error: {e}" |
| 1678 | + return False, f"Got an error while localizing the robot with fiducials: {e}" |
1681 | 1679 |
|
1682 | 1680 | def set_localization_waypoint(self, waypoint_id: str) -> typing.Tuple[bool, str]: |
1683 | | - """Localize a robot to specified waypoint. |
| 1681 | + """Localize a robot to specified waypoint based on current graph and snapshots in the robot.. |
1684 | 1682 |
|
1685 | 1683 | Args: |
1686 | 1684 | waypoint_id (int): ID of waypoint to be localized. |
1687 | 1685 |
|
1688 | 1686 | Returns: |
1689 | | - result (bool): success flag of localization |
1690 | | - message (str): message about result. |
| 1687 | + (bool, str) tuple indicating whether the command was successfully sent, and a message. |
1691 | 1688 | """ |
1692 | 1689 | try: |
1693 | 1690 | resp = self._set_initial_localization_waypoint(waypoint_id) |
1694 | 1691 | return resp[0], resp[1] |
1695 | 1692 | except Exception as e: |
1696 | | - return False, f"Error: {e}" |
| 1693 | + return False, f"Got an error while localizing the robot to the waypoint {waypoint_id}: {e}" |
1697 | 1694 |
|
1698 | 1695 | def cancel_navigation(self) -> None: |
1699 | 1696 | """Cancel navigation of a robot from start_navigation()""" |
|
0 commit comments