GraphNav and Robot Locomotion¶
The GraphNav service provides two RPCs for navigating to different locations on the prior map:
Both RPCs let the client specify maximum speed as well as the size of the goal region at the final waypoint.
NavigateTo RPC is the simplest way to command a robot to go to a destination on the map once the robot is localized. GraphNav will decide which route to take, currently the one with the fewest number of edges.
NavigateRoute RPC allows the client to directly specify the path of the robot. This lets the client command the robot to take a longer path as needed. Routes are specified as a list of waypoints and edges. For example, you could make a path that doubles back on itself, allowing the robot to go to a distant waypoint and then back to the start.
Clients that maintain contact with the robot are encouraged to continuously resend the command with a deadline in the near future. This results in the robot stopping quickly if the client stops checking in. Clients that disconnect from an autonomous robot should set a longer deadline and rely on an alternate mechanism to maintain safety.
Status and feedback¶
API clients should periodically query for navigation status during map replay using the
Unless an error is returned,
NavigationFeedbackResponseis returned with status
STATUS_FOLLOWING_ROUTEand the remaining list of waypoints and edges in the route.
On successful completion, the navigation status changes to
STATUS_REACHED_GOALwhen the robot reaches the end of the commanded route, matching both the position and yaw of the final waypoint.
Clients requiring high precision should check localization with
GetLocalizationState RPC even after reaching the goal, as the robot will be close but not exactly on the goal.
Autonomous navigation errors¶
The following error types can interrupt an autonomous route:
|STATUS_NO_ROUTE||Indicates the client changed something that invalidated the route.|
|STATUS_NO_LOCALIZATION||The robot is not localized to the map.|
|STATUS_NOT_LOCALIZED_TO_ROUTE||Localized and not lost but not on the commanded route.|
|STATUS_COMMAND_OVERRIDDEN||A new GraphNav command has overridden the command that the user is asking for feedback about.|
|STATUS_LOST||Lost means the robot is no longer confident in its localization, and must be re-localized.|
|STATUS_STUCK||Stuck means that the robot is still localized but is having trouble reaching the destination (usually because of an obstacle in the way).|
|Indicates the robot fell or has a hardware problem.|
|STATUS_CONSTRAINT_FAULT||Indicates the route is over-constrained. Choose a different route.|
|STATUS_LEASE_ERROR||Indicates the lease given to GraphNav is no longer valid.|
|STATUS_COMMAND_TIMED_OUT||Indicates a comms problem or the timeout deadline was reached.|