moveStraight method

  1. @override
Future<void> moveStraight(
  1. int distance,
  2. double velocity, {
  3. Map<String, dynamic>? extra,
})
override

Move the Base in a straight line the given distance, expressed in millimeters, at the given velocity, expressed in millimeters per second.

When distance or velocity is 0, the Base will stop. This method blocks until completed or canceled.

// Move the base 40mm forward at 90 mm/s
await myBase.moveStraight(40, 90);

For more information, see Base component.

Implementation

@override
Future<void> moveStraight(int distance, double velocity, {Map<String, dynamic>? extra}) async {
  final request = MoveStraightRequest()
    ..name = name
    ..distanceMm = Int64(distance)
    ..mmPerSec = velocity
    ..extra = extra?.toStruct() ?? Struct();
  await client.moveStraight(request);
}