moveOnGlobe method

Future<String> moveOnGlobe(
  1. GeoPoint destination,
  2. String componentName,
  3. String movementSensorName, {
  4. double? heading,
  5. List<GeoGeometry>? obstacles,
  6. List<GeoGeometry>? boundingRegions,
  7. MotionConfiguration? motionConfiguration,
  8. Map<String, dynamic>? extra,
})

Move the base named componentName to the destination GPS point, using the movement sensor named movementSensorName to determine the robot's location. An optional compass heading in degrees [0-360) can be requested at the destination, travel can be restricted to boundingRegions, and obstacles can be avoided. Returns the execution ID of the resulting plan, which can be passed to getPlan.

// Example:
final executionId = await myMotionService.moveOnGlobe(
  GeoPoint(latitude: 40.7, longitude: -73.9),
  'myBase',
  'myMovementSensor',
);

For more information, see the motion service docs.

Implementation

Future<String> moveOnGlobe(
  common_pb.GeoPoint destination,
  String componentName,
  String movementSensorName, {
  double? heading,
  List<common_pb.GeoGeometry>? obstacles,
  List<common_pb.GeoGeometry>? boundingRegions,
  MotionConfiguration? motionConfiguration,
  Map<String, dynamic>? extra,
}) async {
  final request = MoveOnGlobeRequest(
    name: name,
    destination: destination,
    componentName: componentName,
    movementSensorName: movementSensorName,
    heading: heading,
    obstacles: obstacles,
    boundingRegions: boundingRegions,
    motionConfiguration: motionConfiguration,
    extra: extra?.toStruct(),
  );
  final response = await client.moveOnGlobe(request, options: callOptions);
  return response.executionId;
}