1 #ifndef XSENS_MONOLITHIC
24 #ifndef XSENS_MONOLITHIC
158 bool isXm(
void)
const;
A structure for storing sync in settings.
Definition: cmtdef.h:967
bool m_readFromFile
Indicates whether to read from the log file or from the serial port.
Definition: cmt3.h:64
XsensResultValue setSyncOutSkipFactor(const uint16_t skipFactor)
Set the outbound synchronization skip factor of an MT device.
Definition: cmt3.cpp:2710
XsensResultValue setScenario(const uint8_t scenarioType, const CmtDeviceId deviceId=CMT_DID_MASTER)
Specify the scenario to use in the sensor.
Definition: cmt3.cpp:3273
XsensResultValue getEMtsData(void *buffer, const CmtDeviceId deviceId=CMT_DID_MASTER)
Retrieve the eMts data of the specified sensor(s).
Definition: cmt3.cpp:683
XsensResultValue setObjectAlignmentMatrix(const CmtMatrix &matrix, const CmtDeviceId deviceId=CMT_DID_MASTER)
Set the currently used object alignment matrix.
Definition: cmt3.cpp:2371
uint32_t m_rtcCount
The long sample counter (normal counter wraps at 64k).
Definition: cmt3.h:51
XsensResultValue getDataLength(uint32_t &length, const CmtDeviceId deviceId=CMT_DID_MASTER)
Retrieve data size.
Definition: cmt3.cpp:595
XsensResultValue openLogFile(const char *filename)
Open a log file for input.
Definition: cmt3.cpp:3105
XsensResultValue getConfiguration(CmtDeviceConfiguration &configuration)
Get device configuration.
Definition: cmt3.cpp:540
bool isLogging(void) const
<
Definition: cmt3.h:152
XsensResultValue getLogFileName(char *filename)
Retrieve the name of the open log file or an empty string if no logfile is open.
Definition: cmt3.cpp:996
XsensResultValue getSyncOutMode(uint16_t &mode)
Retrieve the outbound synchronization mode of an MT device.
Definition: cmt3.cpp:1387
XsensResultValue setLocationId(uint16_t locationId, const CmtDeviceId deviceId=CMT_DID_MASTER)
Set the location ID of a sensor.
Definition: cmt3.cpp:2351
XsensResultValue getLogFileSize(XsensFilePos &size)
Retrieve the size of the open log file in bytes.
Definition: cmt3.cpp:980
CmtDeviceId getMasterId(void)
Definition: cmt3.cpp:1034
XsensResultValue storeXkfState(const CmtDeviceId deviceId=CMT_DID_MASTER)
Store important components of the XKF filter state to non-volatile memory.
Definition: cmt3.cpp:3376
Contains the CMT Packet interface.
XsensResultValue m_lastHwError
Contains the last error reported by hardware.
Definition: cmt3.h:66
CmtDeviceConfiguration m_config
Cached configuration data.
Definition: cmt3.h:75
XsensResultValue getLastResult(void) const
<
Definition: cmt3.h:109
XsensResultValue setTimeoutConfig(const uint32_t timeout=CMT3_DEFAULT_TIMEOUT_CONF)
Set the configuration mode timeout.
Definition: cmt3.cpp:2767
XsensResultValue getFirmwareRevision(CmtVersion &revision, const CmtDeviceId deviceId=CMT_DID_MASTER)
Return Firmware revision.
Definition: cmt3.cpp:910
XsensResultValue setHeading(const double heading, const CmtDeviceId deviceId=CMT_DID_MASTER)
Set the heading offset.
Definition: cmt3.cpp:2303
XsensResultValue getHwError(CmtDeviceId &did) const
<
Definition: cmt3.h:111
XsensResultValue setTimeout(const uint32_t ms=CMT2_DEFAULT_TIMEOUT)
Set the default timeout value to use in blocking operations.
Definition: cmt2.cpp:342
bool m_detailedScan
Automatically scan for device details during open. Default is true (recommended). ...
Definition: cmt3.h:63
XsensResultValue getGpsStatus(CmtGpsStatus &status, const CmtDeviceId deviceId=CMT_DID_MASTER)
Request the status of the GPS satellites in orbit.
Definition: cmt3.cpp:3325
XsensResultValue getDeviceId(const uint8_t busId, CmtDeviceId &deviceId) const
Retrieve the DeviceId of a device given its Bus ID.
Definition: cmt3.cpp:622
Cmt3()
Default constructor, initializes all members to their default values.
Definition: cmt3.cpp:311
bool isXm(void) const
Return whether the main device is an Xbus Master or not.
Definition: cmt3.cpp:1646
XsensResultValue getGravityMagnitude(double &magnitude, const CmtDeviceId deviceId=CMT_DID_MASTER)
Retrieve the currently used magnitude of the gravity vector.
Definition: cmt3.cpp:3294
XsensResultValue setLatLonAlt(const CmtVector &lla, const CmtDeviceId deviceId=CMT_DID_MASTER)
Set the current sensor position.
Definition: cmt3.cpp:2314
XsensResultValue getDeviceMode(CmtDeviceMode &mode, const CmtDeviceId deviceId=CMT_DID_MASTER)
Return device mode.
Definition: cmt3.cpp:640
XsensResultValue getSyncInOffset(uint32_t &offset)
Retrieve the inbound synchronization offset of an MT device.
Definition: cmt3.cpp:1288
void fillRtc(Packet *pack)
Internal function to compute the RTC value.
Definition: cmt3.cpp:365
XsensResultValue getBusPowerState(bool &enabled)
Get the state of the Xbus power.
Definition: cmt3.cpp:516
CmtDeviceId m_lastHwErrorDeviceId
Contains the Device ID of the device that caused the last hardware error.
Definition: cmt3.h:67
XsensResultValue getSyncInSkipFactor(uint16_t &skipFactor)
Retrieve the inbound synchronization skip factor of an MT device.
Definition: cmt3.cpp:1263
#define CMT_DEFAULT_BAUD_RATE
The default baud rate of the Cmt1s serial communication.
Definition: cmtdef.h:828
XsensResultValue setSyncInSkipFactor(const uint16_t skipFactor)
Set the inbound synchronization skip factor of an MT device.
Definition: cmt3.cpp:2520
XsensResultValue setDeviceMode(const CmtDeviceMode &mode, bool force, const CmtDeviceId deviceId=CMT_DID_MASTER)
Set the complete output mode of a device.
Definition: cmt3.cpp:2133
XsensResultValue getSerialBaudrate(uint32_t &baudrate)
Return the baud rate used for serial communication.
Definition: cmt3.cpp:1137
XsensResultValue setXmOutputMode(const uint8_t mode)
Set the dual-output mode of the XM.
Definition: cmt3.cpp:2807
XsensResultValue getBusId(uint8_t &busId, const CmtDeviceId deviceId=CMT_DID_MASTER) const
Retrieve the BusId of a device.
Definition: cmt3.cpp:474
XsensResultValue getDeviceMode2(CmtDeviceMode2 &mode, const CmtDeviceId deviceId=CMT_DID_MASTER)
Return device mode2.
Definition: cmt3.cpp:658
XsensResultValue getProductCode(char *productCode, const CmtDeviceId deviceId=CMT_DID_MASTER)
Return product code.
Definition: cmt3.cpp:1109
void clearHwError(void)
Definition: cmt3.h:113
uint32_t getTimeoutConfig(void) const
Return the configuration mode timeout.
Definition: cmt3.cpp:1492
XsensResultValue readDataPacket(Packet *pack, bool acceptOther=false)
Retrieve a data message.
Definition: cmt3.cpp:1798
XsensResultValue setSyncMode(const uint8_t mode)
Set the sync mode of the Xbus Master.
Definition: cmt3.cpp:2579
XsensResultValue
Xsens return values.
Definition: xsens_std.h:43
bool isOpen(void) const
Return whether the communication port is open or not.
Definition: cmt2.h:117
xsens::TimeSync m_rtcSync
Used for synchronizing MT timestamps to system timestamps.
Definition: cmt3.h:53
XsensResultValue getSyncOutSkipFactor(uint16_t &skipFactor)
Retrieve the outbound synchronization skip factor of an MT device.
Definition: cmt3.cpp:1440
Cmt2s * getCmt2s(void)
Return a reference to the embedded Cmt2s (comm port) object.
Definition: cmt3.cpp:533
XsensResultValue reset(void)
Request a data message and wait for it to arrive.
Definition: cmt3.cpp:1923
XsensResultValue getXmOutputMode(uint8_t &mode)
Return the dual-output mode of the XM.
Definition: cmt3.cpp:1542
XsensResultValue setBaudrate(const uint32_t baudrate, bool reconnect=true)
Set the baudrate and possibly reconnect.
Definition: cmt3.cpp:2013
uint16_t m_period
The sample period of the port.
Definition: cmt3.h:48
bool isLogFileOpen(const char *filename) const
Return whether or not(true or false) the supplied file is open.
Definition: cmt3.cpp:3040
A structure containing MT data + timestamp and formatting information.
Definition: cmtpacket.h:43
XsensResultValue getLatLonAlt(CmtVector &lla, const CmtDeviceId deviceId=CMT_DID_MASTER)
Retrieve the last stored sensor position.
Definition: cmt3.cpp:938
XsensResultValue getTransmissionDelay(uint16_t &delay, const CmtDeviceId deviceId=CMT_DID_MASTER)
Return the RS485 acknowledge transmission delay of the device.
Definition: cmt3.cpp:1505
High-level communication class.
Definition: cmt3.h:43
Definition: cmtdef.h:1224
~Cmt3()
Destructor, de-initializes, frees memory allocated for buffers, etc.
Definition: cmt3.cpp:334
uint16_t m_skip
The skip factor of the port.
Definition: cmt3.h:49
XsensResultValue getMagneticDeclination(double &declination, const CmtDeviceId deviceId=CMT_DID_MASTER)
Return the stored magnetic declination.
Definition: cmt3.cpp:1022
XsensResultValue setSyncInSettings(const CmtSyncInSettings &settings)
Set the inbound synchronization settings of an MT device.
Definition: cmt3.cpp:2442
XsensResultValue closeLogFile(bool del=false)
Close an open log file.
Definition: cmt3.cpp:3021
uint32_t m_baudrate
The baudrate that was last set to be used by the port.
Definition: cmt3.h:56
XsensResultValue getSyncInMode(uint16_t &mode)
Retrieve the inbound synchronization mode of an MT device.
Definition: cmt3.cpp:1238
XsensResultValue getScenario(uint8_t &scenarioType, uint8_t &scenarioVersion, const CmtDeviceId deviceId=CMT_DID_MASTER)
Get the currently active scenario from a Motion Tracker.
Definition: cmt3.cpp:3262
XsensResultValue resetLogFileReadPos(void)
Restart reading from the start of the open log file.
Definition: cmt3.cpp:3212
#define CMT_DID_MASTER
Definition: cmtdef.h:963
XsensResultValue getErrorMode(uint16_t &mode, const CmtDeviceId deviceId=CMT_DID_MASTER)
Return the error mode of the device.
Definition: cmt3.cpp:840
uint16_t getSampleFrequency(void)
Return current sample frequency.
Definition: cmt3.cpp:1125
XsensResultValue m_lastResult
The last result of an operation.
Definition: cmt3.h:59
XsensResultValue setBluetoothState(const bool enabled)
Set the Bluetooth state of the Xbus Master.
Definition: cmt3.cpp:2109
XsensResultValue setNoRotation(const uint16_t duration, const CmtDeviceId deviceId=CMT_DID_MASTER)
Initiates the XKF3 'no rotation' update procedure.
Definition: cmt3.cpp:1976
uint16_t m_firstItem
The index of the first formatting item.
Definition: cmt3.h:60
A structure for storing scenario information.
Definition: cmtdef.h:1093
Definition: cmtdef.h:1199
XsensResultValue setTransmissionDelay(const uint16_t delay)
Set the RS485 acknowledge transmission delay of the device.
Definition: cmt3.cpp:2793
XsensResultValue getMtDeviceId(const uint8_t index, CmtDeviceId &deviceId) const
Definition: cmt3.cpp:1056
bool m_logging
Indicates whether to write all received messages to the logfile or not, automatically set to true by ...
Definition: cmt3.h:65
uint16_t getMtCount(void) const
Return the device Id of the first device (master).
Definition: cmt3.cpp:1045
XsensResultValue getSyncOutOffset(uint32_t &offset)
Retrieve the outbound synchronization offset of an MT device.
Definition: cmt3.cpp:1465
XsensResultValue setGravityMagnitude(const double magnitude, const CmtDeviceId deviceId=CMT_DID_MASTER)
Set the currently used magnitude of the gravity vector.
Definition: cmt3.cpp:3304
bool m_measuring
Keeps track of whether the connected device is measuring or being configured.
Definition: cmt3.h:62
XsensResultValue getBaudrate(uint32_t &baudrate)
Get the baudrate used by a port.
Definition: cmt3.cpp:449
XsensResultValue peekLogMessageId(uint8_t &messageId)
Open a communication channel to the given COM port number.
Definition: cmt3.cpp:1772
XsensResultValue setBusPowerState(const bool enabled)
Switch the Xbus Master bus power on or off.
Definition: cmt3.cpp:2121
XsensResultValue getUtcTime(CmtUtcTime &utc, const CmtDeviceId deviceId)
Return the UTC time of the last received sample.
Definition: cmt3.cpp:1518
XsensResultValue waitForDataMessage(Packet *pack)
Wait for a data message to arrive.
Definition: cmt3.cpp:2899
void * m_eMtsData[CMT_MAX_DEVICES_PER_PORT]
Cached eMTS data.
Definition: cmt3.h:74
XsensResultValue setXmPowerOff(void)
Switch the connected Xbus Master.
Definition: cmt3.cpp:2428
XsensResultValue getBluetoothState(bool &enabled)
Get the state of the bluetooth communication.
Definition: cmt3.cpp:462
XsensResultValue resetOrientation(const CmtResetMethod method, const CmtDeviceId deviceId=CMT_DID_MASTER)
Perform an orientation reset on a device.
Definition: cmt3.cpp:1947
XsensResultValue setSyncInMode(const uint16_t mode)
Set the inbound synchronization mode of an MT device.
Definition: cmt3.cpp:2492
XsensResultValue gotoConfig(void)
Place all connected devices into Configuration Mode.
Definition: cmt3.cpp:1554
Class for storing a single message.
Definition: cmtmessage.h:76
XsensResultValue initBus(void)
Perform an initBus request.
Definition: cmt3.cpp:1635
Contains the CMT Level 2 interface.
XsensResultValue getSyncInSettings(CmtSyncInSettings &settings)
Retrieve the inbound synchronization settings of the master MT device.
Definition: cmt3.cpp:1190
XsensResultValue setMagneticDeclination(const double declination, const CmtDeviceId deviceId=CMT_DID_MASTER)
Set the stored magnetic declination.
Definition: cmt3.cpp:2362
XsensResultValue getBatteryLevel(uint8_t &level)
Get an Xbus Master's battery level.
Definition: cmt3.cpp:437
uint32_t getDeviceCount(void) const
Retrieve total device count.
Definition: cmt3.cpp:607
CmtMtTimeStamp m_rtcLastSc
The last received sample counter, used to determine wrap-around.
Definition: cmt3.h:52
Cmt2f m_logFile
The (optional) CMT level 2 logfile object that this class operates on.
Definition: cmt3.h:47
XsensResultValue getLocationId(uint16_t &locationId, const CmtDeviceId deviceId=CMT_DID_MASTER)
Return the location ID of a sensor.
Definition: cmt3.cpp:952
XsensResultValue writeMessageToLogFile(const Message &msg)
Definition: cmt3.cpp:3221
XsensResultValue getHeading(double &heading, const CmtDeviceId deviceId=CMT_DID_MASTER)
Return the heading offset.
Definition: cmt3.cpp:926
XsensResultValue setProcessingFlags(uint16_t processingFlags, const CmtDeviceId deviceId=CMT_DID_MASTER)
Set the processing flags of a sensor.
Definition: cmt3.cpp:2417
#define CMT_DEFAULT_WRITE_BUFFER_SIZE
The default size of the serial write buffer in bytes.
Definition: cmtdef.h:826
XsensResultValue getLogFileReadPosition(XsensFilePos &pos)
Retrieve the read position of the log file.
Definition: cmt3.cpp:964
XsensResultValue setDataSource(bool readFromFile)
Set whether to read from comm port or file.
Definition: cmt3.cpp:3169
XsensResultValue setSyncOutSettings(const CmtSyncOutSettings &settings)
Set the outbound synchronization settings of an MT device.
Definition: cmt3.cpp:2593
uint32_t m_timeoutMeas
The measurement mode timeout.
Definition: cmt3.h:58
Cmt2s m_serial
The (optional) CMT level 2 serial object that this class operates on.
Definition: cmt3.h:46
#define CMT3_DEFAULT_TIMEOUT_MEAS
The default timeout value for L3 data reading.
Definition: cmtdef.h:839
XsensResultValue setSyncInOffset(const uint32_t offset)
Set the inbound synchronization offset of an MT device.
Definition: cmt3.cpp:2548
uint32_t m_readBufSize
Contains the size of the serial read buffer.
Definition: cmt3.h:69
XsensResultValue getSyncOutSettings(CmtSyncOutSettings &settings)
Retrieve the outbound synchronization settings of the master MT device.
Definition: cmt3.cpp:1328
XsensResultValue setGotoConfigTries(const uint16_t tries)
Set the number of times the gotoConfig function will attempt a gotoConfig before failing.
Definition: cmt3.cpp:2292
uint16_t m_gotoConfigTries
The number of times a goto config is attempted before the function fails.
Definition: cmt3.h:61
XsensResultValue requestData(Packet *pack, const uint8_t *data=0, const uint16_t count=0)
Definition: cmt3.cpp:1889
Class for synchronizing two clocks.
Definition: xsens_time.h:64
XsensResultValue setTimeoutMeasurement(const uint32_t timeout=CMT3_DEFAULT_TIMEOUT_MEAS)
Set the measurement mode timeout.
Definition: cmt3.cpp:2780
XsensResultValue runSelfTest(uint16_t &result, const CmtDeviceId deviceId=CMT_DID_MASTER)
Let the MT perform a self test. The status of the selftest can be viewed in the status byte...
Definition: cmt3.cpp:1958
XsensResultValue getSyncMode(uint8_t &mode)
Retrieve the sync mode of the Xbus Master.
Definition: cmt3.cpp:1316
Mid-level serial communication class.
Definition: cmt2.h:48
XsensResultValue getPortNr(uint16_t &port) const
Return the port number that this object is connected to.
Definition: cmt3.cpp:1087
uint32_t m_writeBufSize
Contains the size of the serial write buffer.
Definition: cmt3.h:70
A structure for storing the firmware version.
Definition: cmtdef.h:886
bool m_useRtc
Indicates if the RTC should be computed or not (to save CPU time).
Definition: cmt3.h:73
XsensResultValue setGpsLeverArm(const CmtVector &arm, const CmtDeviceId deviceId=CMT_DID_MASTER)
Set the currently used GPS lever arm.
Definition: cmt3.cpp:3341
CmtResetMethod
Definition: cmtdef.h:866
XsensResultValue setDeviceMode2(const CmtDeviceMode2 &mode, bool force, const CmtDeviceId deviceId=CMT_DID_MASTER)
Set the complete output mode2 of a device.
Definition: cmt3.cpp:2148
A structure for storing UTC Time values.
Definition: cmtdef.h:1000
XsensResultValue setTimeout(const uint32_t ms)
Definition: cmt3.h:199
0: Operation was performed successfully
Definition: xsens_std.h:45
XsensResultValue getSyncOutPulseWidth(uint32_t &pulseWidth)
Retrieve the outbound synchronization pulse width of an MT device.
Definition: cmt3.cpp:1412
XsensResultValue getObjectAlignmentMatrix(CmtMatrix &matrix, const CmtDeviceId deviceId=CMT_DID_MASTER)
Return the device Id of an MT device.
Definition: cmt3.cpp:1067
XsensResultValue createLogFile(const char *filename, bool startLogging=false)
Create a log file for incoming messages.
Definition: cmt3.cpp:2939
XsensResultValue getAvailableScenarios(CmtScenario *scenarios, const CmtDeviceId deviceId=CMT_DID_MASTER)
Write the specified message to the open log file.
Definition: cmt3.cpp:3233
XsensResultValue setSyncOutOffset(const uint32_t offset)
Set the outbound synchronization offset of an MT device.
Definition: cmt3.cpp:2738
Structure containing a full device configuration as returned by the ReqConfig message.
Definition: cmtdef.h:899
uint32_t m_timeoutConf
The config mode timeout.
Definition: cmt3.h:57
XsensResultValue openPort(const char *portName, const uint32_t baudRate=CMT_DEFAULT_BAUD_RATE, uint32_t readBufSize=CMT_DEFAULT_READ_BUFFER_SIZE, uint32_t writeBufSize=CMT_DEFAULT_WRITE_BUFFER_SIZE)
Definition: cmt3.cpp:1653
bool isReadingFromFile(void) const
<
Definition: cmt3.h:154
A structure for storing device modes.
Definition: cmtdef.h:1013
XsensResultValue setSyncOutMode(const uint16_t mode)
Set the outbound synchronization mode of an MT device.
Definition: cmt3.cpp:2653
Definition: cmtdef.h:1213
#define CMT_DEFAULT_READ_BUFFER_SIZE
The default size of the serial read buffer in bytes.
Definition: cmtdef.h:824
XsensResultValue getGpsLeverArm(CmtVector &arm, const CmtDeviceId deviceId=CMT_DID_MASTER)
Get the currently used GPS lever arm.
Definition: cmt3.cpp:3313
uint32_t getTimeoutMeasurement(void) const
Return the measurement mode timeout.
Definition: cmt3.cpp:1498
bool m_rtcInitialized
Indicates whether the RTC synchronization isinitialized.
Definition: cmt3.h:54
#define CMT_MAX_DEVICES_PER_PORT
Definition: cmtdef.h:806
XsensResultValue restoreFactoryDefaults(const CmtDeviceId deviceId=CMT_DID_MASTER)
Restore the device to factory default settings.
Definition: cmt3.cpp:1987
A structure for storing sync out settings.
Definition: cmtdef.h:982
bool isPortOpen(void) const
<
Definition: cmt3.h:156
uint32_t CmtDeviceId
The type of a Device Id.
Definition: cmtdef.h:883
XsensResultValue getProcessingFlags(uint16_t &processingFlags, const CmtDeviceId deviceId=CMT_DID_MASTER)
Return the processing flags of a sensor.
Definition: cmt3.cpp:1097
uint16_t CmtMtTimeStamp
An MT timestamp (sample count)
Definition: cmtdef.h:958
uint8_t getBusIdInternal(const CmtDeviceId devId) const
Find a device Id in the list and return its busId.
Definition: cmt3.cpp:495
Cmt2f * getCmt2f(void)
Return a reference to the embedded Cmt2f (logfile) object.
Definition: cmt3.cpp:527
XsensResultValue setErrorMode(const uint16_t mode)
Set the error mode of the device.
Definition: cmt3.cpp:2275
XsensResultValue refreshCache(const bool file=false)
Update device information stored on host PC.
Definition: cmt3.cpp:2820
XsensResultValue closePort(bool gotoConfigFirst=true)
Close the communication port.
Definition: cmt3.cpp:346
#define CMT3_DEFAULT_TIMEOUT_CONF
The default timeout value for L3 configuration settings.
Definition: cmtdef.h:841
XsensResultValue setSyncOutPulseWidth(const uint32_t pulseWidth)
Set the outbound synchronization pulse width of an MT device.
Definition: cmt3.cpp:2681
__off64_t XsensFilePos
Definition: xsens_file.h:21
XsensResultValue gotoMeasurement(void)
Place all connected devices into Measurement Mode.
Definition: cmt3.cpp:1611
The mid-level file communication class.
Definition: cmt2.h:180
XsensResultValue setLogMode(bool active)
Set the logging mode.
Definition: cmt3.cpp:3200
A structure for storing device modes using period and skip factor (new default)
Definition: cmtdef.h:1052