setVelocity method

  1. @override
Future<void> setVelocity(
  1. Vector3 linear,
  2. Vector3 angular, {
  3. Map<String, dynamic>? extra,
})
override

Set the linear and angular velocities of the base, expressed as mm/sec and degrees/sec vectors.

// Set the linear velocity to 50mm/s forward, and the angular velocity
to 15 deg/s counterclockwise
//
await myBase.setVelocity(Vector3(0, 50, 0), Vector3(0, 0, 15));

For more information, see Base component.

Implementation

@override
Future<void> setVelocity(Vector3 linear, Vector3 angular, {Map<String, dynamic>? extra}) async {
  final request = SetVelocityRequest()
    ..name = name
    ..linear = linear
    ..angular = angular
    ..extra = extra?.toStruct() ?? Struct();
  await client.setVelocity(request);
}