24 # define PACKETLOG XSENSLOG 26 # define PACKETLOG(...) (void)0 32 #define FORMAT_DOUBLE ((m_fixedData->m_formatList[index].m_outputSettings & XOS_Dataformat_Mask)|XOS_Dataformat_Double) 33 #define ISDOUBLE(a) (m_fixedData->m_infoList[index].a >= m_fixedData->m_infoList[index].m_doubleBoundary) 34 #define CHECKIFDOUBLE(a) ISDOUBLE(a)?FORMAT_DOUBLE:m_fixedData->m_formatList[index].m_outputSettings 51 PACKETLOG(
"%s creating default %p\n", __FUNCTION__,
this);
70 PACKETLOG(
"%s creating %p with %d items and xbus option %d\n", __FUNCTION__,
this,
count, xbus);
86 PACKETLOG(
"%s creating %p from %p\n", __FUNCTION__,
this, &other);
88 PACKETLOG(
"%s creating %p from %p done\n", __FUNCTION__,
this, &other);
95 PACKETLOG(
"%s copying from %p to %p\n", __FUNCTION__, &pack,
this);
116 PACKETLOG(
"%s copying from %p to %p done\n", __FUNCTION__, &pack,
this);
124 PACKETLOG(
"%s destroying %p\n", __FUNCTION__,
this);
127 PACKETLOG(
"%s destroyed %p\n", __FUNCTION__,
this);
161 m_toa = timeofarrival;
175 m_rtc = realtimeclock;
210 if (originalSize ==
m_msg.getDataSize())
214 m.resizeData(originalSize);
215 m.setDataBuffer(
m_msg.getDataBuffer(), originalSize);
216 m.recomputeChecksum();
402 m_msg.insertData(2,0);
403 m_msg.setDataShort(stamp,0);
411 m_msg.deleteData(2,0);
543 totalOffset += 13+13*ds;
629 for(
int j = 0; j < tCount; j++)
996 for(
int i =
c; i <= channel; i++)
1047 m_msg.resizeData(
m_msg.getDataSize() + 3* 3*2 + 2);
1127 m_msg.resizeData(
m_msg.getDataSize() + (2+1) + (40 + 1));
1209 m_msg.resizeData(
m_msg.getDataSize() + (2+1));
1248 buffer.m_firstFrameNumber = 0;
1249 buffer.m_lastFrameNumber = 0;
1250 buffer.m_currentBias.zero();
1255 buffer.m_orientationIncrement = XsQuaternion::identity();
1256 buffer.m_velocityIncrement.zero();
1257 buffer.m_magnetoMeter.zero();
1287 m_msg.resizeData(
m_msg.getDataSize() + 13 + 13*ds);
1352 for(
int i =
c; i <= channel; i++)
1406 m_msg.resizeData(
m_msg.getDataSize() + numValues*ds);
1448 m_msg.resizeData(
m_msg.getDataSize() + numValues*ds);
1490 m_msg.resizeData(
m_msg.getDataSize() + numValues*ds);
1508 double* bare = &
buffer.m_acc[0];
1510 memset(bare, 0, 3*
sizeof(
double));
1516 memset(bare, 0, 3*
sizeof(
double));
1522 memset(bare, 0, 3*
sizeof(
double));
1562 m_msg.resizeData(
m_msg.getDataSize() + numValues*ds);
1569 double* bare = (
double*) &
data;
1617 m_msg.resizeData(
m_msg.getDataSize() + numValues*ds);
1620 double* bare = (
double*) &
data;
1667 m_msg.resizeData(
m_msg.getDataSize() + numValues*ds);
1686 for (
int32_t j=0;j<3;++j, k+=ds)
1718 m_msg.resizeData(
m_msg.getDataSize() + numValues*ds);
1724 for (
int32_t j=0;j<3;++j, k+=ds)
1842 m_msg.resizeData(
m_msg.getDataSize() + numValues*ds);
1884 m_msg.resizeData(
m_msg.getDataSize() + numValues*ds);
1896 assert(outIsDetailed != 0);
1901 *outIsDetailed =
false;
1906 *outIsDetailed =
true;
2079 m_msg.resizeData(
m_msg.getDataSize() + numValues*ds);
XsOutputMode
Bit values for legacy output mode.
uint16_t m_rawData
Offset of raw data.
bool containsMtwSdiData(int32_t index=0) const
Check if data item contains strapdown integration data.
#define XS_EXTRA_TEMPERATURE_CHANNELS
bool setMtwSdiData(const MtwSdiData &data, int32_t index=0)
Add/update strapdown integration data for the item.
uint16_t m_offset
Offset of first data byte (whatever it is)
uint16_t itemCount(void) const
Returns the number of devices whose data is contained in the object.
XsSize dataSize(int32_t index=0) const
Returns the size of the data.
MtwSdiData mtwSdiData(int32_t index=0) const
Return the strapdown integration (SDI) data component of a data item.
GLuint GLuint GLsizei count
bool containsOrientation(int32_t index=0) const
Check if data item contains Orientation Data of any kind.
XsDataFormat * m_formatList
A list of the formats of the data items.
XsVector freeAcceleration(int32_t index=0) const
Return the Acc-G component of the packet.
XsScrData rawData(int32_t index=0) const
Return the Raw Data component of a data item.
XsTimeStamp rtc(void) const
Returns the Real Time Clock value as stored in the object.
uint16_t rawTemperature(int32_t index=0, int channel=0) const
Return the Raw Temperature component of a data item.
uint16_t m_gpsPvtLatitude
Offset of raw GPS latitude data.
PacketFixedData * m_fixedData
Fixed packet data.
bool containsOrientationMatrix(int32_t index=0) const
Check if data item contains Matrix Orientation data.
uint16_t m_gpsPvtGpsData
Offset of raw GPS data.
unsigned __int16 uint16_t
#define XS_MAX_TEMPERATURE_CHANNELS
struct XsPressure XsPressure
uint16_t m_wClientId
Offset of MTw SDI client ID data.
uint16_t m_gpsPvtVeld
Offset of raw GPS dowanward velocity data.
uint16_t m_utcMonth
Offset of month part of UTC time.
void setMessage(const XsMessage &message)
Set the source message to msg.
bool setRawMagneticField(const XsUShortVector &vec, int32_t index=0)
Add/update Raw Magnetometer data for the item.
uint16_t m_gpsPvtLongitude
Offset of raw GPS longitude data.
XsUtcTime utcTime(int32_t index=0) const
Return the UTC Time component of the packet.
uint16_t m_wAidingData
Offset of MTw SDI aiding data.
bool setTriggerIndication(int channelID, const XsTimeStamp &t)
Add/update trigger indication time for the item to the given line.
uint16_t m_wTimeSync
Offset of MTw SDI time sync data.
int temperatureChannelCount(int32_t index=0) const
Returns the number of temperature channels.
XsMessage m_msg
The message.
uint16_t m_rawAcc
Offset of raw acceleration data.
bool containsOrientationEuler(int32_t index=0) const
Check if data item contains Euler Orientation data.
bool containsRawData(int32_t index=0) const
Check if data item contains Raw Data.
uint16_t m_wFirstFrameNumber
Offset of MTw SDI first frame number in interval data.
bool setRawTemperature(uint16_t temp, int32_t index=0, int channel=0)
Add/update Raw Temperature data for the item.
A vector containing 3 short values.
uint16_t m_velNEDorNWU
Offset of velocity data.
uint16_t m_gpsPvtPressure
Offset of pressure data.
uint16_t m_gpsPvtHeight
Offset of raw GPS height data.
uint16_t m_utcTime
Offset of UTC time data.
Class to store strapdown integration data.
uint16_t m_gpsPvtVacc
Offset of raw GPS vertical accuracy estimate data.
bool setDataFormat(const XsDataFormat &format, int32_t index=0)
Sets the data format of the device with the given index to format.
uint16_t m_rawTemp[XS_MAX_TEMPERATURE_CHANNELS]
Offset of raw temperature data. Note that usually only the first item is used.
uint16_t m_calMag
Offset of calibrated magnetometer data.
bool setGpsPvtData(const XsGpsPvtData &data, int32_t index=0)
Add/update Gps PVT Data for the item.
uint16_t m_calAcc
Offset of calibrated acceleration data.
int32_t findDeviceId(XsDeviceId dev) const
Returns the index of the fixed data with id dev.
bool setOrientationQuaternion(const XsQuaternion &data, int32_t index=0)
Add/update Quaternion Orientation data for the item.
int rawTemperatureChannelCount(int32_t index=0) const
Returns the number of available Raw Temperature channels.
uint16_t m_utcValid
Offset of validity part of UTC time.
size_t XsSize
XsSize must be unsigned number!
uint16_t m_oriQuat
Offset of orientation in quaternion format.
XsUShortVector rawGyroscopeData(int32_t index=0) const
Return the Raw Gyroscope component of a data item.
uint16_t m_mtwSdiData
Offset of MTw SDI data.
bool setAnalogIn2Data(const XsAnalogInData &data, int32_t index=0)
Add/update AnalogIn 2 for the item.
XsEuler orientationEuler(int32_t index=0) const
Return the Orientation component of a data item as Euler angles.
uint16_t m_status
Offset of status data.
bool setTemperature(const double &temp, int32_t index=0, int channel=0)
Add/update Calibrated Accelerometer data for the item.
uint16_t m_utcSecond
Offset of second part of UTC time.
uint16_t m_gpsPvtPressureAge
Offset of pressure age.
uint16_t m_oriEul
Offset of orientation in euler format.
uint16_t m_rawGyr
Offset of raw gyroscope data.
uint16_t m_wCurrentBias
Offset of MTw SDI gyroscope bias data.
uint16_t m_itemCount
The number of data items in the message.
bool containsFreeAcceleration(int32_t index=0) const
Check if data item contains XKF-3 Acc-G data.
double temperature(int32_t index=0, int channel=0) const
Return the Temperature component of a data item.
uint16_t m_gpsPvtItow
Offset of raw GPS ITOW (Integer Time Of Week) data.
struct XsUtcTime XsUtcTime
uint16_t m_doubleBoundary
Boundary where the original data format is ignored and values are stored in double precision...
XsUShortVector rawAcceleration(int32_t index=0) const
The Raw Accelerometer component of a data item.
uint16_t m_gpsPvtGpsAge
Offset of raw GPS age.
XsVector positionLLA(int32_t index=0) const
Return the Position Lat Lon Alt component of a data item.
LegacyDataPacket()
Construct a new LegacyDataPacket without data. The LegacyDataPacket will be invalid.
XsDataFormat dataFormat(int32_t index=0) const
Returns the data format of the device with the given index.
uint16_t m_gpsPvtData
Offset of GPS & pressure data.
uint16_t m_calGyr
Offset of calibrated gyroscope data.
bool setRawGyroscopeData(const XsUShortVector &vec, int32_t index=0)
Add/update Raw Gyroscope data for the item.
bool containsTriggerIndication(int channelID=0) const
Check if data item contains indication time on the given line.
XsAnalogInData analogIn2Data(int32_t index=0) const
Return the AnalogIn 2 component of a data item.
bool containsCalibratedData(int32_t index=0) const
Check if data item contains Calibrated Data.
bool containsCalibratedAcceleration(int32_t index=0) const
Check if data item contains Calibrated Accelerometer data.
uint16_t m_utcHour
Offset of hour part of UTC time.
Contains offset information about data in the packet.
XsVector calibratedGyroscopeData(int32_t index=0) const
Return the Calibrated Gyroscope component of a data item.
int64_t largePacketCounter(void) const
Return the 64-bit sample counter associated with this packet.
uint16_t m_analogIn1
Offset of analog in channel 1 data.
Structure for storing a single message.
XsGpsPvtData gpsPvtData(int32_t index=0) const
Return the Gps PVT data component of a data item.
bool setAnalogIn1Data(const XsAnalogInData &data, int32_t index=0)
Add/update AnalogIn 1 for the item.
uint16_t m_wVelocityIncrement
Offset of MTw SDI velocity increment data.
bool containsCalibratedMagneticField(int32_t index=0) const
Check if data item contains Calibrated Magnetometer data.
uint16_t m_oriMat
Offset of orientation in matrix format.
uint16_t m_gpsPvtSacc
Offset of raw GPS speed accuracy estimate data.
bool setFreeAcceleration(const XsVector &g, int32_t index=0)
Add/update XKF-3 Acc-G data for the item.
bool setPacketCounter(const uint16_t counter, int32_t index=0)
Add/update Sample Counter for all items.
PacketInfo * m_infoList
Contains information about data in the packet and the format of that data.
uint16_t m_wRssi
Offset of MTw SDI RSSI data.
void setDeviceId(XsDeviceId deviceId, int32_t index)
Sets the device ID of the device with the given index to deviceid.
bool setUtcTime(const XsUtcTime &data, int32_t index=0)
Add/update UTC Time for all items.
uint16_t m_rawMag
Offset of raw magnetometer data.
bool containsUtcTime(int32_t index=0) const
Check if data item contains UTC Time.
XsDeviceId deviceId(int32_t index) const
Returns the device ID of the device with the given index.
bool setVelocity(const XsVector &data, int32_t index=0)
Add/update Velocity for the item.
struct XsTimeStamp XsTimeStamp
uint16_t m_acc_g
Offset of acceleration in global frame.
bool setPositionLLA(const XsVector &data, int32_t index=0)
Add/update Position Lat Lon Alt for the item.
Class for managing timestamps in a unified way.
uint16_t m_lastFoundIndex
Index of last found deviceId, speeds up searches.
XsTimeStamp triggerIndication(int channelID) const
Return the synhcronization time recorded by the station.
void setItemCount(uint16_t count)
Set the number of devices whose data is contained in this object to count.
uint16_t m_temp[XS_MAX_TEMPERATURE_CHANNELS]
Offset of calibrated temperature data. Note that usually only the first item is used.
bool containsCalibratedGyroscopeData(int32_t index=0) const
Check if data item contains Calibrated Gyroscope data.
bool setPressure(const XsPressure &data, int32_t index=0)
Add/update pressure data for the item.
#define XS_DATA_ITEM_NOT_AVAILABLE
Indicates that a data item is not available in the packet.
XsQuaternion orientationQuaternion(int32_t index=0) const
Return the Orientation component of a data item as a Quaternion.
XsMessage originalMessage(void) const
Returns the original message as it was received, without computed and added data (except for SDI inte...
const LegacyDataPacket & operator=(const LegacyDataPacket &pack)
Assignment operator, copies the contents of pack into this.
bool containsRawTemperature(int32_t index=0, int channel=0) const
Check if data item contains Raw Temperature data.
uint16_t m_utcNano
Offset of nanosecond part of UTC time.
uint16_t m_wLastFrameNumber
Offset of MTw SDI last frame number in interval data.
Data from analog inputs from sensors.
uint16_t m_utcYear
Offset of year part of UTC time.
bool setStatus(const uint32_t data, int32_t index=0)
Add/update Status information for the item.
bool containsPacketCounter(int32_t index=0) const
Check if data item contains Sample Counter.
Contains an MTData XsMessage and supports functions for extracting contained data.
void setXbusSystem(bool xbus, bool convert=false)
Sets the xbus flag.
XsOutputSettings
Bit values for output settings.
bool containsRawMagneticField(int32_t index=0) const
Check if data item contains Raw Magnetometer data.
XsMessage message(void) const
Returns a copy of the XsMessage contained by the object, including computed and added data...
XsAnalogInData analogIn1Data(int32_t index=0) const
Return the AnalogIn 1 component of a data item.
uint16_t m_gpsPvtVele
Offset of raw GPS eastward velocity data.
uint16_t m_wBaroMeter
Offset of MTw SDI barometer data.
uint16_t m_detailedStatus
Offset of detailed status data.
bool setRawData(const XsScrData &data, int32_t index=0)
Add/update Raw Data for the item.
A structure for storing UTC Time values.
PacketInfo packetInfo(int32_t index) const
Returns the packet info for the index'th device in the packet.
uint16_t m_size
Total size of the data.
A structure containing fixed packet data, which should not change during a measurement for the same d...
bool containsPositionLLA(int32_t index=0) const
Check if data item contains Position Lat Lon Alt.
uint16_t m_gpsPvtVeln
Offset of raw GPS northward velocity data.
bool containsPressure(int32_t index=0) const
Return true if the packet contains pressure data.
XsTimeStamp m_triggerIn1
Trigger indication on line 1.
uint16_t packetCounter(int32_t index=0) const
Return the Sample Counter component of the packet.
XSTYPES_DLL_API int32_t XsMath_doubleToLong(double d)
uint32_t status(int32_t index, bool *outIsDetailed) const
Return the Status component of a data item.
void updateInfoList()
Update the internal info list by analyzing the known XsDataFormat for each device.
void setLargePacketCounter(int64_t sc)
Set the 64-bit sample counter associated with this packet.
bool containsOrientationQuaternion(int32_t index=0) const
Check if data item contains Quaternion Orientation data.
bool containsAnalogIn1Data(int32_t index=0) const
Check if data item contains AnalogIn 1.
uint16_t frameCounter() const
Return the frame counter (previously: sample counter) of the packet.
uint16_t m_gpsPvtHacc
Offset of raw GPS horizontal accuracy estimate data.
XsTimeStamp m_packetId
64 bit sample counter
XsUShortVector rawMagneticField(int32_t index=0) const
Return the Raw Magnetometer component of a data item.
void setTimeOfArrival(XsTimeStamp timeOfArrival)
Set the Time Of Arrival value to timeofarrival.
bool setRawAcceleration(const XsUShortVector &vec, int32_t index=0)
Add/update Raw Accelerometer data for the item.
uint16_t m_analogIn2
Offset of analog in channel 2 data.
XsVector calibratedAcceleration(int32_t index=0) const
Return the Calibrated Accelerometer component of a data item.
uint16_t XsMtTimeStamp
An MT timestamp (sample count)
GLenum GLsizei GLenum format
uint16_t m_utcMinute
Offset of minute part of UTC time.
XsDeviceId m_lastFoundId
Last found deviceId, speeds up searches.
bool setOrientationMatrix(const XsMatrix &data, int32_t index=0)
Add/update Matrix Orientation data for the item.
Container for raw sensor measurement data.
uint16_t m_calData
Offset of calibrated data.
XsCalibratedData calibratedData(int32_t index=0) const
Return the Calibrated Data component of a data item.
uint16_t getFPValueSize(int32_t index) const
Returns the floating/fixed point value size in bytes.
uint16_t m_wOrientationIncrement
Offset of MTw SDI orientation increment data.
bool containsAnalogIn2Data(int32_t index=0) const
Check if data item contains AnalogIn 2.
XsPressure pressure(int32_t index=0) const
Return the pressure data component of a data item.
void setRtc(XsTimeStamp rtc)
Set the Real Time Clock value to realtimeclock.
bool setCalibratedMagneticField(const XsVector &vec, int32_t index=0)
Add/update Calibrated Magnetometer data for the item.
bool containsVelocity(int32_t index=0) const
Check if data item contains Velocity.
bool containsStatus(int32_t index=0) const
Check if data item contains Status.
XsMatrix orientationMatrix(int32_t index=0) const
Return the Orientation component of a data item as an Orientation Matrix.
uint16_t m_wMagnetoMeter
Offset of MTw SDI magnetometer data.
bool containsDetailedStatus(int32_t index=0) const
Check if data item contains detailed Status information.
uint16_t m_posLLA
Offset of Latitude-Longitude-Altitude position data.
bool setCalibratedData(const XsCalibratedData &data, int32_t index=0)
Add/update Calibrated Data for the item.
uint16_t m_sc
Offset of sample counter.
XsTimeStamp m_rtc
Sample time in ms, based on the sample counter.
bool containsRawGyroscopeData(int32_t index=0) const
Check if data item contains Raw Gyroscope data.
unsigned __int32 uint32_t
~LegacyDataPacket()
Destructor.
XsVector calibratedMagneticField(int32_t index=0) const
Return the Calibrated Magnetometer component of a data item.
#define swapEndian16(src)
GLsizei GLsizei GLenum GLenum const GLvoid * data
bool containsTemperature(int32_t index=0, int channel=0) const
Check if data item contains Temperature data.
XsTimeStamp m_triggerIn2
Trigger indication on line 2.
bool setCalibratedAcceleration(const XsVector &vec, int32_t index=0)
Add/update Calibrated Accelerometer data for the item.
bool containsGpsPvtData(int32_t index=0) const
Check if data item contains Gps PVT Data.
XsVector velocity(int32_t index=0) const
Return the Velocity component of a data item.
bool isXbusSystem(void) const
Returns whether the xbus flag is set or not.
bool setCalibratedGyroscopeData(const XsVector &vec, int32_t index=0)
Add/update Calibrated Gyroscope data for the item.
bool setOrientationEuler(const XsEuler &data, int32_t index=0)
Add/update Euler Orientation data for the item.
XsTimeStamp m_toa
Time of arrival.
bool m_xm
Indicates that xbus-formatting is used.
XsTimeStamp timeOfArrival(void) const
Returns the Time Of Arrival value as stored in the object.
bool containsRawAcceleration(int32_t index=0) const
Check if data item contains Raw Accelerometer data.
Data from the GPS unit of a legacy MTi-G.
uint16_t m_utcDay
Offset of day part of UTC time.
XsDeviceId * m_idList
A list of the device-ids in this packet.