VectorNav C++ Library
packet.h
1 #ifndef _VNPROTOCOL_UART_PACKET_H_
2 #define _VNPROTOCOL_UART_PACKET_H_
3 
4 #include "int.h"
5 #include "vector.h"
6 #include "matrix.h"
7 #include "nocopy.h"
8 #include "types.h"
9 
10 namespace vn {
11 namespace protocol {
12 namespace uart {
13 
16 struct vn_proglib_DLLEXPORT Packet
17 {
19  static const unsigned char BinaryGroupLengths[sizeof(uint8_t)*8][sizeof(uint16_t)*8];
20 
22  enum Type
23  {
26  TYPE_ASCII
27  };
28 
29  Packet();
30 
36  Packet(char const* packet, size_t length);
37 
38  explicit Packet(std::string packet);
39 
43  Packet(const Packet &toCopy);
44 
45  ~Packet();
46 
51  Packet& operator=(const Packet &from);
52 
56  std::string datastr();
57 
61  Type type();
62 
70  bool isValid();
71 
76  bool isError();
77 
83  bool isResponse();
84 
89  bool isAsciiAsync();
90 
95  AsciiAsync determineAsciiAsyncType();
96 
108  bool isCompatible(CommonGroup commonGroup, TimeGroup timeGroup, ImuGroup imuGroup, GpsGroup gpsGroup, AttitudeGroup attitudeGroup, InsGroup insGroup);
109 
120  static size_t computeBinaryPacketLength(const char *startOfPossibleBinaryPacket);
121 
127  static size_t computeNumOfBytesForBinaryGroupPayload(BinaryGroup group, uint16_t groupField);
128 
132  SensorError parseError();
133 
136  uint8_t groups();
137 
143  uint16_t groupField(size_t index);
144 
150 
155  uint8_t extractUint8();
156 
161  int8_t extractInt8();
162 
167  uint16_t extractUint16();
168 
173  uint32_t extractUint32();
174 
179  uint64_t extractUint64();
180 
185  float extractFloat();
186 
191  vn::math::vec3f extractVec3f();
192 
197  vn::math::vec3d extractVec3d();
198 
203  vn::math::vec4f extractVec4f();
204 
209  vn::math::mat3f extractMat3f();
210 
212 
221  static size_t finalizeCommand(ErrorDetectionMode errorDetectionMode, char *packet, size_t length);
222 
228 
235  static size_t genReadBinaryOutput1(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
236 
243  static size_t genReadBinaryOutput2(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
244 
251  static size_t genReadBinaryOutput3(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
252 
253 
272  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);
273 
292  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);
293 
312  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);
313 
314 
321  static size_t genWriteSettings(ErrorDetectionMode errorDetectionMode, char *buffer, size_t size);
322 
329  static size_t genTare(ErrorDetectionMode errorDetectionMode, char *buffer, size_t size);
330 
338  static size_t genKnownMagneticDisturbance(ErrorDetectionMode errorDetectionMode, char *buffer, size_t size, bool isMagneticDisturbancePresent);
339 
347  static size_t genKnownAccelerationDisturbance(ErrorDetectionMode errorDetectionMode, char *buffer, size_t size, bool isAccelerationDisturbancePresent);
348 
355  static size_t genSetGyroBias(ErrorDetectionMode errorDetectionMode, char *buffer, size_t size);
356 
363  static size_t genRestoreFactorySettings(ErrorDetectionMode errorDetectionMode, char *buffer, size_t size);
364 
371  static size_t genReset(ErrorDetectionMode errorDetectionMode, char *buffer, size_t size);
372 
380  static size_t genReadSerialBaudRate(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, uint8_t port);
381 
390  static size_t genWriteSerialBaudRate(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, uint32_t baudrate, uint8_t port);
391 
399  static size_t genReadAsyncDataOutputType(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, uint8_t port);
400 
409  static size_t genWriteAsyncDataOutputType(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, uint32_t ador, uint8_t port);
410 
418  static size_t genReadAsyncDataOutputFrequency(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, uint8_t port);
419 
428  static size_t genWriteAsyncDataOutputFrequency(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, uint32_t adof, uint8_t port);
429 
436  static size_t genReadUserTag(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
437 
445  static size_t genWriteUserTag(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, std::string tag);
446 
453  static size_t genReadModelNumber(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
454 
461  static size_t genReadHardwareRevision(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
462 
469  static size_t genReadSerialNumber(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
470 
477  static size_t genReadFirmwareVersion(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
478 
485  static size_t genReadSerialBaudRate(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
486 
494  static size_t genWriteSerialBaudRate(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, uint32_t baudrate);
495 
502  static size_t genReadAsyncDataOutputType(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
503 
511  static size_t genWriteAsyncDataOutputType(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, uint32_t ador);
512 
519  static size_t genReadAsyncDataOutputFrequency(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
520 
528  static size_t genWriteAsyncDataOutputFrequency(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, uint32_t adof);
529 
536  static size_t genReadYawPitchRoll(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
537 
544  static size_t genReadAttitudeQuaternion(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
545 
552  static size_t genReadQuaternionMagneticAccelerationAndAngularRates(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
553 
560  static size_t genReadMagneticMeasurements(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
561 
568  static size_t genReadAccelerationMeasurements(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
569 
576  static size_t genReadAngularRateMeasurements(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
577 
584  static size_t genReadMagneticAccelerationAndAngularRates(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
585 
592  static size_t genReadMagneticAndGravityReferenceVectors(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
593 
602  static size_t genWriteMagneticAndGravityReferenceVectors(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, vn::math::vec3f magRef, vn::math::vec3f accRef);
603 
610  static size_t genReadFilterMeasurementsVarianceParameters(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
611 
622  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);
623 
630  static size_t genReadMagnetometerCompensation(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
631 
640  static size_t genWriteMagnetometerCompensation(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, vn::math::mat3f c, vn::math::vec3f b);
641 
648  static size_t genReadFilterActiveTuningParameters(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
649 
660  static size_t genWriteFilterActiveTuningParameters(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, float magneticDisturbanceGain, float accelerationDisturbanceGain, float magneticDisturbanceMemory, float accelerationDisturbanceMemory);
661 
668  static size_t genReadAccelerationCompensation(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
669 
678  static size_t genWriteAccelerationCompensation(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, vn::math::mat3f c, vn::math::vec3f b);
679 
686  static size_t genReadReferenceFrameRotation(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
687 
695  static size_t genWriteReferenceFrameRotation(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, vn::math::mat3f c);
696 
703  static size_t genReadYawPitchRollMagneticAccelerationAndAngularRates(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
704 
711  static size_t genReadCommunicationProtocolControl(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
712 
726  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);
727 
734  static size_t genReadSynchronizationControl(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
735 
749  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);
750 
757  static size_t genReadSynchronizationStatus(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
758 
768  static size_t genWriteSynchronizationStatus(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, uint32_t syncInCount, uint32_t syncInTime, uint32_t syncOutCount);
769 
776  static size_t genReadFilterBasicControl(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
777 
789  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);
790 
797  static size_t genReadVpeBasicControl(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
798 
809  static size_t genWriteVpeBasicControl(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, uint8_t enable, uint8_t headingMode, uint8_t filteringMode, uint8_t tuningMode);
810 
817  static size_t genReadVpeMagnetometerBasicTuning(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
818 
828  static size_t genWriteVpeMagnetometerBasicTuning(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, vn::math::vec3f baseTuning, vn::math::vec3f adaptiveTuning, vn::math::vec3f adaptiveFiltering);
829 
836  static size_t genReadVpeMagnetometerAdvancedTuning(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
837 
849  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);
850 
857  static size_t genReadVpeAccelerometerBasicTuning(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
858 
868  static size_t genWriteVpeAccelerometerBasicTuning(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, vn::math::vec3f baseTuning, vn::math::vec3f adaptiveTuning, vn::math::vec3f adaptiveFiltering);
869 
876  static size_t genReadVpeAccelerometerAdvancedTuning(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
877 
889  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);
890 
897  static size_t genReadVpeGyroBasicTuning(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
898 
908  static size_t genWriteVpeGyroBasicTuning(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, vn::math::vec3f angularWalkVariance, vn::math::vec3f baseTuning, vn::math::vec3f adaptiveTuning);
909 
916  static size_t genReadFilterStartupGyroBias(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
917 
925  static size_t genWriteFilterStartupGyroBias(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, vn::math::vec3f bias);
926 
933  static size_t genReadMagnetometerCalibrationControl(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
934 
944  static size_t genWriteMagnetometerCalibrationControl(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, uint8_t hsiMode, uint8_t hsiOutput, uint8_t convergeRate);
945 
952  static size_t genReadCalculatedMagnetometerCalibration(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
953 
960  static size_t genReadIndoorHeadingModeControl(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
961 
969  static size_t genWriteIndoorHeadingModeControl(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, float maxRateError);
970 
977  static size_t genReadVelocityCompensationMeasurement(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
978 
986  static size_t genWriteVelocityCompensationMeasurement(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, vn::math::vec3f velocity);
987 
994  static size_t genReadVelocityCompensationControl(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
995 
1005  static size_t genWriteVelocityCompensationControl(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, uint8_t mode, float velocityTuning, float rateTuning);
1006 
1013  static size_t genReadVelocityCompensationStatus(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
1014 
1021  static size_t genReadImuMeasurements(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
1022 
1029  static size_t genReadGpsConfiguration(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
1030 
1039  static size_t genWriteGpsConfiguration(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, uint8_t mode, uint8_t ppsSource);
1040 
1047  static size_t genReadGpsAntennaOffset(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
1048 
1056  static size_t genWriteGpsAntennaOffset(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, vn::math::vec3f position);
1057 
1064  static size_t genReadGpsSolutionLla(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
1065 
1072  static size_t genReadGpsSolutionEcef(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
1073 
1080  static size_t genReadInsSolutionLla(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
1081 
1088  static size_t genReadInsSolutionEcef(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
1089 
1096  static size_t genReadInsBasicConfiguration(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
1097 
1107  static size_t genWriteInsBasicConfiguration(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, uint8_t scenario, uint8_t ahrsAiding, uint8_t estBaseline);
1108 
1115  static size_t genReadInsAdvancedConfiguration(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
1116 
1138  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);
1139 
1146  static size_t genReadInsStateLla(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
1147 
1154  static size_t genReadInsStateEcef(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
1155 
1162  static size_t genReadStartupFilterBiasEstimate(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
1163 
1173  static size_t genWriteStartupFilterBiasEstimate(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, vn::math::vec3f gyroBias, vn::math::vec3f accelBias, float pressureBias);
1174 
1181  static size_t genReadDeltaThetaAndDeltaVelocity(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
1182 
1189  static size_t genReadDeltaThetaAndDeltaVelocityConfiguration(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
1190 
1200  static size_t genWriteDeltaThetaAndDeltaVelocityConfiguration(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, uint8_t integrationFrame, uint8_t gyroCompensation, uint8_t accelCompensation);
1201 
1208  static size_t genReadReferenceVectorConfiguration(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
1209 
1221  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);
1222 
1229  static size_t genReadGyroCompensation(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
1230 
1239  static size_t genWriteGyroCompensation(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, vn::math::mat3f c, vn::math::vec3f b);
1240 
1247  static size_t genReadImuFilteringConfiguration(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
1248 
1265  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);
1266 
1273  static size_t genReadGpsCompassBaseline(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
1274 
1283  static size_t genWriteGpsCompassBaseline(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, vn::math::vec3f position, vn::math::vec3f uncertainty);
1284 
1291  static size_t genReadGpsCompassEstimatedBaseline(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
1292 
1299  static size_t genReadImuRateConfiguration(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
1300 
1311  static size_t genWriteImuRateConfiguration(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size, uint16_t imuRate, uint16_t navDivisor, float filterTargetRate, float filterMinRate);
1312 
1319  static size_t genReadYawPitchRollTrueBodyAccelerationAndAngularRates(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
1320 
1327  static size_t genReadYawPitchRollTrueInertialAccelerationAndAngularRates(ErrorDetectionMode errorDetectionMode, char* buffer, size_t size);
1328 
1330 
1341 
1345  void parseVNYPR(vn::math::vec3f *yawPitchRoll);
1346 
1350  void parseVNQTN(vn::math::vec4f *quaternion);
1351 
1352  #ifdef INTERNAL
1353 
1358  void parseVNQTM(math::vec4f *quaternion, math::vec3f *magnetic);
1359 
1364  void parseVNQTA(math::vec4f *quaternion, math::vec3f *acceleration);
1365 
1370  void parseVNQTR(math::vec4f *quaternion, math::vec3f *angularRate);
1371 
1377  void parseVNQMA(math::vec4f *quaternion, math::vec3f *magnetic, math::vec3f *acceleration);
1378 
1384  void parseVNQAR(math::vec4f *quaternion, math::vec3f *acceleration, math::vec3f *angularRate);
1385 
1386  #endif
1387 
1394  void parseVNQMR(vn::math::vec4f *quaternion, vn::math::vec3f *magnetic, vn::math::vec3f *acceleration, vn::math::vec3f *angularRate);
1395 
1396  #ifdef INTERNAL
1397 
1401  void parseVNDCM(math::mat3f *dcm);
1402 
1403  #endif
1404 
1408  void parseVNMAG(vn::math::vec3f *magnetic);
1409 
1413  void parseVNACC(vn::math::vec3f *acceleration);
1414 
1418  void parseVNGYR(vn::math::vec3f *angularRate);
1419 
1425  void parseVNMAR(vn::math::vec3f *magnetic, vn::math::vec3f *acceleration, vn::math::vec3f *angularRate);
1426 
1433  void parseVNYMR(vn::math::vec3f *yawPitchRoll, vn::math::vec3f *magnetic, vn::math::vec3f *acceleration, vn::math::vec3f *angularRate);
1434 
1435  #ifdef INTERNAL
1436 
1444  void parseVNYCM(math::vec3f *yawPitchRoll, math::vec3f *magnetic, math::vec3f *acceleration, math::vec3f *angularRate, float *temperature);
1445 
1446  #endif
1447 
1453  void parseVNYBA(vn::math::vec3f *yawPitchRoll, vn::math::vec3f *accelerationBody, vn::math::vec3f *angularRate);
1454 
1460  void parseVNYIA(vn::math::vec3f *yawPitchRoll, vn::math::vec3f *accelerationInertial, vn::math::vec3f *angularRate);
1461 
1462  #ifdef INTERNAL
1463 
1470  void parseVNICM(math::vec3f *yawPitchRoll, math::vec3f *magnetic, math::vec3f *accelerationInertial, math::vec3f *angularRate);
1471 
1472  #endif
1473 
1481  void parseVNIMU(vn::math::vec3f *magneticUncompensated, vn::math::vec3f *accelerationUncompensated, vn::math::vec3f *angularRateUncompensated, float *temperature, float *pressure);
1482 
1494  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);
1495 
1507  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);
1508 
1520  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);
1521 
1529  void parseVNISL(vn::math::vec3f* ypr, vn::math::vec3d* lla, vn::math::vec3f* velocity, vn::math::vec3f* acceleration, vn::math::vec3f* angularRate);
1530 
1538  void parseVNISE(vn::math::vec3f* ypr, vn::math::vec3d* position, vn::math::vec3f* velocity, vn::math::vec3f* acceleration, vn::math::vec3f* angularRate);
1539 
1540  #ifdef INTERNAL
1541 
1548  void parseVNRAW(math::vec3f *magneticVoltage, math::vec3f *accelerationVoltage, math::vec3f *angularRateVoltage, float *temperatureVoltage);
1549 
1556  void parseVNCMV(math::vec3f *magneticUncompensated, math::vec3f *accelerationUncompensated, math::vec3f *angularRateUncompensated, float *temperature);
1557 
1562  void parseVNSTV(math::vec4f *quaternion, math::vec3f *angularRateBias);
1563 
1568  void parseVNCOV(math::vec3f *attitudeVariance, math::vec3f *angularRateBiasVariance);
1569 
1570  #endif
1571 
1583  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);
1584 
1590  void parseVNDTV(float *deltaTime, vn::math::vec3f *deltaTheta, vn::math::vec3f *deltaVelocity);
1591 
1593 
1604 
1616  void parseBinaryOutput(
1617  uint16_t* asyncMode,
1618  uint16_t* rateDivisor,
1619  uint16_t* outputGroup,
1620  uint16_t* commonField,
1621  uint16_t* timeField,
1622  uint16_t* imuField,
1623  uint16_t* gpsField,
1624  uint16_t* attitudeField,
1625  uint16_t* insField);
1626 
1630  void parseUserTag(char* tag);
1631 
1635  void parseModelNumber(char* productName);
1636 
1640  void parseHardwareRevision(uint32_t* revision);
1641 
1645  void parseSerialNumber(uint32_t* serialNum);
1646 
1650  void parseFirmwareVersion(char* firmwareVersion);
1651 
1655  void parseSerialBaudRate(uint32_t* baudrate);
1656 
1660  void parseAsyncDataOutputType(uint32_t* ador);
1661 
1665  void parseAsyncDataOutputFrequency(uint32_t* adof);
1666 
1670  void parseYawPitchRoll(vn::math::vec3f* yawPitchRoll);
1671 
1675  void parseAttitudeQuaternion(vn::math::vec4f* quat);
1676 
1683  void parseQuaternionMagneticAccelerationAndAngularRates(vn::math::vec4f* quat, vn::math::vec3f* mag, vn::math::vec3f* accel, vn::math::vec3f* gyro);
1684 
1688  void parseMagneticMeasurements(vn::math::vec3f* mag);
1689 
1693  void parseAccelerationMeasurements(vn::math::vec3f* accel);
1694 
1698  void parseAngularRateMeasurements(vn::math::vec3f* gyro);
1699 
1705  void parseMagneticAccelerationAndAngularRates(vn::math::vec3f* mag, vn::math::vec3f* accel, vn::math::vec3f* gyro);
1706 
1711  void parseMagneticAndGravityReferenceVectors(vn::math::vec3f* magRef, vn::math::vec3f* accRef);
1712 
1719  void parseFilterMeasurementsVarianceParameters(float* angularWalkVariance, vn::math::vec3f* angularRateVariance, vn::math::vec3f* magneticVariance, vn::math::vec3f* accelerationVariance);
1720 
1725  void parseMagnetometerCompensation(vn::math::mat3f* c, vn::math::vec3f* b);
1726 
1733  void parseFilterActiveTuningParameters(float* magneticDisturbanceGain, float* accelerationDisturbanceGain, float* magneticDisturbanceMemory, float* accelerationDisturbanceMemory);
1734 
1739  void parseAccelerationCompensation(vn::math::mat3f* c, vn::math::vec3f* b);
1740 
1744  void parseReferenceFrameRotation(vn::math::mat3f* c);
1745 
1752  void parseYawPitchRollMagneticAccelerationAndAngularRates(vn::math::vec3f* yawPitchRoll, vn::math::vec3f* mag, vn::math::vec3f* accel, vn::math::vec3f* gyro);
1753 
1763  void parseCommunicationProtocolControl(uint8_t* serialCount, uint8_t* serialStatus, uint8_t* spiCount, uint8_t* spiStatus, uint8_t* serialChecksum, uint8_t* spiChecksum, uint8_t* errorMode);
1764 
1774  void parseSynchronizationControl(uint8_t* syncInMode, uint8_t* syncInEdge, uint16_t* syncInSkipFactor, uint8_t* syncOutMode, uint8_t* syncOutPolarity, uint16_t* syncOutSkipFactor, uint32_t* syncOutPulseWidth);
1775 
1781  void parseSynchronizationStatus(uint32_t* syncInCount, uint32_t* syncInTime, uint32_t* syncOutCount);
1782 
1790  void parseFilterBasicControl(uint8_t* magMode, uint8_t* extMagMode, uint8_t* extAccMode, uint8_t* extGyroMode, vn::math::vec3f* gyroLimit);
1791 
1798  void parseVpeBasicControl(uint8_t* enable, uint8_t* headingMode, uint8_t* filteringMode, uint8_t* tuningMode);
1799 
1805  void parseVpeMagnetometerBasicTuning(vn::math::vec3f* baseTuning, vn::math::vec3f* adaptiveTuning, vn::math::vec3f* adaptiveFiltering);
1806 
1814  void parseVpeMagnetometerAdvancedTuning(vn::math::vec3f* minFiltering, vn::math::vec3f* maxFiltering, float* maxAdaptRate, float* disturbanceWindow, float* maxTuning);
1815 
1821  void parseVpeAccelerometerBasicTuning(vn::math::vec3f* baseTuning, vn::math::vec3f* adaptiveTuning, vn::math::vec3f* adaptiveFiltering);
1822 
1830  void parseVpeAccelerometerAdvancedTuning(vn::math::vec3f* minFiltering, vn::math::vec3f* maxFiltering, float* maxAdaptRate, float* disturbanceWindow, float* maxTuning);
1831 
1837  void parseVpeGyroBasicTuning(vn::math::vec3f* angularWalkVariance, vn::math::vec3f* baseTuning, vn::math::vec3f* adaptiveTuning);
1838 
1842  void parseFilterStartupGyroBias(vn::math::vec3f* bias);
1843 
1849  void parseMagnetometerCalibrationControl(uint8_t* hsiMode, uint8_t* hsiOutput, uint8_t* convergeRate);
1850 
1855  void parseCalculatedMagnetometerCalibration(vn::math::mat3f* c, vn::math::vec3f* b);
1856 
1860  void parseIndoorHeadingModeControl(float* maxRateError);
1861 
1865  void parseVelocityCompensationMeasurement(vn::math::vec3f* velocity);
1866 
1872  void parseVelocityCompensationControl(uint8_t* mode, float* velocityTuning, float* rateTuning);
1873 
1880  void parseVelocityCompensationStatus(float* x, float* xDot, vn::math::vec3f* accelOffset, vn::math::vec3f* omega);
1881 
1889  void parseImuMeasurements(vn::math::vec3f* mag, vn::math::vec3f* accel, vn::math::vec3f* gyro, float* temp, float* pressure);
1890 
1895  void parseGpsConfiguration(uint8_t* mode, uint8_t* ppsSource);
1896 
1900  void parseGpsAntennaOffset(vn::math::vec3f* position);
1901 
1913  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);
1914 
1926  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);
1927 
1939  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);
1940 
1952  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);
1953 
1958  void parseInsBasicConfiguration(uint8_t* scenario, uint8_t* ahrsAiding);
1959 
1965  void parseInsBasicConfiguration(uint8_t* scenario, uint8_t* ahrsAiding, uint8_t* estBaseline);
1966 
1984  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);
1985 
1993  void parseInsStateLla(vn::math::vec3f* yawPitchRoll, vn::math::vec3d* position, vn::math::vec3f* velocity, vn::math::vec3f* accel, vn::math::vec3f* angularRate);
1994 
2002  void parseInsStateEcef(vn::math::vec3f* yawPitchRoll, vn::math::vec3d* position, vn::math::vec3f* velocity, vn::math::vec3f* accel, vn::math::vec3f* angularRate);
2003 
2009  void parseStartupFilterBiasEstimate(vn::math::vec3f* gyroBias, vn::math::vec3f* accelBias, float* pressureBias);
2010 
2016  void parseDeltaThetaAndDeltaVelocity(float* deltaTime, vn::math::vec3f* deltaTheta, vn::math::vec3f* deltaVelocity);
2017 
2023  void parseDeltaThetaAndDeltaVelocityConfiguration(uint8_t* integrationFrame, uint8_t* gyroCompensation, uint8_t* accelCompensation);
2024 
2032  void parseReferenceVectorConfiguration(uint8_t* useMagModel, uint8_t* useGravityModel, uint32_t* recalcThreshold, float* year, vn::math::vec3d* position);
2033 
2038  void parseGyroCompensation(vn::math::mat3f* c, vn::math::vec3f* b);
2039 
2052  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);
2053 
2058  void parseGpsCompassBaseline(vn::math::vec3f* position, vn::math::vec3f* uncertainty);
2059 
2066  void parseGpsCompassEstimatedBaseline(uint8_t* estBaselineUsed, uint16_t* numMeas, vn::math::vec3f* position, vn::math::vec3f* uncertainty);
2067 
2074  void parseImuRateConfiguration(uint16_t* imuRate, uint16_t* navDivisor, float* filterTargetRate, float* filterMinRate);
2075 
2081  void parseYawPitchRollTrueBodyAccelerationAndAngularRates(vn::math::vec3f* yawPitchRoll, vn::math::vec3f* bodyAccel, vn::math::vec3f* gyro);
2082 
2088  void parseYawPitchRollTrueInertialAccelerationAndAngularRates(vn::math::vec3f* yawPitchRoll, vn::math::vec3f* inertialAccel, vn::math::vec3f* gyro);
2089 
2091 
2092 private:
2093 
2094  void ensureCanExtract(size_t numOfBytes);
2095 
2096  bool _isPacketDataMine;
2097  size_t _length;
2098  char *_data;
2099  size_t _curExtractLoc;
2100 };
2101 
2102 }
2103 }
2104 }
2105 
2106 #endif
Template for a Euclidean vector.
Definition: vector.h:22
Template for a matrix.
Definition: matrix.h:20
Type is unknown.
Definition: packet.h:24
Type
The different types of UART packets.
Definition: packet.h:22
Definition: attitude.h:8
Binary packet.
Definition: packet.h:25
Structure representing a UART packet received from the VectorNav sensor.
Definition: packet.h:16