# VectorNav C++ Library: include/vn/packet.h Source File

packet.h
#ifndef _VNPROTOCOL_UART_PACKET_H_
#define _VNPROTOCOL_UART_PACKET_H_
#include "int.h"
#include "vector.h"
#include "matrix.h"
#include "nocopy.h"
#include "types.h"
namespace vn {
namespace protocol {
namespace uart {
struct vn_proglib_DLLEXPORT Packet
{
static const unsigned char BinaryGroupLengths[sizeof(uint8_t)*8][sizeof(uint16_t)*8];
enum Type
{
TYPE_UNKNOWN,
TYPE_BINARY,
TYPE_ASCII
};
Packet();
Packet(char const* packet, size_t length);
explicit Packet(std::string packet);
Packet(const Packet &toCopy);
~Packet();
Packet& operator=(const Packet &from);
std::string datastr();
Type type();
bool isValid();
bool isError();
bool isResponse();
bool isAsciiAsync();
AsciiAsync determineAsciiAsyncType();
bool isCompatible(CommonGroup commonGroup, TimeGroup timeGroup, ImuGroup imuGroup, GpsGroup gpsGroup, AttitudeGroup attitudeGroup, InsGroup insGroup);
static size_t computeBinaryPacketLength(const char *startOfPossibleBinaryPacket);
static size_t computeNumOfBytesForBinaryGroupPayload(BinaryGroup group, uint16_t groupField);
SensorError parseError();
uint8_t groups();
uint16_t groupField(size_t index);
uint8_t extractUint8();
int8_t extractInt8();
uint16_t extractUint16();
uint32_t extractUint32();
uint64_t extractUint64();
float extractFloat();
vn::math::vec3f extractVec3f();
vn::math::vec3d extractVec3d();
vn::math::vec4f extractVec4f();
vn::math::mat3f extractMat3f();
static size_t finalizeCommand(ErrorDetectionMode errorDetectionMode, char *packet, size_t length);
static size_t genReadBinaryOutput1(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genReadBinaryOutput2(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genReadBinaryOutput3(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genWriteBinaryOutput1(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, uint16_t asyncMode, uint16_t rateDivisor, uint16_t commonField, uint16_t timeField, uint16_t imuField, uint16_t gpsField, uint16_t attitudeField, uint16_t insField);
static size_t genWriteBinaryOutput2(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, uint16_t asyncMode, uint16_t rateDivisor, uint16_t commonField, uint16_t timeField, uint16_t imuField, uint16_t gpsField, uint16_t attitudeField, uint16_t insField);
static size_t genWriteBinaryOutput3(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, uint16_t asyncMode, uint16_t rateDivisor, uint16_t commonField, uint16_t timeField, uint16_t imuField, uint16_t gpsField, uint16_t attitudeField, uint16_t insField);
static size_t genWriteSettings(ErrorDetectionMode errorDetectionMode, char *buffer, size_t size);
static size_t genTare(ErrorDetectionMode errorDetectionMode, char *buffer, size_t size);
static size_t genKnownMagneticDisturbance(ErrorDetectionMode errorDetectionMode, char *buffer, size_t size, bool isMagneticDisturbancePresent);
static size_t genKnownAccelerationDisturbance(ErrorDetectionMode errorDetectionMode, char *buffer, size_t size, bool isAccelerationDisturbancePresent);
static size_t genSetGyroBias(ErrorDetectionMode errorDetectionMode, char *buffer, size_t size);
static size_t genRestoreFactorySettings(ErrorDetectionMode errorDetectionMode, char *buffer, size_t size);
static size_t genReset(ErrorDetectionMode errorDetectionMode, char *buffer, size_t size);
static size_t genReadSerialBaudRate(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, uint8_t port);
static size_t genWriteSerialBaudRate(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, uint32_t baudrate, uint8_t port);
static size_t genReadAsyncDataOutputType(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, uint8_t port);
static size_t genWriteAsyncDataOutputType(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, uint32_t ador, uint8_t port);
static size_t genReadAsyncDataOutputFrequency(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, uint8_t port);
static size_t genWriteAsyncDataOutputFrequency(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, uint32_t adof, uint8_t port);
static size_t genReadUserTag(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genWriteUserTag(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, std::string tag);
static size_t genReadModelNumber(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genReadHardwareRevision(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genReadSerialNumber(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genReadFirmwareVersion(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genReadSerialBaudRate(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genWriteSerialBaudRate(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, uint32_t baudrate);
static size_t genReadAsyncDataOutputType(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genWriteAsyncDataOutputType(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, uint32_t ador);
static size_t genReadAsyncDataOutputFrequency(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genWriteAsyncDataOutputFrequency(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, uint32_t adof);
static size_t genReadYawPitchRoll(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genReadAttitudeQuaternion(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genReadQuaternionMagneticAccelerationAndAngularRates(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genReadMagneticMeasurements(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genReadAccelerationMeasurements(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genReadAngularRateMeasurements(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genReadMagneticAccelerationAndAngularRates(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genReadMagneticAndGravityReferenceVectors(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genWriteMagneticAndGravityReferenceVectors(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, vn::math::vec3f magRef, vn::math::vec3f accRef);
static size_t genReadFilterMeasurementsVarianceParameters(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genWriteFilterMeasurementsVarianceParameters(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, float angularWalkVariance, vn::math::vec3f angularRateVariance, vn::math::vec3f magneticVariance, vn::math::vec3f accelerationVariance);
static size_t genReadMagnetometerCompensation(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genWriteMagnetometerCompensation(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, vn::math::mat3f c, vn::math::vec3f b);
static size_t genReadFilterActiveTuningParameters(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genWriteFilterActiveTuningParameters(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, float magneticDisturbanceGain, float accelerationDisturbanceGain, float magneticDisturbanceMemory, float accelerationDisturbanceMemory);
static size_t genReadAccelerationCompensation(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genWriteAccelerationCompensation(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, vn::math::mat3f c, vn::math::vec3f b);
static size_t genReadReferenceFrameRotation(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genWriteReferenceFrameRotation(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, vn::math::mat3f c);
static size_t genReadYawPitchRollMagneticAccelerationAndAngularRates(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genReadCommunicationProtocolControl(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genWriteCommunicationProtocolControl(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, uint8_t serialCount, uint8_t serialStatus, uint8_t spiCount, uint8_t spiStatus, uint8_t serialChecksum, uint8_t spiChecksum, uint8_t errorMode);
static size_t genReadSynchronizationControl(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genWriteSynchronizationControl(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, uint8_t syncInMode, uint8_t syncInEdge, uint16_t syncInSkipFactor, uint8_t syncOutMode, uint8_t syncOutPolarity, uint16_t syncOutSkipFactor, uint32_t syncOutPulseWidth);
static size_t genReadSynchronizationStatus(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genWriteSynchronizationStatus(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, uint32_t syncInCount, uint32_t syncInTime, uint32_t syncOutCount);
static size_t genReadFilterBasicControl(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genWriteFilterBasicControl(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, uint8_t magMode, uint8_t extMagMode, uint8_t extAccMode, uint8_t extGyroMode, vn::math::vec3f gyroLimit);
static size_t genReadVpeBasicControl(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genWriteVpeBasicControl(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, uint8_t enable, uint8_t headingMode, uint8_t filteringMode, uint8_t tuningMode);
static size_t genReadVpeMagnetometerBasicTuning(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genWriteVpeMagnetometerBasicTuning(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, vn::math::vec3f baseTuning, vn::math::vec3f adaptiveTuning, vn::math::vec3f adaptiveFiltering);
static size_t genReadVpeMagnetometerAdvancedTuning(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genWriteVpeMagnetometerAdvancedTuning(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, vn::math::vec3f minFiltering, vn::math::vec3f maxFiltering, float maxAdaptRate, float disturbanceWindow, float maxTuning);
static size_t genReadVpeAccelerometerBasicTuning(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genWriteVpeAccelerometerBasicTuning(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, vn::math::vec3f baseTuning, vn::math::vec3f adaptiveTuning, vn::math::vec3f adaptiveFiltering);
static size_t genReadVpeAccelerometerAdvancedTuning(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genWriteVpeAccelerometerAdvancedTuning(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, vn::math::vec3f minFiltering, vn::math::vec3f maxFiltering, float maxAdaptRate, float disturbanceWindow, float maxTuning);
static size_t genReadVpeGyroBasicTuning(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genWriteVpeGyroBasicTuning(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, vn::math::vec3f angularWalkVariance, vn::math::vec3f baseTuning, vn::math::vec3f adaptiveTuning);
static size_t genReadFilterStartupGyroBias(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genWriteFilterStartupGyroBias(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, vn::math::vec3f bias);
static size_t genReadMagnetometerCalibrationControl(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genWriteMagnetometerCalibrationControl(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, uint8_t hsiMode, uint8_t hsiOutput, uint8_t convergeRate);
static size_t genReadCalculatedMagnetometerCalibration(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genReadIndoorHeadingModeControl(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genWriteIndoorHeadingModeControl(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, float maxRateError);
static size_t genReadVelocityCompensationMeasurement(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genWriteVelocityCompensationMeasurement(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, vn::math::vec3f velocity);
static size_t genReadVelocityCompensationControl(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genWriteVelocityCompensationControl(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, uint8_t mode, float velocityTuning, float rateTuning);
static size_t genReadVelocityCompensationStatus(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genReadImuMeasurements(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genReadGpsConfiguration(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genWriteGpsConfiguration(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, uint8_t mode, uint8_t ppsSource);
static size_t genReadGpsAntennaOffset(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genWriteGpsAntennaOffset(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, vn::math::vec3f position);
static size_t genReadGpsSolutionLla(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genReadGpsSolutionEcef(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genReadInsSolutionLla(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genReadInsSolutionEcef(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genReadInsBasicConfiguration(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genWriteInsBasicConfiguration(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, uint8_t scenario, uint8_t ahrsAiding, uint8_t estBaseline);
static size_t genReadInsAdvancedConfiguration(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genWriteInsAdvancedConfiguration(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, uint8_t useMag, uint8_t usePres, uint8_t posAtt, uint8_t velAtt, uint8_t velBias, uint8_t useFoam, uint8_t gpsCovType, uint8_t velCount, float velInit, float moveOrigin, float gpsTimeout, float deltaLimitPos, float deltaLimitVel, float minPosUncertainty, float minVelUncertainty);
static size_t genReadInsStateLla(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genReadInsStateEcef(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genReadStartupFilterBiasEstimate(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genWriteStartupFilterBiasEstimate(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, vn::math::vec3f gyroBias, vn::math::vec3f accelBias, float pressureBias);
static size_t genReadDeltaThetaAndDeltaVelocity(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genReadDeltaThetaAndDeltaVelocityConfiguration(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genWriteDeltaThetaAndDeltaVelocityConfiguration(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, uint8_t integrationFrame, uint8_t gyroCompensation, uint8_t accelCompensation);
static size_t genReadReferenceVectorConfiguration(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genWriteReferenceVectorConfiguration(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, uint8_t useMagModel, uint8_t useGravityModel, uint32_t recalcThreshold, float year, vn::math::vec3d position);
static size_t genReadGyroCompensation(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genWriteGyroCompensation(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, vn::math::mat3f c, vn::math::vec3f b);
static size_t genReadImuFilteringConfiguration(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genWriteImuFilteringConfiguration(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, uint16_t magWindowSize, uint16_t accelWindowSize, uint16_t gyroWindowSize, uint16_t tempWindowSize, uint16_t presWindowSize, uint8_t magFilterMode, uint8_t accelFilterMode, uint8_t gyroFilterMode, uint8_t tempFilterMode, uint8_t presFilterMode);
static size_t genReadGpsCompassBaseline(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genWriteGpsCompassBaseline(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, vn::math::vec3f position, vn::math::vec3f uncertainty);
static size_t genReadGpsCompassEstimatedBaseline(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genReadImuRateConfiguration(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genWriteImuRateConfiguration(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, uint16_t imuRate, uint16_t navDivisor, float filterTargetRate, float filterMinRate);
static size_t genReadYawPitchRollTrueBodyAccelerationAndAngularRates(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
static size_t genReadYawPitchRollTrueInertialAccelerationAndAngularRates(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
void parseVNYPR(vn::math::vec3f *yawPitchRoll);
void parseVNQTN(vn::math::vec4f *quaternion);
#ifdef INTERNAL
void parseVNQTM(math::vec4f *quaternion, math::vec3f *magnetic);
void parseVNQTA(math::vec4f *quaternion, math::vec3f *acceleration);
void parseVNQTR(math::vec4f *quaternion, math::vec3f *angularRate);
void parseVNQMA(math::vec4f *quaternion, math::vec3f *magnetic, math::vec3f *acceleration);
void parseVNQAR(math::vec4f *quaternion, math::vec3f *acceleration, math::vec3f *angularRate);
#endif
void parseVNQMR(vn::math::vec4f *quaternion, vn::math::vec3f *magnetic, vn::math::vec3f *acceleration, vn::math::vec3f *angularRate);
#ifdef INTERNAL
void parseVNDCM(math::mat3f *dcm);
#endif
void parseVNMAG(vn::math::vec3f *magnetic);
void parseVNACC(vn::math::vec3f *acceleration);
void parseVNGYR(vn::math::vec3f *angularRate);
void parseVNMAR(vn::math::vec3f *magnetic, vn::math::vec3f *acceleration, vn::math::vec3f *angularRate);
void parseVNYMR(vn::math::vec3f *yawPitchRoll, vn::math::vec3f *magnetic, vn::math::vec3f *acceleration, vn::math::vec3f *angularRate);
#ifdef INTERNAL
void parseVNYCM(math::vec3f *yawPitchRoll, math::vec3f *magnetic, math::vec3f *acceleration, math::vec3f *angularRate, float *temperature);
#endif
void parseVNYBA(vn::math::vec3f *yawPitchRoll, vn::math::vec3f *accelerationBody, vn::math::vec3f *angularRate);
void parseVNYIA(vn::math::vec3f *yawPitchRoll, vn::math::vec3f *accelerationInertial, vn::math::vec3f *angularRate);
#ifdef INTERNAL
void parseVNICM(math::vec3f *yawPitchRoll, math::vec3f *magnetic, math::vec3f *accelerationInertial, math::vec3f *angularRate);
#endif
void parseVNIMU(vn::math::vec3f *magneticUncompensated, vn::math::vec3f *accelerationUncompensated, vn::math::vec3f *angularRateUncompensated, float *temperature, float *pressure);
void parseVNGPS(double *time, uint16_t *week, uint8_t *gpsFix, uint8_t *numSats, vn::math::vec3d *lla, vn::math::vec3f *nedVel, vn::math::vec3f *nedAcc, float *speedAcc, float *timeAcc);
void parseVNINS(double *time, uint16_t *week, uint16_t *status, vn::math::vec3f *yawPitchRoll, vn::math::vec3d *lla, vn::math::vec3f *nedVel, float *attUncertainty, float *posUncertainty, float *velUncertainty);
void parseVNINE(double *time, uint16_t *week, uint16_t *status, vn::math::vec3f *ypr, vn::math::vec3d *position, vn::math::vec3f *velocity, float *attUncertainty, float *posUncertainty, float *velUncertainty);
void parseVNISL(vn::math::vec3f* ypr, vn::math::vec3d* lla, vn::math::vec3f* velocity, vn::math::vec3f* acceleration, vn::math::vec3f* angularRate);
void parseVNISE(vn::math::vec3f* ypr, vn::math::vec3d* position, vn::math::vec3f* velocity, vn::math::vec3f* acceleration, vn::math::vec3f* angularRate);
#ifdef INTERNAL
void parseVNRAW(math::vec3f *magneticVoltage, math::vec3f *accelerationVoltage, math::vec3f *angularRateVoltage, float *temperatureVoltage);
void parseVNCMV(math::vec3f *magneticUncompensated, math::vec3f *accelerationUncompensated, math::vec3f *angularRateUncompensated, float *temperature);
void parseVNSTV(math::vec4f *quaternion, math::vec3f *angularRateBias);
void parseVNCOV(math::vec3f *attitudeVariance, math::vec3f *angularRateBiasVariance);
#endif
void parseVNGPE(double *tow, uint16_t *week, uint8_t *gpsFix, uint8_t *numSats, vn::math::vec3d *position, vn::math::vec3f *velocity, vn::math::vec3f *posAcc, float *speedAcc, float *timeAcc);
void parseVNDTV(float *deltaTime, vn::math::vec3f *deltaTheta, vn::math::vec3f *deltaVelocity);
void parseBinaryOutput(
uint16_t* asyncMode,
uint16_t* rateDivisor,
uint16_t* outputGroup,
uint16_t* commonField,
uint16_t* timeField,
uint16_t* imuField,
uint16_t* gpsField,
uint16_t* attitudeField,
uint16_t* insField);
void parseUserTag(char* tag);
void parseModelNumber(char* productName);
void parseHardwareRevision(uint32_t* revision);
void parseSerialNumber(uint32_t* serialNum);
void parseFirmwareVersion(char* firmwareVersion);
void parseSerialBaudRate(uint32_t* baudrate);
void parseAsyncDataOutputType(uint32_t* ador);
void parseAsyncDataOutputFrequency(uint32_t* adof);
void parseYawPitchRoll(vn::math::vec3f* yawPitchRoll);
void parseAttitudeQuaternion(vn::math::vec4f* quat);
void parseQuaternionMagneticAccelerationAndAngularRates(vn::math::vec4f* quat, vn::math::vec3f* mag, vn::math::vec3f* accel, vn::math::vec3f* gyro);
void parseMagneticMeasurements(vn::math::vec3f* mag);
void parseAccelerationMeasurements(vn::math::vec3f* accel);
void parseAngularRateMeasurements(vn::math::vec3f* gyro);
void parseMagneticAccelerationAndAngularRates(vn::math::vec3f* mag, vn::math::vec3f* accel, vn::math::vec3f* gyro);
void parseMagneticAndGravityReferenceVectors(vn::math::vec3f* magRef, vn::math::vec3f* accRef);
void parseFilterMeasurementsVarianceParameters(float* angularWalkVariance, vn::math::vec3f* angularRateVariance, vn::math::vec3f* magneticVariance, vn::math::vec3f* accelerationVariance);
void parseMagnetometerCompensation(vn::math::mat3f* c, vn::math::vec3f* b);
void parseFilterActiveTuningParameters(float* magneticDisturbanceGain, float* accelerationDisturbanceGain, float* magneticDisturbanceMemory, float* accelerationDisturbanceMemory);
void parseAccelerationCompensation(vn::math::mat3f* c, vn::math::vec3f* b);
void parseReferenceFrameRotation(vn::math::mat3f* c);
void parseYawPitchRollMagneticAccelerationAndAngularRates(vn::math::vec3f* yawPitchRoll, vn::math::vec3f* mag, vn::math::vec3f* accel, vn::math::vec3f* gyro);
void parseCommunicationProtocolControl(uint8_t* serialCount, uint8_t* serialStatus, uint8_t* spiCount, uint8_t* spiStatus, uint8_t* serialChecksum, uint8_t* spiChecksum, uint8_t* errorMode);
void parseSynchronizationControl(uint8_t* syncInMode, uint8_t* syncInEdge, uint16_t* syncInSkipFactor, uint8_t* syncOutMode, uint8_t* syncOutPolarity, uint16_t* syncOutSkipFactor, uint32_t* syncOutPulseWidth);
void parseSynchronizationStatus(uint32_t* syncInCount, uint32_t* syncInTime, uint32_t* syncOutCount);
void parseFilterBasicControl(uint8_t* magMode, uint8_t* extMagMode, uint8_t* extAccMode, uint8_t* extGyroMode, vn::math::vec3f* gyroLimit);
void parseVpeBasicControl(uint8_t* enable, uint8_t* headingMode, uint8_t* filteringMode, uint8_t* tuningMode);
void parseVpeMagnetometerBasicTuning(vn::math::vec3f* baseTuning, vn::math::vec3f* adaptiveTuning, vn::math::vec3f* adaptiveFiltering);
void parseVpeMagnetometerAdvancedTuning(vn::math::vec3f* minFiltering, vn::math::vec3f* maxFiltering, float* maxAdaptRate, float* disturbanceWindow, float* maxTuning);
void parseVpeAccelerometerBasicTuning(vn::math::vec3f* baseTuning, vn::math::vec3f* adaptiveTuning, vn::math::vec3f* adaptiveFiltering);
void parseVpeAccelerometerAdvancedTuning(vn::math::vec3f* minFiltering, vn::math::vec3f* maxFiltering, float* maxAdaptRate, float* disturbanceWindow, float* maxTuning);
void parseVpeGyroBasicTuning(vn::math::vec3f* angularWalkVariance, vn::math::vec3f* baseTuning, vn::math::vec3f* adaptiveTuning);
void parseFilterStartupGyroBias(vn::math::vec3f* bias);
void parseMagnetometerCalibrationControl(uint8_t* hsiMode, uint8_t* hsiOutput, uint8_t* convergeRate);
void parseCalculatedMagnetometerCalibration(vn::math::mat3f* c, vn::math::vec3f* b);
void parseIndoorHeadingModeControl(float* maxRateError);
void parseVelocityCompensationMeasurement(vn::math::vec3f* velocity);
void parseVelocityCompensationControl(uint8_t* mode, float* velocityTuning, float* rateTuning);
void parseVelocityCompensationStatus(float* x, float* xDot, vn::math::vec3f* accelOffset, vn::math::vec3f* omega);
void parseImuMeasurements(vn::math::vec3f* mag, vn::math::vec3f* accel, vn::math::vec3f* gyro, float* temp, float* pressure);
void parseGpsConfiguration(uint8_t* mode, uint8_t* ppsSource);
void parseGpsAntennaOffset(vn::math::vec3f* position);
void parseGpsSolutionLla(double* time, uint16_t* week, uint8_t* gpsFix, uint8_t* numSats, vn::math::vec3d* lla, vn::math::vec3f* nedVel, vn::math::vec3f* nedAcc, float* speedAcc, float* timeAcc);
void parseGpsSolutionEcef(double* tow, uint16_t* week, uint8_t* gpsFix, uint8_t* numSats, vn::math::vec3d* position, vn::math::vec3f* velocity, vn::math::vec3f* posAcc, float* speedAcc, float* timeAcc);
void parseInsSolutionLla(double* time, uint16_t* week, uint16_t* status, vn::math::vec3f* yawPitchRoll, vn::math::vec3d* position, vn::math::vec3f* nedVel, float* attUncertainty, float* posUncertainty, float* velUncertainty);
void parseInsSolutionEcef(double* time, uint16_t* week, uint16_t* status, vn::math::vec3f* yawPitchRoll, vn::math::vec3d* position, vn::math::vec3f* velocity, float* attUncertainty, float* posUncertainty, float* velUncertainty);
void parseInsBasicConfiguration(uint8_t* scenario, uint8_t* ahrsAiding);
void parseInsBasicConfiguration(uint8_t* scenario, uint8_t* ahrsAiding, uint8_t* estBaseline);
void parseInsAdvancedConfiguration(uint8_t* useMag, uint8_t* usePres, uint8_t* posAtt, uint8_t* velAtt, uint8_t* velBias, uint8_t* useFoam, uint8_t* gpsCovType, uint8_t* velCount, float* velInit, float* moveOrigin, float* gpsTimeout, float* deltaLimitPos, float* deltaLimitVel, float* minPosUncertainty, float* minVelUncertainty);
void parseInsStateLla(vn::math::vec3f* yawPitchRoll, vn::math::vec3d* position, vn::math::vec3f* velocity, vn::math::vec3f* accel, vn::math::vec3f* angularRate);
void parseInsStateEcef(vn::math::vec3f* yawPitchRoll, vn::math::vec3d* position, vn::math::vec3f* velocity, vn::math::vec3f* accel, vn::math::vec3f* angularRate);
void parseStartupFilterBiasEstimate(vn::math::vec3f* gyroBias, vn::math::vec3f* accelBias, float* pressureBias);
void parseDeltaThetaAndDeltaVelocity(float* deltaTime, vn::math::vec3f* deltaTheta, vn::math::vec3f* deltaVelocity);
void parseDeltaThetaAndDeltaVelocityConfiguration(uint8_t* integrationFrame, uint8_t* gyroCompensation, uint8_t* accelCompensation);
void parseReferenceVectorConfiguration(uint8_t* useMagModel, uint8_t* useGravityModel, uint32_t* recalcThreshold, float* year, vn::math::vec3d* position);
void parseGyroCompensation(vn::math::mat3f* c, vn::math::vec3f* b);
void parseImuFilteringConfiguration(uint16_t* magWindowSize, uint16_t* accelWindowSize, uint16_t* gyroWindowSize, uint16_t* tempWindowSize, uint16_t* presWindowSize, uint8_t* magFilterMode, uint8_t* accelFilterMode, uint8_t* gyroFilterMode, uint8_t* tempFilterMode, uint8_t* presFilterMode);
void parseGpsCompassBaseline(vn::math::vec3f* position, vn::math::vec3f* uncertainty);
void parseGpsCompassEstimatedBaseline(uint8_t* estBaselineUsed, uint16_t* numMeas, vn::math::vec3f* position, vn::math::vec3f* uncertainty);
void parseImuRateConfiguration(uint16_t* imuRate, uint16_t* navDivisor, float* filterTargetRate, float* filterMinRate);
void parseYawPitchRollTrueBodyAccelerationAndAngularRates(vn::math::vec3f* yawPitchRoll, vn::math::vec3f* bodyAccel, vn::math::vec3f* gyro);
void parseYawPitchRollTrueInertialAccelerationAndAngularRates(vn::math::vec3f* yawPitchRoll, vn::math::vec3f* inertialAccel, vn::math::vec3f* gyro);
private:
void ensureCanExtract(size_t numOfBytes);
bool _isPacketDataMine;
size_t _length;
char *_data;
size_t _curExtractLoc;
};
}
}
}
#endif
vn::math::vec
Template for a Euclidean vector.
Definition: vector.h:22
int.h
nocopy.h
vn::math::mat
Template for a matrix.
Definition: matrix.h:20
matrix.h
vn::protocol::uart::Packet::TYPE_UNKNOWN
Type is unknown.
Definition: packet.h:24
vector.h
vn::protocol::uart::Packet::Type
Type
The different types of UART packets.
Definition: packet.h:22
vn
Definition: attitude.h:8
vn::protocol::uart::Packet::TYPE_BINARY
Binary packet.
Definition: packet.h:25
vn::protocol::uart::Packet
Structure representing a UART packet received from the VectorNav sensor.
Definition: packet.h:16