linearAcceleration method

  1. @override
Future<Vector3> linearAcceleration({
  1. Map<String, dynamic>? extra,
})
override

Get the current linear acceleration as a Vector3 with x, y, and z axes represented in mm/sec^2.

var linAccel = await myMovementSensor.linearAcceleration();

For more information, see Movement Sensor component.

Implementation

@override
Future<Vector3> linearAcceleration({Map<String, dynamic>? extra}) async {
  final request = GetLinearAccelerationRequest()
    ..name = name
    ..extra = extra?.toStruct() ?? Struct();
  final response = await client.getLinearAcceleration(request);
  return response.linearAcceleration;
}