goToLocation method

Future<NavigationStatus> goToLocation(
  1. String locationName, {
  2. bool? wait,
  3. double? linearMPerSec,
  4. Map<String, dynamic>? extra,
})

Drive directly to a saved location with a closed-loop controller, without full path planning. Intended for short hops and docking. wait defaults to true; with false, this returns immediately while navigating.

// Example:
final status = await myNavigationService.goToLocation('dock', wait: false);

For more information, see the navigation service docs.

Implementation

Future<NavigationStatus> goToLocation(
  String locationName, {
  bool? wait,
  double? linearMPerSec,
  Map<String, dynamic>? extra,
}) async {
  final request = GoToLocationRequest(
    name: name,
    locationName: locationName,
    wait: wait,
    linearMPerSec: linearMPerSec,
    extra: extra?.toStruct(),
  );
  final response = await client.goToLocation(request, options: callOptions);
  return response.status;
}