Previous
Navigate to waypoint
A patrol route is a sequence of GPS waypoints the robot visits in order. The navigation service handles driving between waypoints, replanning around obstacles, and retrying on failure. Your code defines the route and restarts it when the robot finishes.
Add multiple waypoints in the order you want the robot to visit them. The navigation service visits waypoints in the order they were added.
The navigation service visits waypoints in the order they were added. When all waypoints have been visited, GetWaypoints returns an empty list. The service does not automatically loop. Your code is responsible for re-adding waypoints to repeat the patrol.
If the robot fails to reach a waypoint (obstacle it can’t navigate around, motion planning failure), the service retries that waypoint indefinitely. It does not skip to the next waypoint. To skip a stuck waypoint, remove it with RemoveWaypoint.
With the memory store (default), waypoints are lost if viam-server
restarts. If your robot reboots mid-patrol, your code needs to re-add the
waypoints on startup.
With the MongoDB store, waypoints persist across restarts. The robot resumes from the first unvisited waypoint after a reboot. This is better for long-running patrol deployments where the robot may restart due to updates or power cycling.
Was this page helpful?
Glad to hear it! If you have any other feedback please let us know:
We're sorry about that. To help us improve, please tell us what we can do better:
Thank you!