30 #ifdef _CMT_DLL_EXPORT 31 #include "xsens_math.h" 35 #define PACKETLOG CMTLOG 37 #define PACKETLOG(...) 276 totalOffset += 3 * ds;
286 totalOffset += 3 * ds;
296 totalOffset += 3 * ds;
327 totalOffset += 3 * ds;
332 totalOffset += 4 * ds;
337 totalOffset += 9 * ds;
377 totalOffset += 3 * ds;
390 totalOffset += 3 * ds;
565 for (
uint16_t i = 0; i < 10; ++i, ++sh, ++bare)
852 double* bare = (
double*)&
buffer;
888 double* bare = (
double*)&
data;
998 for (
int32_t i = 0; i < 3; ++i)
999 for (
int32_t j = 0; j < 3; ++j, k += ds)
1031 for (
int32_t i = 0; i < 3; ++i)
1032 for (
int32_t j = 0; j < 3; ++j, k += ds)
1291 PACKETLOG(
"Create new packet from Packet %p\n", &pack);
1301 PACKETLOG(
"Copy packet from Packet %p\n",
this);
1318 #ifdef _CMT_DLL_EXPORT 1335 Quaternion qa, qb, qc;
1393 dc =
g * da + f * db;
1450 qc.isSlerp(qa, qb, f);
1471 m.isArray(&mf.
m_data[0][0]);
1475 m.isArray(&mf.
m_data[0][0]);
1478 qc.isSlerp(qa, qb, f);
1481 m.setArray(&mf.
m_data[0][0]);
1492 dc = f * (double)sc;
1493 sc = sa + (
uint16_t)doubleToLong(dc);
#define CMT_OUTPUTSETTINGS_DATAFORMAT_FLOAT
uint32_t getDataLong(const uint16_t offset=0) const
Return the current value of the data as an uint32_t (32 bits).
bool updateOriQuat(const CmtQuat &data, const uint16_t index=0)
Add/update Quaternion Orientation data for the item.
bool updatePositionLLA(const CmtVector &data, const uint16_t index=0)
Add/update Position Lat Lon Alt for the item.
double getDataFPValue(const uint64_t outputSettings, const uint16_t offset=0) const
Return current data value as double, conversion depends on outputSettings.
bool updateRawTemp(uint16_t temp, const uint16_t index=0)
Add/update Raw Temperature data for the item.
void setDataFPValue(const uint64_t outputSettings, const double data, const uint16_t offset=0)
Write a floating/fixed point value into to the data buffer, conversion depends on outputSettings...
bool containsCalAcc(const uint16_t index=0) const
Check if data item contains Calibrated Accelerometer data.
double getTemp(const uint16_t index=0) const
Return the Temperature component of a data item.
CmtVector getPositionLLA(const uint16_t index=0) const
Return the Position Lat Lon Alt component of a data item.
TimeStamp m_toa
Time of arrival.
#define CMT_OUTPUTSETTINGS_DATAFORMAT_FP1632
unsigned __int16 uint16_t
#define CMT_OUTPUTSETTINGS_ORIENTMODE_MATRIX
bool containsAccG(const uint16_t index=0) const
Check if data item contains XKF-3 Acc-G data.
#define CMT_OUTPUTSETTINGS_CALIBMODE_MAG_MASK
CmtRawData getRawData(const uint16_t index=0) const
Return the Raw Data component of a data item.
bool updateAnalogIn1(const CmtAnalogInData &data, const uint16_t index=0)
Add/update AnalogIn 1 for the item.
void resizeData(const uint16_t newSize)
Resize the data area to the given size.
CmtVector getAccG(const uint16_t index=0) const
Return the XKF-3 Acc-G component of the packet.
bool containsAnalogIn2(const uint16_t index=0) const
Check if data item contains AnalogIn 2.
void deleteData(uint16_t size, uint16_t offset=0)
Remove a number of bytes from the message (this will reduce the message size)
bool containsRawAcc(const uint16_t index=0) const
Check if data item contains Raw Accelerometer data.
CmtVector getVelocity(const uint16_t index=0) const
Return the Velocity component of a data item.
T interpolate(const T &x, const VECTOR &ys, const T &x0, const T &x1)
Interpolate a data sequence "ys" ranging from "x0" to "x1" (equally spaced), to obtain the approximat...
#define CMT_OUTPUTMODE_STATUS
bool updateCalData(const CmtCalData &data, const uint16_t index=0)
Add/update Calibrated Data for the item.
uint16_t getDataSize(void) const
Return the length of the data part of the message.
CmtDataFormat getDataFormat(const uint16_t index=0) const
uint16_t getRawTemp(const uint16_t index=0) const
Return the Raw Temperature component of a data item.
double m_pitch
The pitch (rotation around y-axis / right-left-line)
uint16_t m_itemCount
The number of data items in the message.
bool containsPositionLLA(const uint16_t index=0) const
Check if data item contains Position Lat Lon Alt.
void insertData(uint16_t size, uint16_t offset=0)
Insert a number of bytes into the message (this will increase the message size)
uint16_t m_rawGpsPressure
uint16_t getSampleCounter(const uint16_t index=0) const
Return the Sample Counter component of the packet.
CmtRawGpsData getRawGpsData(const uint16_t index=0) const
Return the Raw GpsPrint Data component of a data item. TODO: Implement in COM interface!!! ...
bool updateRawAcc(const CmtShortVector &vec, const uint16_t index=0)
Add/update Raw Accelerometer data for the item.
#define CMT_OUTPUTSETTINGS_POSITIONMODE_LLA_WGS84
#define CMT_OUTPUTSETTINGS_TIMESTAMP_SAMPLECNT
#define CMT_OUTPUTMODE_CALIB
#define CMT_OUTPUTSETTINGS_DATAFORMAT_DOUBLE
#define CMT_OUTPUTMODE_VELOCITY
uint16_t getDataShort(const uint16_t offset=0) const
Return the current value of the data as an uint16_t (16 bits).
#define CMT_OUTPUTSETTINGS_CALIBMODE_ACCGYRMAG
#define CMT_OUTPUTMODE_RAW
bool containsCalData(const uint16_t index=0) const
Check if data item contains Calibrated Data.
bool containsRawGpsData(const uint16_t index=0) const
Check if data item contains Raw GpsPrint Data.
#define CMT_OUTPUTSETTINGS_AUXILIARYMODE_AIN2_MASK
A structure containing MT data + timestamp and formatting information.
bool updateRawGpsData(const CmtRawGpsData &data, const uint16_t index=0)
Add/update Raw GpsPrint Data for the item.
bool containsRawTemp(const uint16_t index=0) const
Check if data item contains Raw Temperature data.
bool containsOriMatrix(const uint16_t index=0) const
Check if data item contains Matrix Orientation data.
TimeStamp m_rtc
Sample time in ms, based on the sample counter.
uint16_t m_rawGpsLatitude
CmtDataFormat * m_formatList
A list of the formats of the data items.
struct xsens::Packet::PacketInfo * m_infoList
bool updateOriEuler(const CmtEuler &data, const uint16_t index=0)
Add/update Euler Orientation data for the item.
bool updateCalGyr(const CmtVector &vec, const uint16_t index=0)
Add/update Calibrated Gyroscope data for the item.
bool containsCalGyr(const uint16_t index=0) const
Check if data item contains Calibrated Gyroscope data.
CmtVector getCalGyr(const uint16_t index=0) const
Return the Calibrated Gyroscope component of a data item.
bool updateVelocity(const CmtVector &data, const uint16_t index=0)
Add/update Velocity for the item.
bool updateAccG(const CmtVector &g, const uint16_t index=0)
Add/update XKF-3 Acc-G data for the item.
bool containsCalMag(const uint16_t index=0) const
Check if data item contains Calibrated Magnetometer data.
CmtQuat getOriQuat(const uint16_t index=0) const
Return the Orientation component of a data item as a Quaternion.
bool updateCalAcc(const CmtVector &vec, const uint16_t index=0)
Add/update Calibrated Accelerometer data for the item.
#define CMT_OUTPUTSETTINGS_TIMESTAMP_MASK
bool m_xm
Indicates that xbus-formatting is used.
bool containsRawGyr(const uint16_t index=0) const
Check if data item contains Raw Gyroscope data.
CmtShortVector getRawAcc(const uint16_t index=0) const
Return the Raw Accelerometer component of a data item.
double m_roll
The roll (rotation around x-axis / back-front-line)
#define CMT_OUTPUTSETTINGS_VELOCITYMODE_MASK
bool updateTemp(const double &temp, const uint16_t index=0)
Add/update Calibrated Accelerometer data for the item.
uint16_t m_rawGpsPressureAge
bool containsOriQuat(const uint16_t index=0) const
Check if data item contains Quaternion Orientation data.
bool containsTemp(const uint16_t index=0) const
Check if data item contains Temperature data.
#define CMT_OUTPUTSETTINGS_POSITIONMODE_MASK
uint64_t TimeStamp
A real-time timestamp (ms)
uint16_t getDataSize(const uint16_t index=0) const
Return the data size.
#define CMT_OUTPUTSETTINGS_ORIENTMODE_QUATERNION
CmtMatrix getOriMatrix(const uint16_t index=0) const
Return the Orientation component of a data item as an Orientation Matrix.
#define CMT_OUTPUTSETTINGS_DATAFORMAT_MASK
void setDataLong(const uint32_t data, const uint16_t offset=0)
Write an uint32_t (32 bits) into the data buffer.
#define CMT_OUTPUTSETTINGS_ORIENTMODE_EULER
Contains information about data in the packet and the format of that data.
CmtShortVector getRawGyr(const uint16_t index=0) const
Return the Raw Gyroscope component of a data item.
#define CMT_DATA_ITEM_NOT_AVAILABLE
Indicates that a data item is not available in the packet.
#define CMT_OUTPUTSETTINGS_CALIBMODE_ACC_MASK
uint16_t getFPValueSize(const uint16_t index) const
Return the floating/fixed point value size.
uint8_t * getDataBuffer(const uint16_t offset=0)
Return a pointer to the data buffer.
#define CMT_OUTPUTSETTINGS_DATAFORMAT_F1220
bool containsRawMag(const uint16_t index=0) const
Check if data item contains Raw Magnetometer data.
bool containsVelocity(const uint16_t index=0) const
Check if data item contains Velocity.
bool setDataFormat(const CmtDataFormat &format, const uint16_t index=0)
bool updateOriMatrix(const CmtMatrix &data, const uint16_t index=0)
Add/update Matrix Orientation data for the item.
#define CMT_OUTPUTSETTINGS_VELOCITYMODE_NED
bool updateRawMag(const CmtShortVector &vec, const uint16_t index=0)
Add/update Raw Magnetometer data for the item.
#define CMT_OUTPUTSETTINGS_AUXILIARYMODE_AIN1_MASK
#define CMT_OUTPUTMODE_RAWGPSPRINT
bool updateSampleCounter(uint16_t counter, const uint16_t index=0)
Add/update Sample Counter for all items.
#define CMT_OUTPUTMODE_TEMP
uint32_t CmtOutputMode
An output mode bit-field.
bool containsOriEuler(const uint16_t index=0) const
Check if data item contains Euler Orientation data.
uint8_t getDataByte(const uint16_t offset=0) const
Return the current value of the data as an unsigned byte (8 bits).
bool containsAnalogIn1(const uint16_t index=0) const
Check if data item contains AnalogIn 1.
void setXbus(bool xbus, bool convert=false)
bool containsStatus(const uint16_t index=0) const
Check if data item contains Velocity.
The namespace of all Xsens software since 2006.
#define CMT_OUTPUTSETTINGS_CALIBMODE_GYR_MASK
double m_yaw
The yaw (rotation around z-axis / down-up-line)
bool updateRawData(const CmtRawData &data, const uint16_t index=0)
Add/update Raw Data for the item.
GLenum GLsizei GLenum format
CmtVector getCalMag(const uint16_t index=0) const
Return the Calibrated Magnetometer component of a data item.
bool updateCalMag(const CmtVector &vec, const uint16_t index=0)
Add/update Calibrated Magnetometer data for the item.
Packet(uint16_t items, bool xbus)
bool updateAnalogIn2(const CmtAnalogInData &data, const uint16_t index=0)
Add/update AnalogIn 2 for the item.
bool containsSampleCounter(const uint16_t index=0) const
Check if data item contains Sample Counter.
CmtTimeStamp getRtc(const uint16_t index=0) const
Return the RTC of the packet.
#define CMT_OUTPUTMODE_AUXILIARY
bool m_autoUpdateChecksum
#define CMT_OUTPUTSETTINGS_ORIENTMODE_MASK
CmtAnalogInData getAnalogIn2(const uint16_t index=0) const
Return the AnalogIn 2 component of a data item.
bool containsRawData(const uint16_t index=0) const
Check if data item contains Raw Data.
CmtVector getCalAcc(const uint16_t index=0) const
Return the Calibrated Accelerometer component of a data item.
unsigned __int32 uint32_t
#define CMT_OUTPUTMODE_ORIENT
uint16_t m_rawGpsLongitude
#define swapEndian16(src)
CmtAnalogInData getAnalogIn1(const uint16_t index=0) const
Return the AnalogIn 1 component of a data item.
GLsizei GLsizei GLenum GLenum const GLvoid * data
CmtCalData getCalData(const uint16_t index=0) const
Return the Calibrated Data component of a data item.
CmtShortVector getRawMag(const uint16_t index=0) const
Return the Raw Magnetometer component of a data item.
#define CMT_OUTPUTMODE_POSITION
uint16_t CmtMtTimeStamp
An MT timestamp (sample count)
void setDataByte(const uint8_t data, const uint16_t offset=0)
Write an unsigned byte (8 bits) into the data buffer.
bool updateRawGyr(const CmtShortVector &vec, const uint16_t index=0)
Add/update Raw Gyroscope data for the item.
uint64_t CmtOutputSettings
An output settings bit-field.
void setDataShort(const uint16_t data, const uint16_t offset=0)
Write an uint16_t (16 bits) into the data buffer.
void operator=(const Packet &pack)
CmtEuler getOriEuler(const uint16_t index=0) const
Return the Orientation component of a data item as Euler angles.
#define MRPT_UNUSED_PARAM(a)
Determines whether this is an X86 or AMD64 platform.
Message m_msg
The message.
bool updateStatus(const uint8_t data, const uint16_t index=0)
Add/update Status information for the item.
uint8_t getStatus(const uint16_t index=0) const
Return the Status component of a data item.