NavFilterBias.parse constructor

NavFilterBias.parse(
  1. ByteData data_
)

Implementation

factory NavFilterBias.parse(ByteData data_) {
  if (data_.lengthInBytes < NavFilterBias.mavlinkEncodedLength) {
    var len = NavFilterBias.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var usec = data_.getUint64(0, Endian.little);
  var accel0 = data_.getFloat32(8, Endian.little);
  var accel1 = data_.getFloat32(12, Endian.little);
  var accel2 = data_.getFloat32(16, Endian.little);
  var gyro0 = data_.getFloat32(20, Endian.little);
  var gyro1 = data_.getFloat32(24, Endian.little);
  var gyro2 = data_.getFloat32(28, Endian.little);

  return NavFilterBias(
      usec: usec,
      accel0: accel0,
      accel1: accel1,
      accel2: accel2,
      gyro0: gyro0,
      gyro1: gyro1,
      gyro2: gyro2);
}