FigureEightExecutionStatus.parse constructor

FigureEightExecutionStatus.parse(
  1. ByteData data_
)

Implementation

factory FigureEightExecutionStatus.parse(ByteData data_) {
  if (data_.lengthInBytes < FigureEightExecutionStatus.mavlinkEncodedLength) {
    var len =
        FigureEightExecutionStatus.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 majorRadius = data_.getFloat32(8, Endian.little);
  var minorRadius = data_.getFloat32(12, Endian.little);
  var orientation = data_.getFloat32(16, Endian.little);
  var x = data_.getInt32(20, Endian.little);
  var y = data_.getInt32(24, Endian.little);
  var z = data_.getFloat32(28, Endian.little);
  var frame = data_.getUint8(32);

  return FigureEightExecutionStatus(
      timeUsec: timeUsec,
      majorRadius: majorRadius,
      minorRadius: minorRadius,
      orientation: orientation,
      x: x,
      y: y,
      z: z,
      frame: frame);
}