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

types.h
#ifndef _VNPROTOCOL_UART_TYPES_H_
#define _VNPROTOCOL_UART_TYPES_H_
#include "int.h"
namespace vn {
namespace protocol {
namespace uart {
enum ErrorDetectionMode
{
ERRORDETECTIONMODE_NONE,
ERRORDETECTIONMODE_CHECKSUM,
ERRORDETECTIONMODE_CRC
};
enum AsciiAsync
{
VNOFF = 0,
VNYPR = 1,
VNQTN = 2,
#ifdef INTERNAL
VNQTM = 3,
VNQTA = 4,
VNQTR = 5,
VNQMA = 6,
VNQAR = 7,
#endif
VNQMR = 8,
#ifdef INTERNAL
VNDCM = 9,
#endif
VNMAG = 10,
VNACC = 11,
VNGYR = 12,
VNMAR = 13,
VNYMR = 14,
#ifdef INTERNAL
VNYCM = 15,
#endif
VNYBA = 16,
VNYIA = 17,
#ifdef INTERNAL
VNICM = 18,
#endif
VNIMU = 19,
VNGPS = 20,
VNGPE = 21,
VNINS = 22,
VNINE = 23,
VNISL = 28,
VNISE = 29,
VNDTV = 30,
#ifdef INTERNAL
VNRAW = 252,
VNCMV = 253,
VNSTV = 254,
VNCOV = 255,
#endif
};
enum AsyncMode
{
ASYNCMODE_NONE = 0,
ASYNCMODE_PORT1 = 1,
ASYNCMODE_PORT2 = 2,
ASYNCMODE_BOTH = 3
};
enum BinaryGroup
{
BINARYGROUP_COMMON = 0x01,
BINARYGROUP_TIME = 0x02,
BINARYGROUP_IMU = 0x04,
BINARYGROUP_GPS = 0x08,
BINARYGROUP_ATTITUDE = 0x10,
BINARYGROUP_INS = 0x20
};
enum CommonGroup
{
COMMONGROUP_NONE = 0x0000,
COMMONGROUP_TIMESTARTUP = 0x0001,
COMMONGROUP_TIMEGPS = 0x0002,
COMMONGROUP_TIMESYNCIN = 0x0004,
COMMONGROUP_YAWPITCHROLL = 0x0008,
COMMONGROUP_QUATERNION = 0x0010,
COMMONGROUP_ANGULARRATE = 0x0020,
COMMONGROUP_POSITION = 0x0040,
COMMONGROUP_VELOCITY = 0x0080,
COMMONGROUP_ACCEL = 0x0100,
COMMONGROUP_IMU = 0x0200,
COMMONGROUP_MAGPRES = 0x0400,
COMMONGROUP_DELTATHETA = 0x0800,
COMMONGROUP_INSSTATUS = 0x1000,
COMMONGROUP_SYNCINCNT = 0x2000,
COMMONGROUP_TIMEGPSPPS = 0x4000
};
enum TimeGroup
{
TIMEGROUP_NONE = 0x0000,
TIMEGROUP_TIMESTARTUP = 0x0001,
TIMEGROUP_TIMEGPS = 0x0002,
TIMEGROUP_GPSTOW = 0x0004,
TIMEGROUP_GPSWEEK = 0x0008,
TIMEGROUP_TIMESYNCIN = 0x0010,
TIMEGROUP_TIMEGPSPPS = 0x0020,
TIMEGROUP_TIMEUTC = 0x0040,
TIMEGROUP_SYNCINCNT = 0x0080
};
enum ImuGroup
{
IMUGROUP_NONE = 0x0000,
IMUGROUP_IMUSTATUS = 0x0001,
IMUGROUP_UNCOMPMAG = 0x0002,
IMUGROUP_UNCOMPACCEL = 0x0004,
IMUGROUP_UNCOMPGYRO = 0x0008,
IMUGROUP_TEMP = 0x0010,
IMUGROUP_PRES = 0x0020,
IMUGROUP_DELTATHETA = 0x0040,
IMUGROUP_DELTAVEL = 0x0080,
IMUGROUP_MAG = 0x0100,
IMUGROUP_ACCEL = 0x0200,
IMUGROUP_ANGULARRATE = 0x0400,
IMUGROUP_SENSSAT = 0x0800,
};
enum GpsGroup
{
GPSGROUP_NONE = 0x0000,
GPSGROUP_UTC = 0x0001,
GPSGROUP_TOW = 0x0002,
GPSGROUP_WEEK = 0x0004,
GPSGROUP_NUMSATS = 0x0008,
GPSGROUP_FIX = 0x0010,
GPSGROUP_POSLLA = 0x0020,
GPSGROUP_POSECEF = 0x0040,
GPSGROUP_VELNED = 0x0080,
GPSGROUP_VELECEF = 0x0100,
GPSGROUP_POSU = 0x0200,
GPSGROUP_VELU = 0x0400,
GPSGROUP_TIMEU = 0x0800,
};
enum AttitudeGroup
{
ATTITUDEGROUP_NONE = 0x0000,
ATTITUDEGROUP_VPESTATUS = 0x0001,
ATTITUDEGROUP_YAWPITCHROLL = 0x0002,
ATTITUDEGROUP_QUATERNION = 0x0004,
ATTITUDEGROUP_DCM = 0x0008,
ATTITUDEGROUP_MAGNED = 0x0010,
ATTITUDEGROUP_ACCELNED = 0x0020,
ATTITUDEGROUP_LINEARACCELBODY = 0x0040,
ATTITUDEGROUP_LINEARACCELNED = 0x0080,
ATTITUDEGROUP_YPRU = 0x0100,
};
enum InsGroup
{
INSGROUP_NONE = 0x0000,
INSGROUP_INSSTATUS = 0x0001,
INSGROUP_POSLLA = 0x0002,
INSGROUP_POSECEF = 0x0004,
INSGROUP_VELBODY = 0x0008,
INSGROUP_VELNED = 0x0010,
INSGROUP_VELECEF = 0x0020,
INSGROUP_MAGECEF = 0x0040,
INSGROUP_ACCELECEF = 0x0080,
INSGROUP_LINEARACCELECEF = 0x0100,
INSGROUP_POSU = 0x0200,
INSGROUP_VELU = 0x0400,
};
enum SensorError
{
ERR_HARD_FAULT = 1,
ERR_SERIAL_BUFFER_OVERFLOW = 2,
ERR_INVALID_CHECKSUM = 3,
ERR_INVALID_COMMAND = 4,
ERR_NOT_ENOUGH_PARAMETERS = 5,
ERR_TOO_MANY_PARAMETERS = 6,
ERR_INVALID_PARAMETER = 7,
ERR_INVALID_REGISTER = 8,
ERR_UNAUTHORIZED_ACCESS = 9,
ERR_WATCHDOG_RESET = 10,
ERR_OUTPUT_BUFFER_OVERFLOW = 11,
ERR_INSUFFICIENT_BAUD_RATE = 12,
ERR_ERROR_BUFFER_OVERFLOW = 255
};
enum SyncInMode
{
#ifdef INTERNAL
SYNCINMODE_COUNT2 = 0,
SYNCINMODE_ADC2 = 1,
SYNCINMODE_ASYNC2 = 2,
#endif
SYNCINMODE_COUNT = 3,
SYNCINMODE_IMU = 4,
SYNCINMODE_ASYNC = 5
};
enum SyncInEdge
{
SYNCINEDGE_RISING = 0,
SYNCINEDGE_FALLING = 1
};
enum SyncOutMode
{
SYNCOUTMODE_NONE = 0,
SYNCOUTMODE_ITEMSTART = 1,
SYNCOUTMODE_IMUREADY = 2,
SYNCOUTMODE_INS = 3,
SYNCOUTMODE_GPSPPS = 6
};
enum SyncOutPolarity
{
SYNCOUTPOLARITY_NEGATIVE = 0,
SYNCOUTPOLARITY_POSITIVE = 1
};
enum CountMode
{
COUNTMODE_NONE = 0,
COUNTMODE_SYNCINCOUNT = 1,
COUNTMODE_SYNCINTIME = 2,
COUNTMODE_SYNCOUTCOUNTER = 3,
COUNTMODE_GPSPPS = 4
};
enum StatusMode
{
STATUSMODE_OFF = 0,
STATUSMODE_VPESTATUS = 1,
STATUSMODE_INSSTATUS = 2
};
enum ChecksumMode
{
CHECKSUMMODE_OFF = 0,
CHECKSUMMODE_CHECKSUM = 1,
CHECKSUMMODE_CRC = 2
};
enum ErrorMode
{
ERRORMODE_IGNORE = 0,
ERRORMODE_SEND = 1,
ERRORMODE_SENDANDOFF = 2
};
enum FilterMode
{
FILTERMODE_NOFILTERING = 0,
FILTERMODE_ONLYRAW = 1,
FILTERMODE_ONLYCOMPENSATED = 2,
FILTERMODE_BOTH = 3
};
enum IntegrationFrame
{
INTEGRATIONFRAME_BODY = 0,
INTEGRATIONFRAME_NED = 1
};
enum CompensationMode
{
COMPENSATIONMODE_NONE = 0,
COMPENSATIONMODE_BIAS = 1
};
enum GpsFix
{
GPSFIX_NOFIX = 0,
GPSFIX_TIMEONLY = 1,
GPSFIX_2D = 2,
GPSFIX_3D = 3
};
enum GpsMode
{
GPSMODE_ONBOARDGPS = 0,
GPSMODE_EXTERNALGPS = 1,
GPSMODE_EXTERNALVN200GPS = 2
};
enum PpsSource
{
PPSSOURCE_GPSPPSRISING = 0,
PPSSOURCE_GPSPPSFALLING = 1,
PPSSOURCE_SYNCINRISING = 2,
PPSSOURCE_SYNCINFALLING = 3
};
enum VpeEnable
{
VPEENABLE_DISABLE = 0,
VPEENABLE_ENABLE = 1
};
enum HeadingMode
{
HEADINGMODE_ABSOLUTE = 0,
HEADINGMODE_RELATIVE = 1,
HEADINGMODE_INDOOR = 2
};
enum VpeMode
{
VPEMODE_OFF = 0,
VPEMODE_MODE1 = 1
};
enum Scenario
{
SCENARIO_AHRS = 0,
SCENARIO_INSWITHPRESSURE = 1,
SCENARIO_INSWITHOUTPRESSURE = 2,
SCENARIO_GPSMOVINGBASELINEDYNAMIC = 3,
SCENARIO_GPSMOVINGBASELINESTATIC = 4
};
enum HsiMode
{
HSIMODE_OFF = 0,
HSIMODE_RUN = 1,
HSIMODE_RESET = 2
};
enum HsiOutput
{
HSIOUTPUT_NOONBOARD = 1,
HSIOUTPUT_USEONBOARD = 3
};
enum VelocityCompensationMode
{
VELOCITYCOMPENSATIONMODE_DISABLED = 0,
VELOCITYCOMPENSATIONMODE_BODYMEASUREMENT = 1
};
enum MagneticMode
{
MAGNETICMODE_2D = 0,
MAGNETICMODE_3D = 1
};
enum ExternalSensorMode
{
EXTERNALSENSORMODE_INTERNAL = 0,
EXTERNALSENSORMODE_EXTERNAL200HZ = 1,
EXTERNALSENSORMODE_EXTERNALONUPDATE = 2
};
enum FoamInit
{
FOAMINIT_NOFOAMINIT = 0,
FOAMINIT_FOAMINITPITCHROLL = 1,
FOAMINIT_FOAMINITHEADINGPITCHROLL = 2,
FOAMINIT_FOAMINITPITCHROLLCOVARIANCE = 3,
FOAMINIT_FOAMINITHEADINGPITCHROLLCOVARIANCE = 4
};
enum SensSat
{
SENSSAT_MAGX = 0x0001,
SENSSAT_MAGY = 0x0002,
SENSSAT_MAGZ = 0x0004,
SENSSAT_ACCX = 0x0008,
SENSSAT_ACCY = 0x0010,
SENSSAT_ACCZ = 0x0020,
SENSSAT_GYROX = 0x0040,
SENSSAT_GYROY = 0x0080,
SENSSAT_GYROZ = 0x0100,
SENSSAT_PRES = 0x0200
};
struct VpeStatus
{
uint8_t attitudeQuality;
bool gyroSaturation;
bool gyroSaturationRecovery;
uint8_t magDisturbance;
bool magSaturation;
uint8_t accDisturbance;
bool accSaturation;
bool knownMagDisturbance;
bool knownAccelDisturbance;
VpeStatus();
explicit VpeStatus(uint16_t raw);
};
enum InsStatus
{
INSSTATUS_NOT_TRACKING = 0x00,
INSSTATUS_SUFFICIENT_DYNAMIC_MOTION = 0x01,
INSSTATUS_TRACKING = 0x02,
INSSTATUS_GPS_FIX = 0x04,
INSSTATUS_TIME_ERROR = 0x08,
INSSTATUS_IMU_ERROR = 0x10,
INSSTATUS_MAG_PRES_ERROR = 0x20,
INSSTATUS_GPS_ERROR = 0x40
};
struct TimeUtc
{
int8_t year;
uint8_t month;
uint8_t day;
uint8_t hour;
uint8_t min;
uint8_t sec;
uint8_t ms;
//TimeUtc() { }
};
CommonGroup operator|(CommonGroup lhs, CommonGroup rhs);
TimeGroup operator|(TimeGroup lhs, TimeGroup rhs);
ImuGroup operator|(ImuGroup lhs, ImuGroup rhs);
GpsGroup operator|(GpsGroup lhs, GpsGroup rhs);
AttitudeGroup operator|(AttitudeGroup lhs, AttitudeGroup rhs);
InsGroup operator|(InsGroup lhs, InsGroup rhs);
}
}
}
#endif
vn::protocol::uart::TimeUtc::sec
uint8_t sec
Sec field.
Definition: types.h:557
vn::protocol::uart::VpeStatus::accDisturbance
uint8_t accDisturbance
AccDisturbance field.
Definition: types.h:517
vn::protocol::uart::VpeStatus::accSaturation
bool accSaturation
AccSaturation field.
Definition: types.h:520
vn::protocol::uart::VpeStatus::magDisturbance
uint8_t magDisturbance
MagDistrubance field.
Definition: types.h:511
int.h
vn::protocol::uart::TimeUtc::hour
uint8_t hour
Hour field.
Definition: types.h:555
vn::protocol::uart::TimeUtc::year
int8_t year
Year field.
Definition: types.h:552
vn::protocol::uart::VpeStatus::magSaturation
bool magSaturation
MagSaturation field.
Definition: types.h:514
vn::protocol::uart::TimeUtc::ms
uint8_t ms
Ms field.
Definition: types.h:558
vn::protocol::uart::VpeStatus::knownMagDisturbance
bool knownMagDisturbance
KnownMagDisturbance field.
Definition: types.h:523
vn::protocol::uart::TimeUtc::min
uint8_t min
Min field.
Definition: types.h:556
vn::protocol::uart::VpeStatus::knownAccelDisturbance
bool knownAccelDisturbance
KnownAccelDisturbance field.
Definition: types.h:526
vn::protocol::uart::VpeStatus::attitudeQuality
uint8_t attitudeQuality
AttitudeQuality field.
Definition: types.h:502
vn::protocol::uart::VpeStatus::VpeStatus
VpeStatus()
Default constructor.
vn::protocol::uart::TimeUtc::day
uint8_t day
Day field.
Definition: types.h:554
vn
Definition: attitude.h:8
vn::protocol::uart::TimeUtc
UTC time as represented by the VectorNav sensor.
Definition: types.h:550
vn::protocol::uart::VpeStatus::gyroSaturation
bool gyroSaturation
GyroSaturation field.
Definition: types.h:505
vn::protocol::uart::VpeStatus
Status indicators for VPE.
Definition: types.h:499
vn::protocol::uart::TimeUtc::month
uint8_t month
Month field.
Definition: types.h:553
vn::protocol::uart::VpeStatus::gyroSaturationRecovery
bool gyroSaturationRecovery
GyroSaturationRecovery field.
Definition: types.h:508