EstimatorStatus.parse constructor

EstimatorStatus.parse(
  1. ByteData data_
)

Implementation

factory EstimatorStatus.parse(ByteData data_) {
  if (data_.lengthInBytes < EstimatorStatus.mavlinkEncodedLength) {
    var len = EstimatorStatus.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 velRatio = data_.getFloat32(8, Endian.little);
  var posHorizRatio = data_.getFloat32(12, Endian.little);
  var posVertRatio = data_.getFloat32(16, Endian.little);
  var magRatio = data_.getFloat32(20, Endian.little);
  var haglRatio = data_.getFloat32(24, Endian.little);
  var tasRatio = data_.getFloat32(28, Endian.little);
  var posHorizAccuracy = data_.getFloat32(32, Endian.little);
  var posVertAccuracy = data_.getFloat32(36, Endian.little);
  var flags = data_.getUint16(40, Endian.little);

  return EstimatorStatus(
      timeUsec: timeUsec,
      velRatio: velRatio,
      posHorizRatio: posHorizRatio,
      posVertRatio: posVertRatio,
      magRatio: magRatio,
      haglRatio: haglRatio,
      tasRatio: tasRatio,
      posHorizAccuracy: posHorizAccuracy,
      posVertAccuracy: posVertAccuracy,
      flags: flags);
}