Ahrs2.parse constructor
Ahrs2.parse(
- ByteData data_
Implementation
factory Ahrs2.parse(ByteData data_) {
if (data_.lengthInBytes < Ahrs2.mavlinkEncodedLength) {
var len = Ahrs2.mavlinkEncodedLength - data_.lengthInBytes;
var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
data_ = Uint8List.fromList(d).buffer.asByteData();
}
var roll = data_.getFloat32(0, Endian.little);
var pitch = data_.getFloat32(4, Endian.little);
var yaw = data_.getFloat32(8, Endian.little);
var altitude = data_.getFloat32(12, Endian.little);
var lat = data_.getInt32(16, Endian.little);
var lng = data_.getInt32(20, Endian.little);
return Ahrs2(
roll: roll,
pitch: pitch,
yaw: yaw,
altitude: altitude,
lat: lat,
lng: lng);
}