Go to the documentation of this file.
10 #ifndef _CMT3_H_2006_04_14
11 #define _CMT3_H_2006_04_14
13 #ifndef _CMT_MONOLITHIC
458 bool isXm(
void)
const;
461 const char* portName,
543 const uint32_t baudrate,
bool reconnect =
true);
762 const char* filename,
bool startLogging =
false);
775 const wchar_t* filename,
bool startLogging =
false);
931 #endif // _CMT3_H_2006_04_14
XsensResultValue openLogFile(const char *filename)
Open a log file for input.
CmtDeviceConfiguration m_config
The configuration of the connected devices.
XsensResultValue getGravityMagnitude(double &magnitude, const CmtDeviceId deviceId=CMT_DID_MASTER)
Retrieve the currently used magnitude of the gravity vector.
XsensResultValue getMagneticDeclination(double &declination, const CmtDeviceId deviceId=CMT_DID_MASTER)
Return the stored magnetic declination.
XsensResultValue setTimeout(const uint32_t ms=CMT2_DEFAULT_TIMEOUT)
Set the default timeout value to use in blocking operations.
XsensResultValue getBatteryLevel(uint8_t &level)
Get an Xbus Master's battery level.
XsensResultValue readDataPacket(Packet *pack, bool acceptOther=false)
Retrieve a data message.
XsensResultValue getLogFileName(char *filename)
Retrieve the name of the open log file or an empty string if no logfile is open.
A structure for storing device modes using period and skip factor (new default)
XsensResultValue setScenario(const uint8_t scenarioType, const CmtDeviceId deviceId=CMT_DID_MASTER)
Specify the scenario to use in the sensor.
uint16_t m_firstItem
The index of the first formatting item.
XsensResultValue getDeviceMode(CmtDeviceMode &mode, const CmtDeviceId deviceId=CMT_DID_MASTER)
Return device mode.
uint32_t getTimeoutMeasurement(void) const
Return the measurement mode timeout.
void * m_eMtsData[CMT_MAX_DEVICES_PER_PORT]
Cached eMTS data.
XsensResultValue m_lastResult
The last result of an operation.
XsensResultValue getDeviceMode2(CmtDeviceMode2 &mode, const CmtDeviceId deviceId=CMT_DID_MASTER)
Return device mode2.
XsensResultValue createLogFile(const char *filename, bool startLogging=false)
Create a log file for incoming messages.
#define CMT3_DEFAULT_TIMEOUT_CONF
The default timeout value for L3 configuration settings.
XsensResultValue getSyncOutSettings(CmtSyncOutSettings &settings)
Retrieve the outbound synchronization settings of the master MT device.
unsigned __int16 uint16_t
XsensResultValue setBusPowerState(const bool enabled)
Switch the Xbus Master bus power on or off.
XsensResultValue getBaudrate(uint32_t &baudrate)
Get the baudrate used by a port.
XsensResultValue setSyncInSkipFactor(const uint16_t skipFactor)
Set the inbound synchronization skip factor of an MT device.
XsensResultValue getXmOutputMode(uint8_t &mode)
Return the dual-output mode of the XM.
XsensResultValue peekLogMessageId(uint8_t &messageId)
Open a communication channel to.
XsensResultValue setDataSource(bool readFromFile)
Set whether to read from comm port or file.
XsensResultValue setGravityMagnitude(const double magnitude, const CmtDeviceId deviceId=CMT_DID_MASTER)
Set the currently used magnitude of the gravity vector.
uint16_t getMtCount(void) const
Return the device Id of the first.
bool isPortOpen(void) const
Return whether the communication port is open or not.
A structure for storing scenario information.
@ XRV_OK
Operation was performed successfully.
CmtMtTimeStamp m_rtcLastSc
The last received sample counter, used to determine wrap-around.
XsensResultValue setHeading(const double heading, const CmtDeviceId deviceId=CMT_DID_MASTER)
Set the heading offset.
XsensResultValue setSyncInMode(const uint16_t mode)
Set the inbound synchronization mode of an MT device.
XsensResultValue refreshCache(const bool file=false)
Update device information stored on host PC.
bool m_rtcInitialized
Indicates if the rtc is initialised or not.
XsensResultValue getSyncOutSkipFactor(uint16_t &skipFactor)
Retrieve the outbound synchronization skip factor of an MT device.
The mid-level file communication class.
XsensResultValue closeLogFile(bool del=false)
Close an open log file.
XsensResultValue setBaudrate(const uint32_t baudrate, bool reconnect=true)
Set the baudrate and possibly reconnect.
XsensResultValue getHwError(CmtDeviceId &did) const
Return the last Hardware error code.
XsensResultValue closePort(bool gotoConfigFirst=true)
Close the communication port.
#define CMT3_DEFAULT_TIMEOUT_MEAS
The default timeout value for L3 data reading.
XsensResultValue getUtcTime(CmtUtcTime &utc, const CmtDeviceId deviceId)
Return the UTC time of the last received sample.
XsensResultValue setXmOutputMode(const uint8_t mode)
Set the dual-output mode of the XM.
XsensResultValue getSyncOutOffset(uint32_t &offset)
Retrieve the outbound synchronization offset of an MT device.
uint64_t TimeStamp
A real-time timestamp (ms)
XsensResultValue getSyncOutPulseWidth(uint32_t &pulseWidth)
Retrieve the outbound synchronization pulse width of an MT device.
XsensResultValue getBusId(uint8_t &busId, const CmtDeviceId deviceId=CMT_DID_MASTER) const
Retrieve the BusId of a device.
XsensResultValue setSyncOutOffset(const uint32_t offset)
Set the outbound synchronization offset of an MT device.
XsensResultValue getSerialBaudrate(uint32_t &baudrate)
Return the baud rate used for serial communication.
XsensResultValue storeXkfState(const CmtDeviceId deviceId=CMT_DID_MASTER)
Store important components of the XKF filter state to non-volatile memory.
A structure for storing sync in settings.
XsensResultValue getProductCode(char *productCode, const CmtDeviceId deviceId=CMT_DID_MASTER)
Return product code.
A structure for storing UTC Time values.
XsensResultValue resetLogFileReadPos(void)
Restart reading from the start of the open log file.
XsensResultValue getMtDeviceId(const uint8_t index, CmtDeviceId &deviceId) const
bool m_logging
Indicates whether to write all received messages to the logfile or not, automatically set to true by ...
GLuint GLsizei GLsizei * length
XsensResultValue waitForDataMessage(Packet *pack)
Wait for a data message to arrive.
void fillRtc(Packet *pack)
Internal function to compute the RTC value.
Cmt3()
Default constructor, initializes all members to their default values.
XsensResultValue initBus(void)
Perform an initBus request.
XsensResultValue getLogFileReadPosition(CmtFilePos &pos)
Retrieve the read position of the log file.
XsensResultValue setSyncMode(const uint8_t mode)
Set the sync mode of the Xbus Master.
XsensResultValue getSyncOutMode(uint16_t &mode)
Retrieve the outbound synchronization mode of an MT device.
XsensResultValue getScenario(uint8_t &scenarioType, uint8_t &scenarioVersion, const CmtDeviceId deviceId=CMT_DID_MASTER)
Get the currently active scenario from a Motion Tracker.
uint32_t m_baudrate
The baudrate that was last set to be used by the port.
Cmt2f * getCmt2f(void)
Return a reference to the embedded Cmt2f (logfile) object.
uint16_t m_skip
The skip factor of the port.
A structure for storing device modes.
#define CMT_DEFAULT_BAUD_RATE
The default baud rate of the Cmt1s serial communication.
XsensResultValue getSyncInMode(uint16_t &mode)
Retrieve the inbound synchronization mode of an MT device.
XsensResultValue setGotoConfigTries(const uint16_t tries)
Set the number of times the gotoConfig function will attempt a gotoConfig before failing.
XsensResultValue reset(void)
Request a data.
TimeStamp m_rtcStart
The start of the RTC counter, the time of arrival of sample 0.
XsensResultValue getErrorMode(uint16_t &mode, const CmtDeviceId deviceId=CMT_DID_MASTER)
Return the error mode of the device.
XsensResultValue setSyncOutSettings(const CmtSyncOutSettings &settings)
Set the outbound synchronization settings of an MT device.
bool m_useRtc
Indicates if the RTC should be computed or not (to save CPU time).
XsensResultValue setSyncOutPulseWidth(const uint32_t pulseWidth)
Set the outbound synchronization pulse width of an MT device.
XsensResultValue writeMessageToLogFile(const Message &msg)
XsensResultValue gotoMeasurement(void)
Place all connected devices into Measurement Mode.
XsensResultValue m_lastHwError
Contains the last error reported by hardware.
XsensResultValue getLogFileSize(CmtFilePos &size)
Retrieve the size of the open log file in bytes.
Cmt2s m_serial
The (optional) CMT level 2 serial object that this class operates on.
XsensResultValue getBusPowerState(bool &enabled)
Get the state of the Xbus power.
XsensResultValue getConfiguration(CmtDeviceConfiguration &configuration)
Get device configuration.
XsensResultValue setBluetoothState(const bool enabled)
Set the Bluetooth state of the Xbus Master.
XsensResultValue getDataLength(uint32_t &length, const CmtDeviceId deviceId=CMT_DID_MASTER)
Retrieve data size.
CmtDeviceId m_lastHwErrorDeviceId
Contains the Device ID of the device that caused the last hardware error.
High-level communication class.
uint32_t m_timeoutMeas
The measurement mode timeout.
A structure for storing sync out settings.
XsensResultValue getAvailableScenarios(CmtScenario *scenarios, const CmtDeviceId deviceId=CMT_DID_MASTER)
Write the specified message to the open.
XsensResultValue setMagneticDeclination(const double declination, const CmtDeviceId deviceId=CMT_DID_MASTER)
Set the stored magnetic declination.
bool m_detailedScan
Automatically scan for device details during open.
bool isOpen(void) const
Return whether the communication port is open or not.
XsensResultValue resetOrientation(const CmtResetMethod method, const CmtDeviceId deviceId=CMT_DID_MASTER)
Perform an orientation reset on a device.
uint16_t m_gotoConfigTries
The number of times a goto config is attempted before the function fails.
XsensResultValue setGpsLeverArm(const CmtVector &arm, const CmtDeviceId deviceId=CMT_DID_MASTER)
Set the currently used GPS lever arm.
double m_rtcMsPerSample
ms per sample = 1000 / sample frequency.
XsensResultValue setTimeoutMeasurement(const uint32_t timeout=CMT3_DEFAULT_TIMEOUT_MEAS)
Set the measurement mode timeout.
XsensResultValue setTimeout(const uint32_t ms)
Set the default timeout value to use in blocking operations on the communication port.
XsensResultValue getSyncMode(uint8_t &mode)
Retrieve the sync mode of the Xbus Master.
XsensResultValue getBluetoothState(bool &enabled)
Get the state of the bluetooth communication.
Structure containing a full device configuration as returned by the ReqConfig message.
XsensResultValue gotoConfig(void)
Place all connected devices into Configuration Mode.
XsensResultValue restoreFactoryDefaults(const CmtDeviceId deviceId=CMT_DID_MASTER)
Restore the device to factory default settings.
XsensResultValue setSyncInSettings(const CmtSyncInSettings &settings)
Set the inbound synchronization settings of an MT device.
XsensResultValue setLocationId(uint16_t locationId, const CmtDeviceId deviceId=CMT_DID_MASTER)
Set the location ID of a sensor.
XsensResultValue getSyncInSkipFactor(uint16_t &skipFactor)
Retrieve the inbound synchronization skip factor of an MT device.
XsensResultValue getDeviceId(const uint8_t busId, CmtDeviceId &deviceId) const
Retrieve the DeviceId of a device given its Bus ID.
uint16_t getSampleFrequency(void)
Return current sample frequency.
uint8_t getBusIdInternal(const CmtDeviceId devId) const
Find a device Id in the list and return its busId.
A structure containing MT data + timestamp and formatting information.
A structure for storing the firmware version.
Cmt2s * getCmt2s(void)
Return a reference to the embedded Cmt2s (comm port) object.
uint32_t m_rtcCount
The long sample counter (normal counter wraps at 64k).
XsensResultValue setDeviceMode(const CmtDeviceMode &mode, bool force, const CmtDeviceId deviceId=CMT_DID_MASTER)
Set the complete output mode of a device.
bool isLogFileOpen(const char *filename) const
Return whether or not(true or false) the supplied file is open.
uint32_t getDeviceCount(void) const
Retrieve total device count.
void clearHwError(void)
Reset the hardware error code.
uint32_t CmtDeviceId
The type of a Device Id.
uint32_t m_timeoutConf
The config mode timeout.
XsensResultValue setErrorMode(const uint16_t mode)
Set the error mode of the device.
bool m_readFromFile
Indicates whether to read from the log file or from the serial port.
XsensResultValue getFirmwareRevision(CmtVersion &revision, const CmtDeviceId deviceId=CMT_DID_MASTER)
Return Firmware revision.
XsensResultValue setXmPowerOff(void)
Switch the connected Xbus Master.
XsensResultValue openPort(const char *portName, const uint32_t baudRate=CMT_DEFAULT_BAUD_RATE)
bool isXm(void) const
Return whether the main device is an Xbus Master or not.
bool m_measuring
Keeps track of whether the connected device is measuring or being configured.
XsensResultValue requestData(Packet *pack)
XsensResultValue setTimeoutConfig(const uint32_t timeout=CMT3_DEFAULT_TIMEOUT_CONF)
Set the configuration mode timeout.
~Cmt3()
Destructor, de-initializes, frees memory allocated for buffers, etc.
Class for storing a single message.
XsensResultValue getSyncInOffset(uint32_t &offset)
Retrieve the inbound synchronization offset of an MT device.
XsensResultValue getSyncInSettings(CmtSyncInSettings &settings)
Retrieve the inbound synchronization settings of the master MT device.
#define CMT_MAX_DEVICES_PER_PORT
XsensResultValue setDeviceMode2(const CmtDeviceMode2 &mode, bool force, const CmtDeviceId deviceId=CMT_DID_MASTER)
Set the complete output mode2 of a device.
uint32_t getTimeoutConfig(void) const
Return the configuration mode timeout.
XsensResultValue getLocationId(uint16_t &locationId, const CmtDeviceId deviceId=CMT_DID_MASTER)
Return the location ID of a sensor.
XsensResultValue
Xsens return values.
XsensResultValue getGpsStatus(CmtGpsStatus &status, const CmtDeviceId deviceId=CMT_DID_MASTER)
Request the status of the GPS satellites in orbit.
XsensResultValue getHeading(double &heading, const CmtDeviceId deviceId=CMT_DID_MASTER)
Return the heading offset.
Mid-level serial communication class.
XsensResultValue getGpsLeverArm(CmtVector &arm, const CmtDeviceId deviceId=CMT_DID_MASTER)
Get the currently used GPS lever arm.
uint16_t m_period
The sample period of the port.
CmtDeviceId getMasterId(void)
XsensResultValue setSyncOutSkipFactor(const uint16_t skipFactor)
Set the outbound synchronization skip factor of an MT device.
Cmt2f m_logFile
The (optional) CMT level 2 logfile object that this class operates on.
XsensResultValue getLastResult(void) const
Return the error code of the last user function call.
The namespace of all Xsens software since 2006.
unsigned __int32 uint32_t
bool isLogging(void) const
Return whether the Cmt3 object is writing to a log file or not.
XsensResultValue getEMtsData(void *buffer, const CmtDeviceId deviceId=CMT_DID_MASTER)
Retrieve the eMts data of the specified sensor(s).
uint16_t CmtMtTimeStamp
An MT timestamp (sample count)
XsensResultValue setLogMode(bool active)
Set the logging mode.
XsensResultValue getPortNr(uint8_t &port) const
Return the device Id of an MT device.
XsensResultValue setSyncOutMode(const uint16_t mode)
Set the outbound synchronization mode of an MT device.
XsensResultValue setSyncInOffset(const uint32_t offset)
Set the inbound synchronization offset of an MT device.
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST | |