GimbalManagerSetAttitude.parse constructor

GimbalManagerSetAttitude.parse(
  1. ByteData data_
)

Implementation

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

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