navigateRoute method

Future<NavigationStatus> navigateRoute({
  1. String? routeName,
  2. List<Waypoint>? waypoints,
  3. int? startIndex,
  4. bool? startNearest,
  5. bool? loop,
  6. bool? wait,
  7. Map<String, dynamic>? extra,
})

Drive a route one waypoint at a time using the obstacle-aware planner. Provide either routeName, for a saved route, or waypoints, for an inline list. startNearest overrides startIndex, and with loop set, a wait of true only returns once the robot has stopped.

// Example:
final status = await myNavigationService.navigateRoute(routeName: 'patrol', loop: true);

For more information, see the navigation service docs.

Implementation

Future<NavigationStatus> navigateRoute({
  String? routeName,
  List<Waypoint>? waypoints,
  int? startIndex,
  bool? startNearest,
  bool? loop,
  bool? wait,
  Map<String, dynamic>? extra,
}) async {
  final request = NavigateRouteRequest(
    name: name,
    routeName: routeName,
    waypoints: waypoints,
    startIndex: startIndex,
    startNearest: startNearest,
    loop: loop,
    wait: wait,
    extra: extra?.toStruct(),
  );
  final response = await client.navigateRoute(request, options: callOptions);
  return response.status;
}