Ahrs3.parse constructor

Ahrs3.parse(
  1. ByteData data_
)

Implementation

factory Ahrs3.parse(ByteData data_) {
  if (data_.lengthInBytes < Ahrs3.mavlinkEncodedLength) {
    var len = Ahrs3.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var roll = data_.getFloat32(0, Endian.little);
  var pitch = data_.getFloat32(4, Endian.little);
  var yaw = data_.getFloat32(8, Endian.little);
  var altitude = data_.getFloat32(12, Endian.little);
  var lat = data_.getInt32(16, Endian.little);
  var lng = data_.getInt32(20, Endian.little);
  var v1 = data_.getFloat32(24, Endian.little);
  var v2 = data_.getFloat32(28, Endian.little);
  var v3 = data_.getFloat32(32, Endian.little);
  var v4 = data_.getFloat32(36, Endian.little);

  return Ahrs3(
      roll: roll,
      pitch: pitch,
      yaw: yaw,
      altitude: altitude,
      lat: lat,
      lng: lng,
      v1: v1,
      v2: v2,
      v3: v3,
      v4: v4);
}