GimbalManagerSetPitchyaw.parse constructor

GimbalManagerSetPitchyaw.parse(
  1. ByteData data_
)

Implementation

factory GimbalManagerSetPitchyaw.parse(ByteData data_) {
  if (data_.lengthInBytes < GimbalManagerSetPitchyaw.mavlinkEncodedLength) {
    var len =
        GimbalManagerSetPitchyaw.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 pitch = data_.getFloat32(4, Endian.little);
  var yaw = data_.getFloat32(8, Endian.little);
  var pitchRate = data_.getFloat32(12, Endian.little);
  var yawRate = data_.getFloat32(16, Endian.little);
  var targetSystem = data_.getUint8(20);
  var targetComponent = data_.getUint8(21);
  var gimbalDeviceId = data_.getUint8(22);

  return GimbalManagerSetPitchyaw(
      flags: flags,
      pitch: pitch,
      yaw: yaw,
      pitchRate: pitchRate,
      yawRate: yawRate,
      targetSystem: targetSystem,
      targetComponent: targetComponent,
      gimbalDeviceId: gimbalDeviceId);
}