SetPositionTargetGlobalInt.parse constructor

SetPositionTargetGlobalInt.parse(
  1. ByteData data_
)

Implementation

factory SetPositionTargetGlobalInt.parse(ByteData data_) {
  if (data_.lengthInBytes < SetPositionTargetGlobalInt.mavlinkEncodedLength) {
    var len =
        SetPositionTargetGlobalInt.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var timeBootMs = data_.getUint32(0, Endian.little);
  var latInt = data_.getInt32(4, Endian.little);
  var lonInt = data_.getInt32(8, Endian.little);
  var alt = data_.getFloat32(12, Endian.little);
  var vx = data_.getFloat32(16, Endian.little);
  var vy = data_.getFloat32(20, Endian.little);
  var vz = data_.getFloat32(24, Endian.little);
  var afx = data_.getFloat32(28, Endian.little);
  var afy = data_.getFloat32(32, Endian.little);
  var afz = data_.getFloat32(36, Endian.little);
  var yaw = data_.getFloat32(40, Endian.little);
  var yawRate = data_.getFloat32(44, Endian.little);
  var typeMask = data_.getUint16(48, Endian.little);
  var targetSystem = data_.getUint8(50);
  var targetComponent = data_.getUint8(51);
  var coordinateFrame = data_.getUint8(52);

  return SetPositionTargetGlobalInt(
      timeBootMs: timeBootMs,
      latInt: latInt,
      lonInt: lonInt,
      alt: alt,
      vx: vx,
      vy: vy,
      vz: vz,
      afx: afx,
      afy: afy,
      afz: afz,
      yaw: yaw,
      yawRate: yawRate,
      typeMask: typeMask,
      targetSystem: targetSystem,
      targetComponent: targetComponent,
      coordinateFrame: coordinateFrame);
}