LocalPositionNedCov.parse constructor

LocalPositionNedCov.parse(
  1. ByteData data_
)

Implementation

factory LocalPositionNedCov.parse(ByteData data_) {
  if (data_.lengthInBytes < LocalPositionNedCov.mavlinkEncodedLength) {
    var len = LocalPositionNedCov.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var timeUsec = data_.getUint64(0, Endian.little);
  var x = data_.getFloat32(8, Endian.little);
  var y = data_.getFloat32(12, Endian.little);
  var z = data_.getFloat32(16, Endian.little);
  var vx = data_.getFloat32(20, Endian.little);
  var vy = data_.getFloat32(24, Endian.little);
  var vz = data_.getFloat32(28, Endian.little);
  var ax = data_.getFloat32(32, Endian.little);
  var ay = data_.getFloat32(36, Endian.little);
  var az = data_.getFloat32(40, Endian.little);
  var covariance = MavlinkMessage.asFloat32List(data_, 44, 45);
  var estimatorType = data_.getUint8(224);

  return LocalPositionNedCov(
      timeUsec: timeUsec,
      x: x,
      y: y,
      z: z,
      vx: vx,
      vy: vy,
      vz: vz,
      ax: ax,
      ay: ay,
      az: az,
      covariance: covariance,
      estimatorType: estimatorType);
}