GlobalPositionIntCov.parse constructor

GlobalPositionIntCov.parse(
  1. ByteData data_
)

Implementation

factory GlobalPositionIntCov.parse(ByteData data_) {
  if (data_.lengthInBytes < GlobalPositionIntCov.mavlinkEncodedLength) {
    var len = GlobalPositionIntCov.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 lat = data_.getInt32(8, Endian.little);
  var lon = data_.getInt32(12, Endian.little);
  var alt = data_.getInt32(16, Endian.little);
  var relativeAlt = data_.getInt32(20, Endian.little);
  var vx = data_.getFloat32(24, Endian.little);
  var vy = data_.getFloat32(28, Endian.little);
  var vz = data_.getFloat32(32, Endian.little);
  var covariance = MavlinkMessage.asFloat32List(data_, 36, 36);
  var estimatorType = data_.getUint8(180);

  return GlobalPositionIntCov(
      timeUsec: timeUsec,
      lat: lat,
      lon: lon,
      alt: alt,
      relativeAlt: relativeAlt,
      vx: vx,
      vy: vy,
      vz: vz,
      covariance: covariance,
      estimatorType: estimatorType);
}