GimbalDeviceSetAttitude.parse constructor

GimbalDeviceSetAttitude.parse(
  1. ByteData data_
)

Implementation

factory GimbalDeviceSetAttitude.parse(ByteData data_) {
  if (data_.lengthInBytes < GimbalDeviceSetAttitude.mavlinkEncodedLength) {
    var len =
        GimbalDeviceSetAttitude.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var q = MavlinkMessage.asFloat32List(data_, 0, 4);
  var angularVelocityX = data_.getFloat32(16, Endian.little);
  var angularVelocityY = data_.getFloat32(20, Endian.little);
  var angularVelocityZ = data_.getFloat32(24, Endian.little);
  var flags = data_.getUint16(28, Endian.little);
  var targetSystem = data_.getUint8(30);
  var targetComponent = data_.getUint8(31);

  return GimbalDeviceSetAttitude(
      q: q,
      angularVelocityX: angularVelocityX,
      angularVelocityY: angularVelocityY,
      angularVelocityZ: angularVelocityZ,
      flags: flags,
      targetSystem: targetSystem,
      targetComponent: targetComponent);
}