High-level communication class.
The class uses CMT level 2, but does not inherit from it. If software needs to access the level 2 components, it needs to be done through the getCmt2s() and getCmt2f() functions.
All device identification is done through device Ids in CMT level 3.
#include <xSens_MT3/cmt3.h>
Public Member Functions | |
Cmt3 () | |
Default constructor, initializes all members to their default values. More... | |
~Cmt3 () | |
Destructor, de-initializes, frees memory allocated for buffers, etc. More... | |
XsensResultValue | closePort (bool gotoConfigFirst=true) |
Close the communication port. More... | |
XsensResultValue | getBatteryLevel (uint8_t &level) |
Get an Xbus Master's battery level. More... | |
XsensResultValue | getBaudrate (uint32_t &baudrate) |
Get the baudrate used by a port. More... | |
XsensResultValue | getBluetoothState (bool &enabled) |
Get the state of the bluetooth communication. More... | |
XsensResultValue | getBusId (uint8_t &busId, const CmtDeviceId deviceId=CMT_DID_MASTER) const |
Retrieve the BusId of a device. More... | |
XsensResultValue | getBusPowerState (bool &enabled) |
Get the state of the Xbus power. More... | |
Cmt2f * | getCmt2f (void) |
Return a reference to the embedded Cmt2f (logfile) object. More... | |
Cmt2s * | getCmt2s (void) |
Return a reference to the embedded Cmt2s (comm port) object. More... | |
XsensResultValue | getConfiguration (CmtDeviceConfiguration &configuration) |
Get device configuration. More... | |
XsensResultValue | getDataLength (uint32_t &length, const CmtDeviceId deviceId=CMT_DID_MASTER) |
Retrieve data size. More... | |
uint32_t | getDeviceCount (void) const |
Retrieve total device count. More... | |
XsensResultValue | getDeviceId (const uint8_t busId, CmtDeviceId &deviceId) const |
Retrieve the DeviceId of a device given its Bus ID. More... | |
XsensResultValue | getDeviceMode (CmtDeviceMode &mode, const CmtDeviceId deviceId=CMT_DID_MASTER) |
Return device mode. More... | |
XsensResultValue | getDeviceMode2 (CmtDeviceMode2 &mode, const CmtDeviceId deviceId=CMT_DID_MASTER) |
Return device mode2. More... | |
XsensResultValue | getEMtsData (void *buffer, const CmtDeviceId deviceId=CMT_DID_MASTER) |
Retrieve the eMts data of the specified sensor(s). More... | |
XsensResultValue | getErrorMode (uint16_t &mode, const CmtDeviceId deviceId=CMT_DID_MASTER) |
Return the error mode of the device. More... | |
XsensResultValue | getFirmwareRevision (CmtVersion &revision, const CmtDeviceId deviceId=CMT_DID_MASTER) |
Return Firmware revision. More... | |
XsensResultValue | getHeading (double &heading, const CmtDeviceId deviceId=CMT_DID_MASTER) |
Return the heading offset. More... | |
XsensResultValue | getLastResult (void) const |
< More... | |
XsensResultValue | getHwError (CmtDeviceId &did) const |
< More... | |
void | clearHwError (void) |
XsensResultValue | getLocationId (uint16_t &locationId, const CmtDeviceId deviceId=CMT_DID_MASTER) |
Return the location ID of a sensor. More... | |
XsensResultValue | getLogFileReadPosition (CmtFilePos &pos) |
Retrieve the read position of the log file. More... | |
XsensResultValue | getLogFileSize (CmtFilePos &size) |
Retrieve the size of the open log file in bytes. More... | |
XsensResultValue | getLogFileName (char *filename) |
Retrieve the name of the open log file or an empty string if no logfile is open. More... | |
XsensResultValue | getLogFileName (wchar_t *filename) |
Retrieve the name of the open log file or an empty string if no logfile is open. More... | |
XsensResultValue | getMagneticDeclination (double &declination, const CmtDeviceId deviceId=CMT_DID_MASTER) |
Return the stored magnetic declination. More... | |
CmtDeviceId | getMasterId (void) |
uint16_t | getMtCount (void) const |
Return the device Id of the first device (master). More... | |
XsensResultValue | getMtDeviceId (const uint8_t index, CmtDeviceId &deviceId) const |
XsensResultValue | getPortNr (uint8_t &port) const |
Return the device Id of an MT device. More... | |
XsensResultValue | getProductCode (char *productCode, const CmtDeviceId deviceId=CMT_DID_MASTER) |
Return product code. More... | |
uint16_t | getSampleFrequency (void) |
Return current sample frequency. More... | |
XsensResultValue | getSerialBaudrate (uint32_t &baudrate) |
Return the baud rate used for serial communication. More... | |
XsensResultValue | getSyncInSettings (CmtSyncInSettings &settings) |
Retrieve the inbound synchronization settings of the master MT device. More... | |
XsensResultValue | getSyncInMode (uint16_t &mode) |
Retrieve the inbound synchronization mode of an MT device. More... | |
XsensResultValue | getSyncInSkipFactor (uint16_t &skipFactor) |
Retrieve the inbound synchronization skip factor of an MT device. More... | |
XsensResultValue | getSyncInOffset (uint32_t &offset) |
Retrieve the inbound synchronization offset of an MT device. More... | |
XsensResultValue | getSyncMode (uint8_t &mode) |
Retrieve the sync mode of the Xbus Master. More... | |
XsensResultValue | getSyncOutSettings (CmtSyncOutSettings &settings) |
Retrieve the outbound synchronization settings of the master MT device. More... | |
XsensResultValue | getSyncOutMode (uint16_t &mode) |
Retrieve the outbound synchronization mode of an MT device. More... | |
XsensResultValue | getSyncOutPulseWidth (uint32_t &pulseWidth) |
Retrieve the outbound synchronization pulse width of an MT device. More... | |
XsensResultValue | getSyncOutSkipFactor (uint16_t &skipFactor) |
Retrieve the outbound synchronization skip factor of an MT device. More... | |
XsensResultValue | getSyncOutOffset (uint32_t &offset) |
Retrieve the outbound synchronization offset of an MT device. More... | |
uint32_t | getTimeoutConfig (void) const |
Return the configuration mode timeout. More... | |
uint32_t | getTimeoutMeasurement (void) const |
Return the measurement mode timeout. More... | |
XsensResultValue | getUtcTime (CmtUtcTime &utc, const CmtDeviceId deviceId) |
Return the UTC time of the last received sample. More... | |
XsensResultValue | getXmOutputMode (uint8_t &mode) |
Return the dual-output mode of the XM. More... | |
XsensResultValue | gotoConfig (void) |
Place all connected devices into Configuration Mode. More... | |
XsensResultValue | gotoMeasurement (void) |
Place all connected devices into Measurement Mode. More... | |
XsensResultValue | initBus (void) |
Perform an initBus request. More... | |
bool | isLogging (void) const |
< More... | |
bool | isPortOpen (void) const |
< More... | |
bool | isXm (void) const |
Return whether the main device is an Xbus Master or not. More... | |
XsensResultValue | openPort (const char *portName, const uint32_t baudRate=CMT_DEFAULT_BAUD_RATE) |
XsensResultValue | openPort (const uint32_t portNumber, const uint32_t baudRate=CMT_DEFAULT_BAUD_RATE) |
Open a communication channel to the given COM port number. More... | |
XsensResultValue | peekLogMessageId (uint8_t &messageId) |
Open a communication channel to the given COM port number. More... | |
XsensResultValue | readDataPacket (Packet *pack, bool acceptOther=false) |
Retrieve a data message. More... | |
XsensResultValue | requestData (Packet *pack) |
XsensResultValue | reset (void) |
Request a data message and wait for it to arrive. More... | |
XsensResultValue | resetOrientation (const CmtResetMethod method, const CmtDeviceId deviceId=CMT_DID_MASTER) |
Perform an orientation reset on a device. More... | |
XsensResultValue | restoreFactoryDefaults (const CmtDeviceId deviceId=CMT_DID_MASTER) |
Restore the device to factory default settings. More... | |
XsensResultValue | setBaudrate (const uint32_t baudrate, bool reconnect=true) |
Set the baudrate and possibly reconnect. More... | |
XsensResultValue | setBluetoothState (const bool enabled) |
Set the Bluetooth state of the Xbus Master. More... | |
XsensResultValue | setBusPowerState (const bool enabled) |
Switch the Xbus Master bus power on or off. More... | |
XsensResultValue | setDeviceMode (const CmtDeviceMode &mode, bool force, const CmtDeviceId deviceId=CMT_DID_MASTER) |
Set the complete output mode of a device. More... | |
XsensResultValue | setDeviceMode2 (const CmtDeviceMode2 &mode, bool force, const CmtDeviceId deviceId=CMT_DID_MASTER) |
Set the complete output mode2 of a device. More... | |
XsensResultValue | setErrorMode (const uint16_t mode) |
Set the error mode of the device. More... | |
XsensResultValue | setGotoConfigTries (const uint16_t tries) |
Set the number of times the gotoConfig function will attempt a gotoConfig before failing. More... | |
XsensResultValue | setHeading (const double heading, const CmtDeviceId deviceId=CMT_DID_MASTER) |
Set the heading offset. More... | |
XsensResultValue | setLocationId (uint16_t locationId, const CmtDeviceId deviceId=CMT_DID_MASTER) |
Set the location ID of a sensor. More... | |
XsensResultValue | setMagneticDeclination (const double declination, const CmtDeviceId deviceId=CMT_DID_MASTER) |
Set the stored magnetic declination. More... | |
XsensResultValue | setSyncInSettings (const CmtSyncInSettings &settings) |
Set the inbound synchronization settings of an MT device. More... | |
XsensResultValue | setSyncInMode (const uint16_t mode) |
Set the inbound synchronization mode of an MT device. More... | |
XsensResultValue | setSyncInSkipFactor (const uint16_t skipFactor) |
Set the inbound synchronization skip factor of an MT device. More... | |
XsensResultValue | setSyncInOffset (const uint32_t offset) |
Set the inbound synchronization offset of an MT device. More... | |
XsensResultValue | setSyncMode (const uint8_t mode) |
Set the sync mode of the Xbus Master. More... | |
XsensResultValue | setSyncOutSettings (const CmtSyncOutSettings &settings) |
Set the outbound synchronization settings of an MT device. More... | |
XsensResultValue | setSyncOutMode (const uint16_t mode) |
Set the outbound synchronization mode of an MT device. More... | |
XsensResultValue | setSyncOutPulseWidth (const uint32_t pulseWidth) |
Set the outbound synchronization pulse width of an MT device. More... | |
XsensResultValue | setSyncOutSkipFactor (const uint16_t skipFactor) |
Set the outbound synchronization skip factor of an MT device. More... | |
XsensResultValue | setSyncOutOffset (const uint32_t offset) |
Set the outbound synchronization offset of an MT device. More... | |
XsensResultValue | setTimeout (const uint32_t ms) |
XsensResultValue | setTimeoutConfig (const uint32_t timeout=CMT3_DEFAULT_TIMEOUT_CONF) |
Set the configuration mode timeout. More... | |
XsensResultValue | setTimeoutMeasurement (const uint32_t timeout=CMT3_DEFAULT_TIMEOUT_MEAS) |
Set the measurement mode timeout. More... | |
XsensResultValue | setXmOutputMode (const uint8_t mode) |
Set the dual-output mode of the XM. More... | |
XsensResultValue | setXmPowerOff (void) |
Switch the connected Xbus Master. More... | |
XsensResultValue | refreshCache (const bool file=false) |
Update device information stored on host PC. More... | |
XsensResultValue | waitForDataMessage (Packet *pack) |
Wait for a data message to arrive. More... | |
XsensResultValue | createLogFile (const char *filename, bool startLogging=false) |
Create a log file for incoming messages. More... | |
XsensResultValue | createLogFile (const wchar_t *filename, bool startLogging=false) |
Create a log file for incoming messages. More... | |
XsensResultValue | closeLogFile (bool del=false) |
Close an open log file. More... | |
bool | isLogFileOpen (const char *filename) const |
Return whether or not(true or false) the supplied file is open. More... | |
bool | isLogFileOpen (const wchar_t *filename) const |
Return whether or not(true or false) the supplied file is open. More... | |
XsensResultValue | openLogFile (const char *filename) |
Open a log file for input. More... | |
XsensResultValue | openLogFile (const wchar_t *filename) |
Open a log file for input. More... | |
XsensResultValue | setDataSource (bool readFromFile) |
Set whether to read from comm port or file. More... | |
XsensResultValue | setLogMode (bool active) |
Set the logging mode. More... | |
XsensResultValue | resetLogFileReadPos (void) |
Restart reading from the start of the open log file. More... | |
XsensResultValue | writeMessageToLogFile (const Message &msg) |
XsensResultValue | getAvailableScenarios (CmtScenario *scenarios, const CmtDeviceId deviceId=CMT_DID_MASTER) |
Write the specified message to the open log file. More... | |
XsensResultValue | getScenario (uint8_t &scenarioType, uint8_t &scenarioVersion, const CmtDeviceId deviceId=CMT_DID_MASTER) |
Get the currently active scenario from a Motion Tracker. More... | |
XsensResultValue | setScenario (const uint8_t scenarioType, const CmtDeviceId deviceId=CMT_DID_MASTER) |
Specify the scenario to use in the sensor. More... | |
XsensResultValue | getGravityMagnitude (double &magnitude, const CmtDeviceId deviceId=CMT_DID_MASTER) |
Retrieve the currently used magnitude of the gravity vector. More... | |
XsensResultValue | setGravityMagnitude (const double magnitude, const CmtDeviceId deviceId=CMT_DID_MASTER) |
Set the currently used magnitude of the gravity vector. More... | |
XsensResultValue | getGpsLeverArm (CmtVector &arm, const CmtDeviceId deviceId=CMT_DID_MASTER) |
Get the currently used GPS lever arm. More... | |
XsensResultValue | getGpsStatus (CmtGpsStatus &status, const CmtDeviceId deviceId=CMT_DID_MASTER) |
Request the status of the GPS satellites in orbit. More... | |
XsensResultValue | setGpsLeverArm (const CmtVector &arm, const CmtDeviceId deviceId=CMT_DID_MASTER) |
Set the currently used GPS lever arm. More... | |
XsensResultValue | storeXkfState (const CmtDeviceId deviceId=CMT_DID_MASTER) |
Store important components of the XKF filter state to non-volatile memory. More... | |
Public Attributes | |
bool | m_useRtc |
Indicates if the RTC should be computed or not (to save CPU time). More... | |
void * | m_eMtsData [CMT_MAX_DEVICES_PER_PORT] |
Cached eMTS data. More... | |
Protected Member Functions | |
Cmt3 (const Cmt3 &ref) | |
This object cannot be copied, so this function is not implemented. More... | |
void | fillRtc (Packet *pack) |
Internal function to compute the RTC value. More... | |
uint8_t | getBusIdInternal (const CmtDeviceId devId) const |
Find a device Id in the list and return its busId. More... | |
Protected Attributes | |
Cmt2s | m_serial |
The (optional) CMT level 2 serial object that this class operates on. More... | |
Cmt2f | m_logFile |
The (optional) CMT level 2 logfile object that this class operates on. More... | |
double | m_rtcMsPerSample |
ms per sample = 1000 / sample frequency. More... | |
uint16_t | m_period |
The sample period of the port. More... | |
uint16_t | m_skip |
The skip factor of the port. More... | |
TimeStamp | m_rtcStart |
The start of the RTC counter, the time of arrival of sample 0. More... | |
uint32_t | m_rtcCount |
The long sample counter (normal counter wraps at 64k). More... | |
CmtMtTimeStamp | m_rtcLastSc |
The last received sample counter, used to determine wrap-around. More... | |
uint32_t | m_baudrate |
The baudrate that was last set to be used by the port. More... | |
uint32_t | m_timeoutConf |
The config mode timeout. More... | |
uint32_t | m_timeoutMeas |
The measurement mode timeout. More... | |
XsensResultValue | m_lastResult |
The last result of an operation. More... | |
uint16_t | m_firstItem |
The index of the first formatting item. More... | |
uint16_t | m_gotoConfigTries |
The number of times a goto config is attempted before the function fails. More... | |
bool | m_measuring |
Keeps track of whether the connected device is measuring or being configured. More... | |
bool | m_detailedScan |
Automatically scan for device details during open. Default is true (recommended). More... | |
bool | m_readFromFile |
Indicates whether to read from the log file or from the serial port. More... | |
bool | m_rtcInitialized |
Indicates if the rtc is initialised or not. More... | |
bool | m_logging |
Indicates whether to write all received messages to the logfile or not, automatically set to true by createLogFile. More... | |
XsensResultValue | m_lastHwError |
Contains the last error reported by hardware. More... | |
CmtDeviceId | m_lastHwErrorDeviceId |
Contains the Device ID of the device that caused the last hardware error. More... | |
CmtDeviceConfiguration | m_config |
The configuration of the connected devices. More... | |
|
protected |
This object cannot be copied, so this function is not implemented.
xsens::Cmt3::Cmt3 | ( | ) |
Default constructor, initializes all members to their default values.
Definition at line 307 of file cmt3.cpp.
References clearHwError(), CMT3_DEFAULT_TIMEOUT_CONF, CMT3_DEFAULT_TIMEOUT_MEAS, CMT_DEFAULT_PERIOD, CMT_DEFAULT_SKIP, CMT_GOTO_CONFIG_TRIES, m_config, m_eMtsData, m_gotoConfigTries, m_lastResult, m_logging, m_measuring, m_period, m_readFromFile, m_rtcInitialized, m_skip, m_timeoutConf, m_timeoutMeas, m_useRtc, and XRV_OK.
xsens::Cmt3::~Cmt3 | ( | ) |
Destructor, de-initializes, frees memory allocated for buffers, etc.
Definition at line 329 of file cmt3.cpp.
References xsens::Cmt2s::close(), xsens::Cmt2f::close(), CMT_MAX_DEVICES_PER_PORT, m_eMtsData, m_logFile, and m_serial.
Definition at line 105 of file cmt3.h.
References m_lastHwError, m_lastHwErrorDeviceId, and XRV_OK.
Referenced by Cmt3().
XsensResultValue xsens::Cmt3::closeLogFile | ( | bool | del = false | ) |
Close an open log file.
This function closes the logfile if it was open.
del | When set to true, the file will be deleted after closing if it is not read-only. This is mostly useful for temporary log-files. |
Definition at line 2708 of file cmt3.cpp.
References xsens::Cmt2f::close(), xsens::Cmt2f::closeAndDelete(), CMT3EXITLOG, CMT3LOG, xsens::Cmt2f::isOpen(), m_lastResult, m_logFile, m_logging, and XRV_NOFILEOPEN.
XsensResultValue xsens::Cmt3::closePort | ( | bool | gotoConfigFirst = true | ) |
Close the communication port.
This function places the device in configuration mode and closes the communication port, ending all further communication with the device.
Definition at line 341 of file cmt3.cpp.
References xsens::Cmt2s::close(), CMT3EXITLOG, CMT3LOG, gotoConfig(), xsens::Cmt2f::isOpen(), m_lastResult, m_logFile, m_logging, m_measuring, m_readFromFile, m_serial, and XRV_OK.
Referenced by setBaudrate().
XsensResultValue xsens::Cmt3::createLogFile | ( | const char * | filename, |
bool | startLogging = false |
||
) |
Create a log file for incoming messages.
This function creates a log file for recording incoming messages. The Cmt3 object must be connected to a communication port or the function will fail.
filename | The name of the file to use as a log file. A fully qualified (local) path+filename is recommended. |
startLogging | When set to true (default), Cmt3 will immediately start logging incoming messages to the file, otherwise setLogMode must be called first before logging is started. |
Definition at line 2644 of file cmt3.cpp.
References xsens::Cmt2f::closeAndDelete(), CMT3EXITLOG, CMT3LOG, CMT_DID_BROADCAST, CMT_EMTS_SIZE, xsens::Cmt2f::create(), getConfiguration(), getEMtsData(), xsens::Cmt2s::isOpen(), xsens::Cmt2f::isOpen(), m_config, m_lastResult, m_logFile, m_logging, CmtDeviceConfiguration::m_numberOfDevices, m_serial, XRV_ALREADYOPEN, XRV_NOPORTOPEN, and XRV_OK.
XsensResultValue xsens::Cmt3::createLogFile | ( | const wchar_t * | filename, |
bool | startLogging = false |
||
) |
Create a log file for incoming messages.
This function creates a log file for recording incoming messages. The Cmt3 object must be connected to a communication port or the function will fail.
filename | The name of the file to use as a log file. A fully qualified (local) path+filename is recommended. |
startLogging | When set to true (default), Cmt3 will immediately start logging incoming messages to the file, otherwise setLogMode must be called first before logging is started. |
Definition at line 2676 of file cmt3.cpp.
References xsens::Cmt2f::closeAndDelete(), CMT3EXITLOG, CMT3LOG, CMT_DID_BROADCAST, CMT_EMTS_SIZE, xsens::Cmt2f::create(), getConfiguration(), getEMtsData(), xsens::Cmt2s::isOpen(), xsens::Cmt2f::isOpen(), m_config, m_lastResult, m_logFile, m_logging, CmtDeviceConfiguration::m_numberOfDevices, m_serial, XRV_ALREADYOPEN, XRV_NOPORTOPEN, and XRV_OK.
Internal function to compute the RTC value.
Definition at line 360 of file cmt3.cpp.
References xsens::Packet::getSampleCounter(), m_period, xsens::Packet::m_rtc, m_rtcCount, m_rtcInitialized, m_rtcLastSc, m_rtcMsPerSample, m_rtcStart, m_skip, and xsens::Packet::m_toa.
Referenced by readDataPacket(), and waitForDataMessage().
XsensResultValue xsens::Cmt3::getAvailableScenarios | ( | CmtScenario * | scenarios, |
const CmtDeviceId | deviceId = CMT_DID_MASTER |
||
) |
Write the specified message to the open log file.
This function can be used to add custom messages to a log file.
Use this function to retrieve a list of all scenarios available in a Motion Tracker. See the supplied documentation for more information about scenarios.
scenarios | A buffer for storing the available scenarios. The supplied buffer should be able to contain at least 6 scenarios, but for future devices a larger buffer is advised. Use CMT_MAX_SCENARIOS_IN_MT+1. The list is terminated by a scenario that has type 0. |
Definition at line 2875 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_DID_TYPEH_MASK, CMT_DID_TYPEH_MTI_MTX, CMT_DID_TYPEH_MTIG, CMT_LEN_SCENARIOLABEL, CMT_MAX_SCENARIOS_IN_MT, CMT_MID_REQAVAILABLESCENARIOS, deviceId, DO_DATA_REQUEST, xsens::Message::getDataBuffer(), xsens::Message::getDataByte(), CmtScenario::m_filterType, CmtScenario::m_label, m_lastResult, CmtScenario::m_type, CmtScenario::m_version, mrpt::system::os::memcpy(), and XRV_OK.
XsensResultValue xsens::Cmt3::getBatteryLevel | ( | uint8_t & | level | ) |
Get an Xbus Master's battery level.
The battery level is a value between 0 and 255 that indicates the voltage of the batteries. The scale is not linear and the values should not be used as an absolute voltage. The amount of time remaining for measurement given any battery level greatly depends on the type of batteries used, the number of sensors attached to the Xbus Master and the used output options.
Definition at line 401 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_BID_MASTER, CMT_MID_REQBATLEVEL, DO_DATA_REQUEST_BID, m_lastResult, and XRV_OK.
XsensResultValue xsens::Cmt3::getBaudrate | ( | uint32_t & | baudrate | ) |
Get the baudrate used by a port.
This function returns the baud rate at which the port is currently connected. The function will return an error when no port is connected.
Definition at line 413 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, xsens::Cmt2s::isOpen(), m_baudrate, m_lastResult, m_serial, XRV_NOPORTOPEN, and XRV_OK.
XsensResultValue xsens::Cmt3::getBluetoothState | ( | bool & | enabled | ) |
Get the state of the bluetooth communication.
This function tells whether the Bluetooth connection of the Xbus Master is on (1) or off (0).
Definition at line 426 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_BID_MASTER, CMT_MID_REQBTDISABLE, DO_DATA_REQUEST_BID, m_lastResult, and XRV_OK.
XsensResultValue xsens::Cmt3::getBusId | ( | uint8_t & | busId, |
const CmtDeviceId | deviceId = CMT_DID_MASTER |
||
) | const |
Retrieve the BusId of a device.
The function checks its internal list for a match of deviceId. If it is found, the corresponding BusId is returned in busId. Otherwise, a 0 is placed in busId and XRV_NOTFOUND result is returned.
Definition at line 438 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_BID_MASTER, CMT_DID_MASTER, deviceId, m_config, CmtDeviceConfiguration::_devInfo::m_deviceId, CmtDeviceConfiguration::m_deviceInfo, m_lastResult, CmtDeviceConfiguration::m_masterDeviceId, CmtDeviceConfiguration::m_numberOfDevices, XRV_NOTFOUND, and XRV_OK.
|
protected |
Find a device Id in the list and return its busId.
CmtDeviceId 0= busId 0= broadcast. A CMT_BID_INVALID value is also possible and indicates that the devId was not found.
Definition at line 459 of file cmt3.cpp.
References CMT_BID_BROADCAST, CMT_BID_INVALID, CMT_BID_MASTER, CMT_DID_BROADCAST, CMT_DID_MASTER, m_config, CmtDeviceConfiguration::_devInfo::m_deviceId, CmtDeviceConfiguration::m_deviceInfo, CmtDeviceConfiguration::m_masterDeviceId, and CmtDeviceConfiguration::m_numberOfDevices.
Referenced by getDeviceMode2(), getEMtsData(), setDeviceMode2(), setGpsLeverArm(), and storeXkfState().
XsensResultValue xsens::Cmt3::getBusPowerState | ( | bool & | enabled | ) |
Get the state of the Xbus power.
This function tells whether the Xbus of the connected Xbus Master is currently switched on (1) or not (0). When it is switched off, the attached MT devices have no power and communication with them is not possible. Before going to measurement mode, use setBusPowerState to restore power.
Definition at line 480 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_BID_MASTER, CMT_MID_BUSPWR, DO_DATA_REQUEST_BID, m_lastResult, and XRV_OK.
XsensResultValue xsens::Cmt3::getConfiguration | ( | CmtDeviceConfiguration & | configuration | ) |
Get device configuration.
This function retrieves the complete device configuration of a single device.
Definition at line 504 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_BID_MASTER, CMT_CONF_BLOCKLEN, CMT_MID_CONFIGURATION, xsens::Message::getDataBuffer(), xsens::Cmt2s::isOpen(), xsens::Cmt2f::isOpen(), m_config, CmtDeviceConfiguration::_devInfo::m_dataLength, CmtDeviceConfiguration::m_date, CmtDeviceConfiguration::_devInfo::m_deviceId, CmtDeviceConfiguration::m_deviceInfo, m_lastResult, m_logFile, m_logging, CmtDeviceConfiguration::m_masterDeviceId, CmtDeviceConfiguration::m_numberOfDevices, CmtDeviceConfiguration::_devInfo::m_outputMode, CmtDeviceConfiguration::_devInfo::m_outputSettings, CmtDeviceConfiguration::m_outputSkipFactor, CmtDeviceConfiguration::_devInfo::m_reserved, CmtDeviceConfiguration::m_reservedForClient, CmtDeviceConfiguration::m_reservedForHost, CmtDeviceConfiguration::m_samplingPeriod, m_serial, CmtDeviceConfiguration::m_syncinMode, CmtDeviceConfiguration::m_syncinOffset, CmtDeviceConfiguration::m_syncinSkipFactor, CmtDeviceConfiguration::m_time, mrpt::system::os::memcpy(), xsens::Message::recomputeChecksum(), xsens::Message::setBusId(), xsens::Message::setDataLong(), xsens::Message::setDataShort(), writeMessageToLogFile(), XRV_INVALIDOPERATION, and XRV_OK.
Referenced by createLogFile().
XsensResultValue xsens::Cmt3::getDataLength | ( | uint32_t & | length, |
const CmtDeviceId | deviceId = CMT_DID_MASTER |
||
) |
Retrieve data size.
This function retrieves the number of bytes that are in a data message as sent by the given device.
Definition at line 550 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_MID_REQDATALENGTH, deviceId, DO_DATA_REQUEST, m_lastResult, and XRV_OK.
Retrieve total device count.
This function retrieves the total number of connected (master + slave) devices or 0 if not connected.
Definition at line 562 of file cmt3.cpp.
References CMT3LOG, xsens::Cmt2s::isOpen(), xsens::Cmt2f::isOpen(), isXm(), m_config, m_logFile, CmtDeviceConfiguration::m_numberOfDevices, and m_serial.
XsensResultValue xsens::Cmt3::getDeviceId | ( | const uint8_t | busId, |
CmtDeviceId & | deviceId | ||
) | const |
Retrieve the DeviceId of a device given its Bus ID.
This function retrieves the DeviceId for the device with the given Bus ID. When no devices are connected, a 0 ID is supplied.
Definition at line 577 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_BID_MASTER, deviceId, m_config, CmtDeviceConfiguration::_devInfo::m_deviceId, CmtDeviceConfiguration::m_deviceInfo, m_lastResult, CmtDeviceConfiguration::m_masterDeviceId, CmtDeviceConfiguration::m_numberOfDevices, XRV_INVALIDID, and XRV_OK.
Referenced by getEMtsData(), gotoConfig(), readDataPacket(), setGpsLeverArm(), storeXkfState(), and waitForDataMessage().
XsensResultValue xsens::Cmt3::getDeviceMode | ( | CmtDeviceMode & | mode, |
const CmtDeviceId | deviceId = CMT_DID_MASTER |
||
) |
Return device mode.
This function retrieves the output-related settings of the device, such as the sample rate and output settings.
Definition at line 595 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, deviceId, getDeviceMode2(), CmtDeviceMode2::getSampleFrequency(), CmtDeviceMode2::m_outputMode, CmtDeviceMode2::m_outputSettings, and XRV_OK.
XsensResultValue xsens::Cmt3::getDeviceMode2 | ( | CmtDeviceMode2 & | mode, |
const CmtDeviceId | deviceId = CMT_DID_MASTER |
||
) |
Return device mode2.
This function retrieves the output-related settings of the device, such as the period, skip factor and output settings.
Definition at line 613 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_BID_INVALID, CMT_BID_MASTER, deviceId, getBusIdInternal(), m_config, CmtDeviceConfiguration::m_deviceInfo, m_lastResult, CmtDeviceConfiguration::_devInfo::m_outputMode, CmtDeviceConfiguration::_devInfo::m_outputSettings, m_period, m_skip, XRV_INVALIDID, and XRV_OK.
Referenced by getDeviceMode().
XsensResultValue xsens::Cmt3::getEMtsData | ( | void * | buffer, |
const CmtDeviceId | deviceId = CMT_DID_MASTER |
||
) |
Retrieve the eMts data of the specified sensor(s).
This function can be used to read proprietary data from one or more Motion Trackers. This data is required by higher level functions in combination with Configuration data to convert Raw data into Calibrated and Orientation data. The eMTs data is quite large, but it is cached. The first request should be done in configuration mode, but following requests can be done in measurement mode. When requesting eMTS data for a single sensor, the buffer should be at least CMT_EMTS_SIZE bytes long. When using CMT_DID_BROADCAST, the eMTS data of all connected sensors is placed into the buffer sequentially. In the latter case, the buffer should be able to hold at least sensorcount * CMT_EMTS_SIZE bytes.
Definition at line 637 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_BID_BROADCAST, CMT_BID_INVALID, CMT_BID_MASTER, CMT_EMTS_SIZE, CMT_MID_EMTSDATA, CMT_MID_ERROR, CMT_MID_REQEMTS, deviceId, getBusIdInternal(), xsens::Message::getDataBuffer(), xsens::Message::getDataByte(), xsens::Message::getDataSize(), getDeviceId(), xsens::Message::getMessageId(), xsens::Cmt2s::isOpen(), xsens::Cmt2f::isOpen(), isXm(), m_config, CmtDeviceConfiguration::_devInfo::m_deviceId, CmtDeviceConfiguration::m_deviceInfo, m_eMtsData, m_lastHwError, m_lastHwErrorDeviceId, m_lastResult, m_logFile, m_logging, CmtDeviceConfiguration::m_masterDeviceId, CmtDeviceConfiguration::m_numberOfDevices, m_readFromFile, m_serial, mrpt::system::os::memcpy(), xsens::Cmt2f::readMessage(), xsens::Message::setBusId(), xsens::Message::setDataBuffer(), xsens::Message::setDataByte(), xsens::Cmt2s::waitForMessage(), xsens::Cmt2s::writeMessage(), xsens::Cmt2f::writeMessage(), writeMessageToLogFile(), XRV_INVALIDID, XRV_NOFILEOPEN, XRV_NOPORTOPEN, XRV_NULLPTR, and XRV_OK.
Referenced by createLogFile().
XsensResultValue xsens::Cmt3::getErrorMode | ( | uint16_t & | mode, |
const CmtDeviceId | deviceId = CMT_DID_MASTER |
||
) |
Return the error mode of the device.
This function returns the error mode of the device. The error mode determines how the device handles errors. See the low-level communication documentation for more details.
Definition at line 792 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_BID_MASTER, CMT_MID_REQERRORMODE, CMT_MID_REQXMERRORMODE, deviceId, DO_DATA_REQUEST, DO_DATA_REQUEST_BID, isXm(), m_lastResult, and XRV_OK.
XsensResultValue xsens::Cmt3::getFirmwareRevision | ( | CmtVersion & | revision, |
const CmtDeviceId | deviceId = CMT_DID_MASTER |
||
) |
Return Firmware revision.
This function retrieves the firmware version that is currently installed in the device.
Definition at line 862 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_MID_REQFWREV, deviceId, DO_DATA_REQUEST, xsens::Message::getDataByte(), m_lastResult, CmtVersion::m_major, CmtVersion::m_minor, CmtVersion::m_revision, and XRV_OK.
XsensResultValue xsens::Cmt3::getGpsLeverArm | ( | CmtVector & | arm, |
const CmtDeviceId | deviceId = CMT_DID_MASTER |
||
) |
Get the currently used GPS lever arm.
Use this function to retrieve the vector currently used as the GPS lever arm in meters. The GPS lever arm is the relative position of the GPS antenna to the MTi-G unit. The arm is specified in the object coordinate system. See the manual for more information on coordinate systems, alignment resets and the lever arm.
Definition at line 2944 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_MID_REQGPSLEVERARM, deviceId, DO_DATA_REQUEST, xsens::Message::getDataFloat(), CmtVector::m_data, m_lastResult, and XRV_OK.
XsensResultValue xsens::Cmt3::getGpsStatus | ( | CmtGpsStatus & | status, |
const CmtDeviceId | deviceId = CMT_DID_MASTER |
||
) |
Request the status of the GPS satellites in orbit.
This function requests the GPS satellite status information from the GPS subsystem. In config mode, this information is requested from the GPS subsystem immediately, which can cause a relatively long delay (250ms) before a reply is received. In measurement mode, the satellite status is regularly polled internally and the latest status is returned immediately when this function is called.
Definition at line 2956 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_MAX_SVINFO, CMT_MID_REQGPSSTATUS, deviceId, DO_DATA_REQUEST, xsens::Message::getDataByte(), m_lastResult, status, and XRV_OK.
XsensResultValue xsens::Cmt3::getGravityMagnitude | ( | double & | magnitude, |
const CmtDeviceId | deviceId = CMT_DID_MASTER |
||
) |
Retrieve the currently used magnitude of the gravity vector.
The magnitude of the gravity vector is used to determine absolute acceleration from measured acceleration.
Definition at line 2925 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_MID_REQGRAVITYMAGNITUDE, deviceId, DO_DATA_REQUEST, xsens::Message::getDataFloat(), m_lastResult, and XRV_OK.
XsensResultValue xsens::Cmt3::getHeading | ( | double & | heading, |
const CmtDeviceId | deviceId = CMT_DID_MASTER |
||
) |
Return the heading offset.
This function retrieves the heading offset in radians used by the device. The valid range is -pi to +pi. The heading offset is used as a final correction on the output orientation.
Definition at line 878 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_MID_REQHEADING, deviceId, DO_DATA_REQUEST, xsens::Message::getDataFloat(), m_lastResult, and XRV_OK.
|
inline |
<
Return the last Hardware error code.
This function returns the XsensResultValue of the last problem reported by hardware (if any). Hardware problems are all 'error' messages returned by a sensor.
did | If any problems were found, the responsible device ID will be returned in this parameter. |
Definition at line 103 of file cmt3.h.
References m_lastHwError, and m_lastHwErrorDeviceId.
|
inline |
<
Return the error code of the last user function call.
Definition at line 101 of file cmt3.h.
References m_lastResult.
XsensResultValue xsens::Cmt3::getLocationId | ( | uint16_t & | locationId, |
const CmtDeviceId | deviceId = CMT_DID_MASTER |
||
) |
Return the location ID of a sensor.
This function retrieves the location ID stored in the device.
Definition at line 890 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_MID_REQLOCATIONID, deviceId, DO_DATA_REQUEST, xsens::Message::getDataShort(), m_lastResult, and XRV_OK.
XsensResultValue xsens::Cmt3::getLogFileName | ( | char * | filename | ) |
Retrieve the name of the open log file or an empty string if no logfile is open.
Definition at line 934 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, xsens::Cmt2f::getName(), xsens::Cmt2f::isOpen(), m_lastResult, m_logFile, and XRV_NOFILEOPEN.
XsensResultValue xsens::Cmt3::getLogFileName | ( | wchar_t * | filename | ) |
Retrieve the name of the open log file or an empty string if no logfile is open.
Definition at line 947 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, xsens::Cmt2f::getName(), xsens::Cmt2f::isOpen(), m_lastResult, m_logFile, and XRV_NOFILEOPEN.
XsensResultValue xsens::Cmt3::getLogFileReadPosition | ( | CmtFilePos & | pos | ) |
Retrieve the read position of the log file.
This function will return the current read position in the open log file in bytes from the start.
Definition at line 902 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, xsens::Cmt2f::getReadPosition(), xsens::Cmt2f::isOpen(), m_lastResult, m_logFile, XRV_NOFILEOPEN, and XRV_OK.
XsensResultValue xsens::Cmt3::getLogFileSize | ( | CmtFilePos & | size | ) |
Retrieve the size of the open log file in bytes.
Definition at line 918 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, xsens::Cmt2f::getFileSize(), xsens::Cmt2f::isOpen(), m_lastResult, m_logFile, XRV_NOFILEOPEN, and XRV_OK.
XsensResultValue xsens::Cmt3::getMagneticDeclination | ( | double & | declination, |
const CmtDeviceId | deviceId = CMT_DID_MASTER |
||
) |
Return the stored magnetic declination.
This function retrieves the stored local magnetic declination in radians. The valid range is -pi to +pi. The magnetic declination is used in the sensor fusion process to determine the output orientation.
Definition at line 960 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_MID_REQMAGNETICDECLINATION, deviceId, DO_DATA_REQUEST, xsens::Message::getDataFloat(), m_lastResult, and XRV_OK.
CmtDeviceId xsens::Cmt3::getMasterId | ( | void | ) |
Definition at line 972 of file cmt3.cpp.
References CMT3LOG, xsens::Cmt2s::isOpen(), xsens::Cmt2f::isOpen(), m_config, m_logFile, CmtDeviceConfiguration::m_masterDeviceId, and m_serial.
Referenced by xsens::cmtScanPort().
Return the device Id of the first device (master).
This function will return the number of connected MT devices. Effectively, this returns the device count minus any Xbus Masters.
Definition at line 983 of file cmt3.cpp.
References CMT3LOGDAT, xsens::Cmt2s::isOpen(), xsens::Cmt2f::isOpen(), m_config, m_logFile, CmtDeviceConfiguration::m_numberOfDevices, and m_serial.
XsensResultValue xsens::Cmt3::getMtDeviceId | ( | const uint8_t | index, |
CmtDeviceId & | deviceId | ||
) | const |
Definition at line 994 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, deviceId, m_config, CmtDeviceConfiguration::_devInfo::m_deviceId, CmtDeviceConfiguration::m_deviceInfo, m_lastResult, CmtDeviceConfiguration::m_numberOfDevices, XRV_INVALIDPARAM, and XRV_OK.
XsensResultValue xsens::Cmt3::getPortNr | ( | uint8_t & | port | ) | const |
Return the device Id of an MT device.
This function returns the ID of the index'th MT (non-Xbus Master) device connected to this object.
If CMT is reading from a log file, an error will be returned.
Definition at line 1007 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, xsens::Cmt2s::getPortNr(), m_lastResult, and m_serial.
XsensResultValue xsens::Cmt3::getProductCode | ( | char * | productCode, |
const CmtDeviceId | deviceId = CMT_DID_MASTER |
||
) |
Return product code.
This function retrieves the product code of the given device.
productCode | The buffer that will store the product code. This buffer should be at least 20 bytes. |
Definition at line 1017 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_MID_REQPRODUCTCODE, deviceId, DO_DATA_REQUEST, xsens::Message::getDataBuffer(), xsens::Message::getDataSize(), m_lastResult, mrpt::system::os::memcpy(), and XRV_OK.
Return current sample frequency.
This function determines the sample frequency of the device from the cached sample rate and skip factor and returns it. For devices connected to an Xbus Master, the values used by the Xbus Master are returned.
XsensResultValue xsens::Cmt3::getScenario | ( | uint8_t & | scenarioType, |
uint8_t & | scenarioVersion, | ||
const CmtDeviceId | deviceId = CMT_DID_MASTER |
||
) |
Get the currently active scenario from a Motion Tracker.
This function retrieves the scenario currently used by the specified device when outputting orientation and/or position data.
Definition at line 2904 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_MID_REQSCENARIO, deviceId, DO_DATA_REQUEST, xsens::Message::getDataByte(), m_lastResult, and XRV_OK.
XsensResultValue xsens::Cmt3::getSerialBaudrate | ( | uint32_t & | baudrate | ) |
Return the baud rate used for serial communication.
This function retrieves the baud rate that is used when the device is connected by a serial connection. In most cases this is the same as getBaudrate, but when an Xbus Master is connected by a Bluetooth connection, it doesn't have to be.
Definition at line 1045 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_BAUD_RATE_115K2, CMT_BAUD_RATE_19K2, CMT_BAUD_RATE_230K4, CMT_BAUD_RATE_38K4, CMT_BAUD_RATE_460K8, CMT_BAUD_RATE_57K6, CMT_BAUD_RATE_921K6, CMT_BAUD_RATE_9600, CMT_BAUDCODE_115K2, CMT_BAUDCODE_19K2, CMT_BAUDCODE_230K4, CMT_BAUDCODE_38K4, CMT_BAUDCODE_460K8, CMT_BAUDCODE_57K6, CMT_BAUDCODE_921K6, CMT_BAUDCODE_9K6, CMT_BID_MASTER, CMT_MID_REQBAUDRATE, DO_DATA_REQUEST_BID, xsens::Message::getDataByte(), m_lastResult, XRV_BAUDRATEINVALID, and XRV_OK.
XsensResultValue xsens::Cmt3::getSyncInMode | ( | uint16_t & | mode | ) |
Retrieve the inbound synchronization mode of an MT device.
This function retrieves the current inbound synchronization mode of the MT device. This function does not work for Xbus Masters and should not be used for sensors connected to an Xbus Master.
Definition at line 1142 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_BID_MASTER, CMT_MID_REQSYNCINSETTINGS, CMT_MID_REQSYNCINSETTINGSACK, CMT_PARAM_SYNCIN_MODE, xsens::Message::getDataShort(), HANDLE_ERR_RESULT, m_lastResult, m_logFile, m_logging, m_serial, xsens::Message::setBusId(), xsens::Message::setDataByte(), xsens::Cmt2s::waitForMessage(), xsens::Cmt2s::writeMessage(), xsens::Cmt2f::writeMessage(), and XRV_OK.
XsensResultValue xsens::Cmt3::getSyncInOffset | ( | uint32_t & | offset | ) |
Retrieve the inbound synchronization offset of an MT device.
This function retrieves the current inbound synchronization offset of the MT device. This function does not work for Xbus Masters and should not be used for sensors connected to an Xbus Master.
Definition at line 1192 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_BID_MASTER, CMT_MID_REQSYNCINSETTINGS, CMT_MID_REQSYNCINSETTINGSACK, CMT_PARAM_SYNCIN_OFFSET, CMT_SYNC_CLOCK_TICKS_TO_NS, xsens::Message::getDataLong(), HANDLE_ERR_RESULT, m_lastResult, m_logFile, m_logging, m_serial, xsens::Message::setBusId(), xsens::Message::setDataByte(), xsens::Cmt2s::waitForMessage(), xsens::Cmt2s::writeMessage(), xsens::Cmt2f::writeMessage(), and XRV_OK.
XsensResultValue xsens::Cmt3::getSyncInSettings | ( | CmtSyncInSettings & | settings | ) |
Retrieve the inbound synchronization settings of the master MT device.
This function retrieves the current inbound synchronization settings of the master MT device (sync mode, skip factor and offset). This function does not work for Xbus Masters and should not be used for sensors connected to an Xbus Master.
Definition at line 1094 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_BID_MASTER, CMT_MID_REQSYNCINSETTINGS, CMT_MID_REQSYNCINSETTINGSACK, CMT_PARAM_SYNCIN_MODE, CMT_PARAM_SYNCIN_OFFSET, CMT_PARAM_SYNCIN_SKIPFACTOR, CMT_SYNC_CLOCK_TICKS_TO_NS, xsens::Message::getDataLong(), xsens::Message::getDataShort(), HANDLE_ERR_RESULT, m_lastResult, m_logFile, m_logging, CmtSyncInSettings::m_mode, CmtSyncInSettings::m_offset, m_serial, CmtSyncInSettings::m_skipFactor, xsens::Message::setBusId(), xsens::Message::setDataByte(), xsens::Cmt2s::waitForMessage(), xsens::Cmt2s::writeMessage(), xsens::Cmt2f::writeMessage(), and XRV_OK.
XsensResultValue xsens::Cmt3::getSyncInSkipFactor | ( | uint16_t & | skipFactor | ) |
Retrieve the inbound synchronization skip factor of an MT device.
This function retrieves the current inbound synchronization skip factor of the MT device. This function does not work for Xbus Masters and should not be used for sensors connected to an Xbus Master.
Definition at line 1167 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_BID_MASTER, CMT_MID_REQSYNCINSETTINGS, CMT_MID_REQSYNCINSETTINGSACK, CMT_PARAM_SYNCIN_SKIPFACTOR, xsens::Message::getDataShort(), HANDLE_ERR_RESULT, m_lastResult, m_logFile, m_logging, m_serial, xsens::Message::setBusId(), xsens::Message::setDataByte(), xsens::Cmt2s::waitForMessage(), xsens::Cmt2s::writeMessage(), xsens::Cmt2f::writeMessage(), and XRV_OK.
XsensResultValue xsens::Cmt3::getSyncMode | ( | uint8_t & | mode | ) |
Retrieve the sync mode of the Xbus Master.
This function requests the current synchronization mode used by the specified Xbus Master. This function is not valid for MT devices.
Definition at line 1220 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_BID_MASTER, CMT_MID_REQSYNCMODE, DO_DATA_REQUEST_BID, xsens::Message::getDataByte(), m_lastResult, and XRV_OK.
XsensResultValue xsens::Cmt3::getSyncOutMode | ( | uint16_t & | mode | ) |
Retrieve the outbound synchronization mode of an MT device.
This function retrieves the current outbound synchronization mode of the MT device. This function does not work for Xbus Masters and should not be used for sensors connected to an Xbus Master.
Definition at line 1291 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_BID_MASTER, CMT_MID_REQSYNCOUTSETTINGS, CMT_MID_REQSYNCOUTSETTINGSACK, CMT_PARAM_SYNCOUT_MODE, xsens::Message::getDataShort(), HANDLE_ERR_RESULT, m_lastResult, m_logFile, m_logging, m_serial, xsens::Message::setBusId(), xsens::Message::setDataByte(), xsens::Cmt2s::waitForMessage(), xsens::Cmt2s::writeMessage(), xsens::Cmt2f::writeMessage(), and XRV_OK.
XsensResultValue xsens::Cmt3::getSyncOutOffset | ( | uint32_t & | offset | ) |
Retrieve the outbound synchronization offset of an MT device.
This function retrieves the current outbound synchronization offset of the MT device. This function does not work for Xbus Masters and should not be used for sensors connected to an Xbus Master.
Definition at line 1369 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_BID_MASTER, CMT_MID_REQSYNCOUTSETTINGS, CMT_MID_REQSYNCOUTSETTINGSACK, CMT_PARAM_SYNCOUT_OFFSET, CMT_SYNC_CLOCK_TICKS_TO_NS, xsens::Message::getDataLong(), HANDLE_ERR_RESULT, m_lastResult, m_logFile, m_logging, m_serial, xsens::Message::setBusId(), xsens::Message::setDataByte(), xsens::Cmt2s::waitForMessage(), xsens::Cmt2s::writeMessage(), xsens::Cmt2f::writeMessage(), and XRV_OK.
XsensResultValue xsens::Cmt3::getSyncOutPulseWidth | ( | uint32_t & | pulseWidth | ) |
Retrieve the outbound synchronization pulse width of an MT device.
This function retrieves the current outbound synchronization pulse width of the MT device. This function does not work for Xbus Masters and should not be used for sensors connected to an Xbus Master.
Definition at line 1316 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_BID_MASTER, CMT_MID_REQSYNCOUTSETTINGS, CMT_MID_REQSYNCOUTSETTINGSACK, CMT_PARAM_SYNCOUT_PULSEWIDTH, CMT_SYNC_CLOCK_TICKS_TO_NS, xsens::Message::getDataLong(), HANDLE_ERR_RESULT, m_lastResult, m_logFile, m_logging, m_serial, xsens::Message::setBusId(), xsens::Message::setDataByte(), xsens::Cmt2s::waitForMessage(), xsens::Cmt2s::writeMessage(), xsens::Cmt2f::writeMessage(), and XRV_OK.
XsensResultValue xsens::Cmt3::getSyncOutSettings | ( | CmtSyncOutSettings & | settings | ) |
Retrieve the outbound synchronization settings of the master MT device.
This function retrieves the current outbound synchronization settings of the MT device (sync mode, skip factor, offset and pulse width). This function does not work for Xbus Masters and should not be used for sensors connected to an Xbus Master.
Definition at line 1232 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_BID_MASTER, CMT_MID_REQSYNCOUTSETTINGS, CMT_MID_REQSYNCOUTSETTINGSACK, CMT_PARAM_SYNCOUT_MODE, CMT_PARAM_SYNCOUT_OFFSET, CMT_PARAM_SYNCOUT_PULSEWIDTH, CMT_PARAM_SYNCOUT_SKIPFACTOR, CMT_SYNC_CLOCK_TICKS_TO_NS, xsens::Message::getDataLong(), xsens::Message::getDataShort(), HANDLE_ERR_RESULT, m_lastResult, m_logFile, m_logging, CmtSyncOutSettings::m_mode, CmtSyncOutSettings::m_offset, CmtSyncOutSettings::m_pulseWidth, m_serial, CmtSyncOutSettings::m_skipFactor, xsens::Message::setBusId(), xsens::Message::setDataByte(), xsens::Cmt2s::waitForMessage(), xsens::Cmt2s::writeMessage(), xsens::Cmt2f::writeMessage(), and XRV_OK.
XsensResultValue xsens::Cmt3::getSyncOutSkipFactor | ( | uint16_t & | skipFactor | ) |
Retrieve the outbound synchronization skip factor of an MT device.
This function retrieves the current outbound synchronization skip factor of the MT device. This function does not work for Xbus Masters and should not be used for sensors connected to an Xbus Master.
Definition at line 1344 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_BID_MASTER, CMT_MID_REQSYNCOUTSETTINGS, CMT_MID_REQSYNCOUTSETTINGSACK, CMT_PARAM_SYNCOUT_SKIPFACTOR, xsens::Message::getDataShort(), HANDLE_ERR_RESULT, m_lastResult, m_logFile, m_logging, m_serial, xsens::Message::setBusId(), xsens::Message::setDataByte(), xsens::Cmt2s::waitForMessage(), xsens::Cmt2s::writeMessage(), xsens::Cmt2f::writeMessage(), and XRV_OK.
Return the configuration mode timeout.
When in config mode, the system uses a different message timeout than in measurement mode, since configuration messages can take longer to process than measurement mode messages. This function can be used to determine the current config mode timeout in ms.
Definition at line 1396 of file cmt3.cpp.
References m_timeoutConf.
Return the measurement mode timeout.
When in measurement mode, the system uses a different message timeout than in config mode, since measurement mode messages should be faster to process than config mode messages. This function can be used to determine the current measurement mode timeout in ms.
Definition at line 1402 of file cmt3.cpp.
References m_timeoutMeas.
XsensResultValue xsens::Cmt3::getUtcTime | ( | CmtUtcTime & | utc, |
const CmtDeviceId | deviceId | ||
) |
Return the UTC time of the last received sample.
This function is only valid for MTi-G sensors. In measurement mode it will retrieve the UTC time of the last received sample. In Config mode, it will retrieve the most recent UTC time. In config mode, the time returned will be requested diectly from the GPS subsystem, with several layers of messaging between the original source and the host. In measurement mode, the UTC time is requested from the GPS subsystem periodically and estimated (with a very high precision) for the remaining samples. So in config mode, the time will probably jitter more than in measurement mode.
Definition at line 1409 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_MID_REQUTCTIME, deviceId, DO_DATA_REQUEST, xsens::Message::getDataByte(), xsens::Message::getDataLong(), xsens::Message::getDataShort(), CmtUtcTime::m_day, CmtUtcTime::m_hour, m_lastResult, CmtUtcTime::m_minute, CmtUtcTime::m_month, CmtUtcTime::m_nano, CmtUtcTime::m_second, CmtUtcTime::m_valid, CmtUtcTime::m_year, and XRV_OK.
XsensResultValue xsens::Cmt3::getXmOutputMode | ( | uint8_t & | mode | ) |
Return the dual-output mode of the XM.
This function retrieves the dual mode output mode of the Xbus Master. The dual output mode of the Xbus Master defines whether it will send data on the serial connection (at the same baud rate as the bluetooth connection) when it is connected via Bluetooth. When set to 0, the serial communication is disabled, data is sent over the serial bus.
Definition at line 1433 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_BID_MASTER, CMT_MID_REQOPMODE, DO_DATA_REQUEST_BID, xsens::Message::getDataByte(), m_lastResult, and XRV_OK.
XsensResultValue xsens::Cmt3::gotoConfig | ( | void | ) |
Place all connected devices into Configuration Mode.
This function places the sensors in configuration mode.
Definition at line 1445 of file cmt3.cpp.
References CMT3_CONFIG_TIMEOUT, CMT3EXITLOG, CMT3LOG, CMT_BID_MASTER, CMT_DID_MASTER, CMT_MID_ERROR, CMT_MID_GOTOCONFIG, CMT_MID_GOTOCONFIGACK, xsens::Cmt1s::flushData(), xsens::Cmt2s::getCmt1s(), xsens::Message::getDataByte(), xsens::Message::getDataSize(), getDeviceId(), xsens::Cmt2s::getLastResult(), xsens::Message::getMessageId(), xsens::Cmt1s::getPortNr(), m_gotoConfigTries, m_lastHwError, m_lastHwErrorDeviceId, m_lastResult, m_logFile, m_logging, m_measuring, m_serial, m_timeoutConf, xsens::msleep(), xsens::Message::setBusId(), xsens::Cmt2s::setTimeout(), xsens::timeStampNow(), xsens::Cmt2s::waitForMessage(), xsens::Cmt2s::writeMessage(), xsens::Cmt2f::writeMessage(), XRV_OK, XRV_TIMEOUTNODATA, and xsensResultText().
Referenced by closePort(), openPort(), and refreshCache().
XsensResultValue xsens::Cmt3::gotoMeasurement | ( | void | ) |
Place all connected devices into Measurement Mode.
This function places the sensors in measurement mode.
Definition at line 1499 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_BID_MASTER, CMT_MID_GOTOMEASUREMENT, CMT_MID_GOTOMEASUREMENTACK, xsens::Cmt2s::getCmt1s(), xsens::Cmt1s::getPortNr(), HANDLE_ERR_RESULT, m_lastResult, m_logFile, m_logging, m_measuring, m_rtcInitialized, m_serial, m_timeoutMeas, xsens::Message::setBusId(), xsens::Cmt2s::setTimeout(), xsens::Cmt2s::waitForMessage(), xsens::Cmt2s::writeMessage(), xsens::Cmt2f::writeMessage(), and XRV_OK.
Referenced by setBaudrate().
XsensResultValue xsens::Cmt3::initBus | ( | void | ) |
Perform an initBus request.
See the low-level documentation for more information on the InitBus message.
Definition at line 1523 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_BID_MASTER, CMT_MID_INITBUS, DO_DATA_REQUEST_BID, xsens::Cmt2s::getCmt1s(), xsens::Cmt1s::getPortNr(), m_lastResult, m_serial, and XRV_OK.
Referenced by openPort().
bool xsens::Cmt3::isLogFileOpen | ( | const char * | filename | ) | const |
Return whether or not(true or false) the supplied file is open.
When the filename parameter is NULL or empty "", the function will simply return whether a log file is open. Otherwise, the supplied name will be checked against the name of the open log file as well.
Definition at line 2723 of file cmt3.cpp.
References mrpt::system::os::_strnicmp(), CMT3LOG, CMT_MAX_FILENAME_LENGTH, xsens::Cmt2f::getName(), xsens::Cmt2f::isOpen(), and m_logFile.
bool xsens::Cmt3::isLogFileOpen | ( | const wchar_t * | filename | ) | const |
Return whether or not(true or false) the supplied file is open.
When the filename parameter is NULL or empty "", the function will simply return whether a log file is open. Otherwise, the supplied name will be checked against the name of the open log file as well.
Definition at line 2742 of file cmt3.cpp.
References CMT3LOG, CMT_MAX_FILENAME_LENGTH, xsens::Cmt2f::getName(), xsens::Cmt2f::isOpen(), and m_logFile.
|
inline |
|
inline |
<
Return whether the communication port is open or not.
Definition at line 142 of file cmt3.h.
References xsens::Cmt2s::isOpen(), and m_serial.
bool xsens::Cmt3::isXm | ( | void | ) | const |
Return whether the main device is an Xbus Master or not.
Definition at line 1534 of file cmt3.cpp.
References CMT_DID_TYPEH_MASK, CMT_DID_TYPEH_XM, m_config, and CmtDeviceConfiguration::m_masterDeviceId.
Referenced by getDeviceCount(), getEMtsData(), getErrorMode(), requestData(), setDeviceMode2(), setErrorMode(), setSyncInMode(), setSyncInOffset(), setSyncInSettings(), setSyncInSkipFactor(), setSyncMode(), setSyncOutMode(), setSyncOutOffset(), setSyncOutPulseWidth(), setSyncOutSettings(), setSyncOutSkipFactor(), setXmOutputMode(), and setXmPowerOff().
XsensResultValue xsens::Cmt3::openLogFile | ( | const char * | filename | ) |
Open a log file for input.
This function opens the supplied log file for reading. The function will fail if a serial connection is currently open.
filename | The name of the file to open. It is recommended to use a fully qualified path+filename. |
Definition at line 2761 of file cmt3.cpp.
References xsens::Cmt2f::close(), CMT3EXITLOG, CMT3LOG, xsens::Cmt2s::isOpen(), xsens::Cmt2f::isOpen(), m_lastResult, m_logFile, m_logging, m_readFromFile, m_serial, xsens::Cmt2f::open(), refreshCache(), XRV_ALREADYOPEN, XRV_INVALIDOPERATION, and XRV_OK.
XsensResultValue xsens::Cmt3::openLogFile | ( | const wchar_t * | filename | ) |
Open a log file for input.
This function opens the supplied log file for reading. The function will fail if a serial connection is currently open.
filename | The name of the file to open. It is recommended to use a fully qualified path+filename. |
Definition at line 2786 of file cmt3.cpp.
References xsens::Cmt2f::close(), CMT3EXITLOG, CMT3LOG, xsens::Cmt2s::isOpen(), xsens::Cmt2f::isOpen(), m_lastResult, m_logFile, m_logging, m_readFromFile, m_serial, xsens::Cmt2f::open(), refreshCache(), XRV_ALREADYOPEN, XRV_INVALIDOPERATION, and XRV_OK.
XsensResultValue xsens::Cmt3::openPort | ( | const char * | portName, |
const uint32_t | baudRate = CMT_DEFAULT_BAUD_RATE |
||
) |
Definition at line 1541 of file cmt3.cpp.
References xsens::Cmt2s::close(), CMT3EXITLOG, CMT3LOG, gotoConfig(), initBus(), xsens::Cmt2f::isOpen(), m_baudrate, m_lastResult, m_logFile, m_logging, m_measuring, m_rtcInitialized, m_serial, m_timeoutConf, m_timeoutMeas, xsens::Cmt2s::open(), refreshCache(), xsens::Cmt2s::setTimeout(), XRV_ALREADYOPEN, XRV_CONFIGCHECKFAIL, XRV_OK, and xsensResultText().
Referenced by xsens::cmtScanPort(), and setBaudrate().
XsensResultValue xsens::Cmt3::openPort | ( | const uint32_t | portNumber, |
const uint32_t | baudRate = CMT_DEFAULT_BAUD_RATE |
||
) |
Open a communication channel to the given COM port number.
This function is first passed through to the Cmt2s object. Then, the device settings are retrieved and stored locally. This function automatically places the device(s) in config mode, using gotoConfig.
Definition at line 1593 of file cmt3.cpp.
References xsens::Cmt2s::close(), CMT3EXITLOG, CMT3LOG, gotoConfig(), initBus(), xsens::Cmt2f::isOpen(), m_baudrate, m_lastResult, m_logFile, m_logging, m_measuring, m_rtcInitialized, m_serial, m_timeoutConf, m_timeoutMeas, xsens::Cmt2s::open(), refreshCache(), xsens::Cmt2s::setTimeout(), XRV_ALREADYOPEN, XRV_CONFIGCHECKFAIL, XRV_OK, and xsensResultText().
XsensResultValue xsens::Cmt3::peekLogMessageId | ( | uint8_t & | messageId | ) |
Open a communication channel to the given COM port number.
This function is first passed through to the Cmt2s object. Then, the device settings are retrieved and stored locally. This function automatically places the device(s) in config mode, using gotoConfig.
This function can only be used when reading from a log file. It will find the next message in the file and place its message ID in the messageId parameter. Afterwards, the read position of the file will be restored.
Definition at line 1646 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, xsens::Message::getMessageId(), xsens::Cmt2f::getReadPosition(), m_lastResult, m_logFile, m_readFromFile, xsens::Cmt2f::readMessage(), xsens::Cmt2f::setReadPosition(), XRV_INVALIDOPERATION, and XRV_OK.
XsensResultValue xsens::Cmt3::readDataPacket | ( | Packet * | pack, |
bool | acceptOther = false |
||
) |
Retrieve a data message.
This function will attempt to read a data message from the open port or from the log file, depending on the system state. When acceptOther is set to true, the first received message will be returned. If a data message is successfully read, XRV_OK will be returned. If another message is read, XRV_OTHER will be returned and the received message will be placed in the Packet. Otherwise, an appropriate error will be returned.
Definition at line 1672 of file cmt3.cpp.
References CMT3EXITLOGDAT, CMT3LOGDAT, CMT_MID_ERROR, CMT_MID_MTDATA, fillRtc(), xsens::Message::getDataByte(), xsens::Message::getDataSize(), getDeviceId(), xsens::Message::getMessageId(), m_config, CmtDeviceConfiguration::_devInfo::m_deviceId, CmtDeviceConfiguration::m_deviceInfo, xsens::Packet::m_itemCount, m_lastHwError, m_lastHwErrorDeviceId, m_lastResult, m_logFile, m_logging, CmtDeviceConfiguration::m_masterDeviceId, xsens::Packet::m_msg, CmtDeviceConfiguration::m_numberOfDevices, CmtDeviceConfiguration::_devInfo::m_outputMode, CmtDeviceConfiguration::_devInfo::m_outputSettings, m_readFromFile, m_serial, xsens::Packet::m_toa, m_useRtc, xsens::Cmt2s::readMessage(), xsens::Cmt2f::readMessage(), xsens::Packet::setDataFormat(), xsens::Packet::setXbus(), xsens::timeStampNow(), xsens::Cmt2f::writeMessage(), XRV_OK, and XRV_OTHER.
Referenced by requestData().
XsensResultValue xsens::Cmt3::refreshCache | ( | const bool | file = false | ) |
Update device information stored on host PC.
Some device information is cached on the host PC for faster access. The Cmt3 automatically tries to keep the cache up to date. But when unexpected things happen, such as custom messages that change the settings, or a power-cycle, then the user may need to tell Cmt3 to update its cache. When both a file and a port are open, the file parameter can be used to indicate what data source to read from (true is file, false is port).
Definition at line 2529 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_MAX_DEVICES_PER_PORT, CMT_MID_CONFIGURATION, CMT_MID_REQCONFIGURATION, xsens::Message::getMessageStart(), gotoConfig(), xsens::Cmt2s::isOpen(), xsens::Cmt2f::isOpen(), m_config, m_eMtsData, m_lastResult, m_logFile, m_logging, m_measuring, CmtDeviceConfiguration::m_outputSkipFactor, m_period, CmtDeviceConfiguration::m_samplingPeriod, m_serial, m_skip, CmtDeviceConfiguration::readFromMessage(), xsens::Cmt2f::readMessage(), xsens::Message::setMessageId(), xsens::Cmt2s::waitForMessage(), xsens::Cmt2s::writeMessage(), xsens::Cmt2f::writeMessage(), XRV_NOFILEORPORTOPEN, and XRV_OK.
Referenced by openLogFile(), openPort(), and reset().
XsensResultValue xsens::Cmt3::requestData | ( | Packet * | pack | ) |
Definition at line 1763 of file cmt3.cpp.
References CMT3EXITLOGDAT, CMT3LOGDAT, CMT_MID_REQDATA, isXm(), m_lastResult, m_serial, readDataPacket(), xsens::Cmt2s::writeMessage(), and XRV_INVALIDOPERATION.
XsensResultValue xsens::Cmt3::reset | ( | void | ) |
Request a data message and wait for it to arrive.
This function is only useful when the skip factor is set to 0xFFFF. Reset all connected sensors.
Definition at line 1777 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_BID_MASTER, CMT_MID_RESET, CMT_MID_RESETACK, m_lastResult, m_logFile, m_logging, m_measuring, m_serial, refreshCache(), xsens::Message::setBusId(), xsens::Cmt2s::waitForMessage(), xsens::Cmt2s::writeMessage(), xsens::Cmt2f::writeMessage(), and XRV_OK.
XsensResultValue xsens::Cmt3::resetLogFileReadPos | ( | void | ) |
Restart reading from the start of the open log file.
This function resets the read position to the start of the open log file. Only the read position is affected, the write position remains the same.
Definition at line 2854 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, m_lastResult, m_logFile, and xsens::Cmt2f::setReadPosition().
XsensResultValue xsens::Cmt3::resetOrientation | ( | const CmtResetMethod | method, |
const CmtDeviceId | deviceId = CMT_DID_MASTER |
||
) |
Perform an orientation reset on a device.
This function performs an orientation reset. See the MT documentation for more information about Orientation resets.
Definition at line 1798 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_LEN_RESETORIENTATION, CMT_MID_RESETORIENTATION, deviceId, DO_DATA_SET, m_lastResult, and XRV_OK.
XsensResultValue xsens::Cmt3::restoreFactoryDefaults | ( | const CmtDeviceId | deviceId = CMT_DID_MASTER | ) |
Restore the device to factory default settings.
Restore the factory defaults of a device.
This function completely restores the selected device to the default settings (115k2 baud rate, 100Hz sample frequency, factory defined scenarios).
Definition at line 1809 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_MID_RESTOREFACTORYDEF, deviceId, DO_DATA_REQUEST, m_lastResult, and XRV_OK.
XsensResultValue xsens::Cmt3::setBaudrate | ( | const uint32_t | baudrate, |
bool | reconnect = true |
||
) |
Set the baudrate and possibly reconnect.
Use this function to change the baudrate of the device. This actually tries to change the baud rate of the current connection. When reconnect is set to true, the device receives a Reset message and the port is reopened at the new baudrate. Otherwise, make sure to perform a Reset manually, since the new baudrate will not be set until a Reset has been performed.
Definition at line 1835 of file cmt3.cpp.
References closePort(), CMT3EXITLOG, CMT3LOG, CMT_BAUD_RATE_115K2, CMT_BAUD_RATE_19K2, CMT_BAUD_RATE_230K4, CMT_BAUD_RATE_38K4, CMT_BAUD_RATE_460K8, CMT_BAUD_RATE_57K6, CMT_BAUD_RATE_921K6, CMT_BAUD_RATE_9600, CMT_BAUDCODE_115K2, CMT_BAUDCODE_19K2, CMT_BAUDCODE_230K4, CMT_BAUDCODE_38K4, CMT_BAUDCODE_460K8, CMT_BAUDCODE_57K6, CMT_BAUDCODE_921K6, CMT_BAUDCODE_9K6, CMT_BID_MASTER, CMT_LEN_BAUDRATE, CMT_MID_REQBAUDRATE, CMT_MID_RESET, CMT_MID_RESETACK, DO_DATA_SET_BID, xsens::Cmt2s::getPortName(), xsens::Cmt2s::getPortNr(), gotoMeasurement(), m_baudrate, m_lastResult, m_logFile, m_logging, m_measuring, m_serial, openPort(), xsens::Message::setBusId(), xsens::Cmt2s::waitForMessage(), xsens::Cmt2s::writeMessage(), xsens::Cmt2f::writeMessage(), XRV_BAUDRATEINVALID, and XRV_OK.
XsensResultValue xsens::Cmt3::setBluetoothState | ( | const bool | enabled | ) |
Set the Bluetooth state of the Xbus Master.
This function sets the state of the bluetooth communication to on or off.
Definition at line 1924 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_BID_MASTER, CMT_LEN_BTDISABLE, CMT_MID_REQBTDISABLE, DO_DATA_SET_BID, m_lastResult, and XRV_OK.
XsensResultValue xsens::Cmt3::setBusPowerState | ( | const bool | enabled | ) |
Switch the Xbus Master bus power on or off.
Use this function to switch the Xbus Master Xbus power on or off.
Definition at line 1936 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_BID_MASTER, CMT_LEN_BUSPWR, CMT_MID_BUSPWR, DO_DATA_SET_BID, m_lastResult, and XRV_OK.
XsensResultValue xsens::Cmt3::setDataSource | ( | bool | readFromFile | ) |
Set whether to read from comm port or file.
While it is not possible to open a port or file while the other is open, it is possible to create a log file while a port is open. In some rare cases it may be required to log data and read it back while the port remains open and then continue logging in the same file. This is not recommended. Instead, log to a file, close it and then open it in another Cmt3 object. However, if you must do this, then this function can be used to specify that you want to switch between reading from the log file (true) or port (false).
Definition at line 2811 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, xsens::Cmt2s::isOpen(), xsens::Cmt2f::isOpen(), m_lastResult, m_logFile, m_logging, m_readFromFile, m_serial, XRV_INVALIDOPERATION, XRV_NOFILEORPORTOPEN, and XRV_OK.
XsensResultValue xsens::Cmt3::setDeviceMode | ( | const CmtDeviceMode & | mode, |
bool | force, | ||
const CmtDeviceId | deviceId = CMT_DID_MASTER |
||
) |
Set the complete output mode of a device.
This function updates the complete output mode of the specified device. It only updates values that are different than those reported by the device unless force is set to true. The function will automatically update only the part of the device mode that is relevant for the device. So it is possible to configure all devices, including an Xbus Master with the same mode (only the Xbus Master will update its period, while the Motion Trackers will update their output mode and settings).
Definition at line 1948 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, deviceId, CmtDeviceMode2::m_outputMode, CmtDeviceMode2::m_outputSettings, setDeviceMode2(), and CmtDeviceMode2::setSampleFrequency().
XsensResultValue xsens::Cmt3::setDeviceMode2 | ( | const CmtDeviceMode2 & | mode, |
bool | force, | ||
const CmtDeviceId | deviceId = CMT_DID_MASTER |
||
) |
Set the complete output mode2 of a device.
This function updates the complete output mode of the specified device. It only updates values that are different than those reported by the device unless force is set to true. The function will automatically update only the part of the device mode that is relevant for the device. So it is possible to configure all devices, including an Xbus Master with the same mode (only the Xbus Master will update its period, while the Motion Trackers will update their output mode and settings).
Definition at line 1963 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_BID_BROADCAST, CMT_BID_INVALID, CMT_BID_MASTER, CMT_DID_BROADCAST, CMT_DID_TYPEH_MASK, CMT_DID_TYPEH_XM, CMT_MID_REQOUTPUTMODE, CMT_MID_REQOUTPUTMODEACK, CMT_MID_REQOUTPUTSETTINGS, CMT_MID_REQOUTPUTSETTINGSACK, CMT_MID_REQOUTPUTSKIPFACTOR, CMT_MID_REQOUTPUTSKIPFACTORACK, CMT_MID_REQPERIOD, CMT_MID_REQPERIODACK, CMT_OUTPUTSETTINGS_TIMESTAMP_MASK, deviceId, getBusIdInternal(), HANDLE_ERR_RESULT, isXm(), m_config, CmtDeviceConfiguration::_devInfo::m_deviceId, CmtDeviceConfiguration::m_deviceInfo, m_lastResult, m_logFile, m_logging, CmtDeviceConfiguration::m_masterDeviceId, CmtDeviceConfiguration::m_numberOfDevices, CmtDeviceConfiguration::_devInfo::m_outputMode, CmtDeviceConfiguration::_devInfo::m_outputSettings, CmtDeviceConfiguration::m_outputSkipFactor, m_period, CmtDeviceConfiguration::m_samplingPeriod, m_serial, m_skip, xsens::Message::resizeData(), xsens::Message::setBusId(), xsens::Message::setDataLong(), xsens::Message::setDataShort(), xsens::Message::setMessageId(), xsens::Cmt2s::waitForMessage(), xsens::Cmt2s::writeMessage(), xsens::Cmt2f::writeMessage(), XRV_INVALIDID, and XRV_OK.
Referenced by setDeviceMode().
XsensResultValue xsens::Cmt3::setErrorMode | ( | const uint16_t | mode | ) |
Set the error mode of the device.
This function sets the error mode of the device. The error mode determines how the device handles errors. See the low-level communication documentation for more details.
Definition at line 2090 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_BID_MASTER, CMT_LEN_ERRORMODE, CMT_MID_REQERRORMODE, CMT_MID_REQXMERRORMODE, DO_DATA_SET_BID, isXm(), m_lastResult, and XRV_OK.
XsensResultValue xsens::Cmt3::setGotoConfigTries | ( | const uint16_t | tries | ) |
Set the number of times the gotoConfig function will attempt a gotoConfig before failing.
This is especially useful when using RS485 communication or when for some reason the communication lines are not reliable.
Definition at line 2107 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, m_gotoConfigTries, m_lastResult, and XRV_OK.
Referenced by xsens::cmtScanPort().
XsensResultValue xsens::Cmt3::setGpsLeverArm | ( | const CmtVector & | arm, |
const CmtDeviceId | deviceId = CMT_DID_MASTER |
||
) |
Set the currently used GPS lever arm.
Use this function to set the vector currently used as the GPS lever arm. The GPS lever arm is the relative position of the GPS antenna to the MTi-G unit. The arm is specified in the object coordinate system and in meters. See the manual for more information on coordinate systems, alignment resets and the lever arm.
Definition at line 2972 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_BID_BROADCAST, CMT_BID_INVALID, CMT_LEN_GPSLEVERARM, CMT_MID_ERROR, CMT_MID_SETGPSLEVERARM, CMT_MID_SETGPSLEVERARMACK, deviceId, getBusIdInternal(), xsens::Message::getDataByte(), xsens::Message::getDataSize(), getDeviceId(), xsens::Message::getMessageId(), m_config, CmtVector::m_data, m_lastHwError, m_lastHwErrorDeviceId, m_lastResult, m_logFile, m_logging, CmtDeviceConfiguration::m_masterDeviceId, m_serial, xsens::Message::setBusId(), xsens::Message::setDataFloat(), xsens::Cmt2s::waitForMessage(), xsens::Cmt2s::writeMessage(), xsens::Cmt2f::writeMessage(), XRV_INVALIDID, and XRV_OK.
XsensResultValue xsens::Cmt3::setGravityMagnitude | ( | const double | magnitude, |
const CmtDeviceId | deviceId = CMT_DID_MASTER |
||
) |
Set the currently used magnitude of the gravity vector.
The magnitude of the gravity vector is used to determine absolute acceleration from measured acceleration. Use this function to set tit to a custom value in m/s2. The default value of 9.812687357684514m/s2 should be fine for most places on earth, but in some cases the gravity may be drastically different from standard Earth gravity (eg. space, deep subterranean/submarine, polar regions, gravitational anomalies. See also http://www.abc.net.au/science/news/stories/s911917.htm and http://en.wikipedia.org/wiki/Earth%27s_gravity#Comparative_gravities_in_various_cities_around_the_world)
Definition at line 2935 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_LEN_GRAVITYMAGNITUDE, CMT_MID_SETGRAVITYMAGNITUDE, deviceId, DO_DATA_SET, m_lastResult, and XRV_OK.
XsensResultValue xsens::Cmt3::setHeading | ( | const double | heading, |
const CmtDeviceId | deviceId = CMT_DID_MASTER |
||
) |
Set the heading offset.
This function sets the heading offset in radians used by the device. The valid range is -pi to +pi. The heading offset is used as a final correction on the output orientation.
Definition at line 2118 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_LEN_HEADING, CMT_MID_REQHEADING, deviceId, DO_DATA_SET, m_lastResult, and XRV_OK.
XsensResultValue xsens::Cmt3::setLocationId | ( | uint16_t | locationId, |
const CmtDeviceId | deviceId = CMT_DID_MASTER |
||
) |
Set the location ID of a sensor.
This function sets the location ID stored in the device.
Definition at line 2129 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_LEN_LOCATIONID, CMT_MID_REQLOCATIONID, deviceId, DO_DATA_SET, m_lastResult, and XRV_OK.
XsensResultValue xsens::Cmt3::setLogMode | ( | bool | active | ) |
Set the logging mode.
This function sets the logging mode to enabled (true) or disabled (false). When enabled, all received messages are logged to the file.
Definition at line 2842 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, xsens::Cmt2f::isOpen(), m_lastResult, m_logFile, m_logging, m_readFromFile, XRV_NOFILEOPEN, and XRV_OK.
XsensResultValue xsens::Cmt3::setMagneticDeclination | ( | const double | declination, |
const CmtDeviceId | deviceId = CMT_DID_MASTER |
||
) |
Set the stored magnetic declination.
This function sets the stored local magnetic declination in radians. The valid range is -pi to +pi. The magnetic declination is used in the sensor fusion process to determine the output orientation.
Definition at line 2140 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_LEN_MAGNETICDECLINATION, CMT_MID_SETMAGNETICDECLINATION, deviceId, DO_DATA_SET, m_lastResult, and XRV_OK.
XsensResultValue xsens::Cmt3::setScenario | ( | const uint8_t | scenarioType, |
const CmtDeviceId | deviceId = CMT_DID_MASTER |
||
) |
Specify the scenario to use in the sensor.
This function specifies the scenario that the sensor should use for converting raw data into orientation and/or position data. This must be one of the scenarios in the list supplied by getAvailableScenarios.
Definition at line 2915 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_LEN_SETSCENARIO, CMT_MID_SETSCENARIO, deviceId, DO_DATA_SET, m_lastResult, and XRV_OK.
XsensResultValue xsens::Cmt3::setSyncInMode | ( | const uint16_t | mode | ) |
Set the inbound synchronization mode of an MT device.
This function sets the current inbound synchronization mode of the MT device. This function does not work for Xbus Masters and should not be used for sensors connected to an Xbus Master.
Definition at line 2215 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_BID_MASTER, CMT_MID_REQSYNCINSETTINGS, CMT_MID_REQSYNCINSETTINGSACK, CMT_PARAM_SYNCIN_MODE, HANDLE_ERR_RESULT, isXm(), m_lastResult, m_logFile, m_logging, m_serial, xsens::Message::setBusId(), xsens::Message::setDataByte(), xsens::Message::setDataShort(), xsens::Cmt2s::waitForMessage(), xsens::Cmt2s::writeMessage(), xsens::Cmt2f::writeMessage(), XRV_INVALIDOPERATION, and XRV_OK.
XsensResultValue xsens::Cmt3::setSyncInOffset | ( | const uint32_t | offset | ) |
Set the inbound synchronization offset of an MT device.
This function sets the current inbound synchronization offset of the MT device. This function does not work for Xbus Masters and should not be used for sensors connected to an Xbus Master.
Definition at line 2271 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_BID_MASTER, CMT_MID_REQSYNCINSETTINGS, CMT_MID_REQSYNCINSETTINGSACK, CMT_PARAM_SYNCIN_OFFSET, CMT_SYNC_CLOCK_NS_TO_TICKS, HANDLE_ERR_RESULT, isXm(), m_lastResult, m_logFile, m_logging, m_serial, xsens::Message::setBusId(), xsens::Message::setDataByte(), xsens::Message::setDataLong(), xsens::Cmt2s::waitForMessage(), xsens::Cmt2s::writeMessage(), xsens::Cmt2f::writeMessage(), XRV_INVALIDOPERATION, and XRV_OK.
XsensResultValue xsens::Cmt3::setSyncInSettings | ( | const CmtSyncInSettings & | settings | ) |
Set the inbound synchronization settings of an MT device.
This function sets the current inbound synchronization settings of the MT device (sync mode, skip factor and offset). This function does not work for Xbus Masters and should not be used for sensors connected to an Xbus Master.
Definition at line 2165 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_BID_MASTER, CMT_MID_REQSYNCINSETTINGS, CMT_MID_REQSYNCINSETTINGSACK, CMT_PARAM_SYNCIN_MODE, CMT_PARAM_SYNCIN_OFFSET, CMT_PARAM_SYNCIN_SKIPFACTOR, CMT_SYNC_CLOCK_NS_TO_TICKS, HANDLE_ERR_RESULT, isXm(), m_lastResult, m_logFile, m_logging, CmtSyncInSettings::m_mode, CmtSyncInSettings::m_offset, m_serial, CmtSyncInSettings::m_skipFactor, xsens::Message::setBusId(), xsens::Message::setDataByte(), xsens::Message::setDataLong(), xsens::Message::setDataShort(), xsens::Cmt2s::waitForMessage(), xsens::Cmt2s::writeMessage(), xsens::Cmt2f::writeMessage(), XRV_INVALIDOPERATION, and XRV_OK.
XsensResultValue xsens::Cmt3::setSyncInSkipFactor | ( | const uint16_t | skipFactor | ) |
Set the inbound synchronization skip factor of an MT device.
This function sets the current inbound synchronization skip factor of the MT device. This function does not work for Xbus Masters and should not be used for sensors connected to an Xbus Master.
Definition at line 2243 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_BID_MASTER, CMT_MID_REQSYNCINSETTINGS, CMT_MID_REQSYNCINSETTINGSACK, CMT_PARAM_SYNCIN_SKIPFACTOR, HANDLE_ERR_RESULT, isXm(), m_lastResult, m_logFile, m_logging, m_serial, xsens::Message::setBusId(), xsens::Message::setDataByte(), xsens::Message::setDataShort(), xsens::Cmt2s::waitForMessage(), xsens::Cmt2s::writeMessage(), xsens::Cmt2f::writeMessage(), XRV_INVALIDOPERATION, and XRV_OK.
XsensResultValue xsens::Cmt3::setSyncMode | ( | const uint8_t | mode | ) |
Set the sync mode of the Xbus Master.
This function sets the current synchronization mode used by the specified Xbus Master. This function is not valid for MT devices.
Definition at line 2302 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_BID_MASTER, CMT_LEN_SYNCMODE, CMT_MID_REQSYNCMODE, DO_DATA_SET_BID, isXm(), m_lastResult, XRV_INVALIDOPERATION, and XRV_OK.
XsensResultValue xsens::Cmt3::setSyncOutMode | ( | const uint16_t | mode | ) |
Set the outbound synchronization mode of an MT device.
This function sets the current outbound synchronization mode of the MT device. This function does not work for Xbus Masters and should not be used for sensors connected to an Xbus Master.
Definition at line 2376 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_BID_MASTER, CMT_MID_REQSYNCOUTSETTINGS, CMT_MID_REQSYNCOUTSETTINGSACK, CMT_PARAM_SYNCOUT_MODE, HANDLE_ERR_RESULT, isXm(), m_lastResult, m_logFile, m_logging, m_serial, xsens::Message::setBusId(), xsens::Message::setDataByte(), xsens::Message::setDataShort(), xsens::Cmt2s::waitForMessage(), xsens::Cmt2s::writeMessage(), xsens::Cmt2f::writeMessage(), XRV_INVALIDOPERATION, and XRV_OK.
XsensResultValue xsens::Cmt3::setSyncOutOffset | ( | const uint32_t | offset | ) |
Set the outbound synchronization offset of an MT device.
This function sets the current outbound synchronization offset of the MT device. This function does not work for Xbus Masters and should not be used for sensors connected to an Xbus Master.
Definition at line 2461 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_BID_MASTER, CMT_MID_REQSYNCOUTSETTINGS, CMT_MID_REQSYNCOUTSETTINGSACK, CMT_PARAM_SYNCOUT_OFFSET, CMT_SYNC_CLOCK_NS_TO_TICKS, HANDLE_ERR_RESULT, isXm(), m_lastResult, m_logFile, m_logging, m_serial, xsens::Message::setBusId(), xsens::Message::setDataByte(), xsens::Message::setDataLong(), xsens::Cmt2s::waitForMessage(), xsens::Cmt2s::writeMessage(), xsens::Cmt2f::writeMessage(), XRV_INVALIDOPERATION, and XRV_OK.
XsensResultValue xsens::Cmt3::setSyncOutPulseWidth | ( | const uint32_t | pulseWidth | ) |
Set the outbound synchronization pulse width of an MT device.
This function sets the current outbound synchronization pulse width of the MT device. This function does not work for Xbus Masters and should not be used for sensors connected to an Xbus Master.
Definition at line 2404 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_BID_MASTER, CMT_MID_REQSYNCOUTSETTINGS, CMT_MID_REQSYNCOUTSETTINGSACK, CMT_PARAM_SYNCOUT_PULSEWIDTH, CMT_SYNC_CLOCK_NS_TO_TICKS, HANDLE_ERR_RESULT, isXm(), m_lastResult, m_logFile, m_logging, m_serial, xsens::Message::setBusId(), xsens::Message::setDataByte(), xsens::Message::setDataLong(), xsens::Cmt2s::waitForMessage(), xsens::Cmt2s::writeMessage(), xsens::Cmt2f::writeMessage(), XRV_INVALIDOPERATION, and XRV_OK.
XsensResultValue xsens::Cmt3::setSyncOutSettings | ( | const CmtSyncOutSettings & | settings | ) |
Set the outbound synchronization settings of an MT device.
This function sets the current outbound synchronization settings of the MT device (sync mode, skip factor, offset and pulse width). This function does not work for Xbus Masters and should not be used for sensors connected to an Xbus Master.
Definition at line 2316 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_BID_MASTER, CMT_MID_REQSYNCOUTSETTINGS, CMT_MID_REQSYNCOUTSETTINGSACK, CMT_PARAM_SYNCOUT_MODE, CMT_PARAM_SYNCOUT_OFFSET, CMT_PARAM_SYNCOUT_PULSEWIDTH, CMT_PARAM_SYNCOUT_SKIPFACTOR, CMT_SYNC_CLOCK_NS_TO_TICKS, HANDLE_ERR_RESULT, isXm(), m_lastResult, m_logFile, m_logging, CmtSyncOutSettings::m_mode, CmtSyncOutSettings::m_offset, CmtSyncOutSettings::m_pulseWidth, m_serial, CmtSyncOutSettings::m_skipFactor, xsens::Message::setBusId(), xsens::Message::setDataByte(), xsens::Message::setDataLong(), xsens::Message::setDataShort(), xsens::Cmt2s::waitForMessage(), xsens::Cmt2s::writeMessage(), xsens::Cmt2f::writeMessage(), XRV_INVALIDOPERATION, and XRV_OK.
XsensResultValue xsens::Cmt3::setSyncOutSkipFactor | ( | const uint16_t | skipFactor | ) |
Set the outbound synchronization skip factor of an MT device.
This function sets the current outbound synchronization skip factor of the MT device. This function does not work for Xbus Masters and should not be used for sensors connected to an Xbus Master.
Definition at line 2433 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_BID_MASTER, CMT_MID_REQSYNCOUTSETTINGS, CMT_MID_REQSYNCOUTSETTINGSACK, CMT_PARAM_SYNCOUT_SKIPFACTOR, HANDLE_ERR_RESULT, isXm(), m_lastResult, m_logFile, m_logging, m_serial, xsens::Message::setBusId(), xsens::Message::setDataByte(), xsens::Message::setDataShort(), xsens::Cmt2s::waitForMessage(), xsens::Cmt2s::writeMessage(), xsens::Cmt2f::writeMessage(), XRV_INVALIDOPERATION, and XRV_OK.
|
inline |
Definition at line 176 of file cmt3.h.
References m_lastResult, m_serial, and xsens::Cmt2s::setTimeout().
XsensResultValue xsens::Cmt3::setTimeoutConfig | ( | const uint32_t | timeout = CMT3_DEFAULT_TIMEOUT_CONF | ) |
Set the configuration mode timeout.
When in config mode, the system uses a different message timeout than in measurement mode, since configuration messages can take longer to process than measurement mode messages. This function can be used to set the config mode timeout in ms.
Definition at line 2490 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, m_lastResult, m_measuring, m_serial, m_timeoutConf, xsens::Cmt2s::setTimeout(), and XRV_OK.
Referenced by xsens::cmtScanPort().
XsensResultValue xsens::Cmt3::setTimeoutMeasurement | ( | const uint32_t | timeout = CMT3_DEFAULT_TIMEOUT_MEAS | ) |
Set the measurement mode timeout.
When in measurement mode, the system uses a different message timeout than in config mode, since measurement mode messages should be faster to process than config mode messages. This function can be used to set the measurement mode timeout in ms.
Definition at line 2503 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, m_lastResult, m_measuring, m_serial, m_timeoutMeas, xsens::Cmt2s::setTimeout(), and XRV_OK.
XsensResultValue xsens::Cmt3::setXmOutputMode | ( | const uint8_t | mode | ) |
Set the dual-output mode of the XM.
This function sets the dual mode output mode of the Xbus Master. The dual output mode of the Xbus Master defines whether it will send data on the serial connection (at the same baud rate as the bluetooth connection) when it is connected via Bluetooth. When set to 0, the serial communication is disabled, data is sent over the serial bus.
Definition at line 2516 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_BID_MASTER, CMT_LEN_OPMODE, CMT_MID_REQOPMODE, DO_DATA_SET_BID, isXm(), m_lastResult, XRV_INVALIDOPERATION, and XRV_OK.
XsensResultValue xsens::Cmt3::setXmPowerOff | ( | void | ) |
Switch the connected Xbus Master.
This function tell the connected Xbus Master to power down. This differs from setBusPowerState, because this function actually powers down the Xbus Master itself, while setBusPowerState only powers down the bus controlled by the Xbus Master. After This function is called, the Xbus Master must be manually switched on to make it operational again.
Definition at line 2151 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_BID_MASTER, CMT_MID_XMPWROFF, isXm(), m_lastResult, m_serial, xsens::Message::setBusId(), xsens::Cmt2s::writeMessage(), and XRV_INVALIDOPERATION.
XsensResultValue xsens::Cmt3::storeXkfState | ( | const CmtDeviceId | deviceId = CMT_DID_MASTER | ) |
Store important components of the XKF filter state to non-volatile memory.
This function allows you to store some critical components of the internal XKF filter state to non-volatile memory. The stored settings will be used to initialize the filter whenever the sensor is switched to Measurement mode.
Definition at line 3007 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, CMT_BID_BROADCAST, CMT_BID_INVALID, CMT_LEN_STOREXKFSTATE, CMT_MID_ERROR, CMT_MID_STOREXKFSTATE, CMT_MID_STOREXKFSTATEACK, deviceId, getBusIdInternal(), xsens::Message::getDataByte(), xsens::Message::getDataSize(), getDeviceId(), xsens::Message::getMessageId(), m_config, m_lastHwError, m_lastHwErrorDeviceId, m_lastResult, m_logFile, m_logging, CmtDeviceConfiguration::m_masterDeviceId, m_serial, xsens::Message::setBusId(), xsens::Cmt2s::waitForMessage(), xsens::Cmt2s::writeMessage(), xsens::Cmt2f::writeMessage(), XRV_INVALIDID, and XRV_OK.
XsensResultValue xsens::Cmt3::waitForDataMessage | ( | Packet * | pack | ) |
Wait for a data message to arrive.
The function waits for a data message to arrive or until a timeout occurs. The function will also accept error messages.
Definition at line 2604 of file cmt3.cpp.
References CMT3EXITLOGDAT, CMT3LOGDAT, CMT_MID_ERROR, CMT_MID_MTDATA, fillRtc(), xsens::Message::getDataByte(), xsens::Message::getDataSize(), getDeviceId(), xsens::Message::getMessageId(), xsens::getTimeOfDay(), m_config, CmtDeviceConfiguration::m_deviceInfo, xsens::Packet::m_itemCount, m_lastHwError, m_lastHwErrorDeviceId, m_lastResult, m_logFile, m_logging, CmtDeviceConfiguration::m_masterDeviceId, xsens::Packet::m_msg, CmtDeviceConfiguration::m_numberOfDevices, CmtDeviceConfiguration::_devInfo::m_outputMode, CmtDeviceConfiguration::_devInfo::m_outputSettings, m_serial, m_timeoutMeas, xsens::Packet::m_toa, m_useRtc, xsens::Packet::setDataFormat(), xsens::timeStampNow(), xsens::Cmt2s::waitForMessage(), xsens::Cmt2f::writeMessage(), XRV_OK, XRV_TIMEOUTNODATA, and XSENS_MS_PER_DAY.
XsensResultValue xsens::Cmt3::writeMessageToLogFile | ( | const Message & | msg | ) |
Definition at line 2863 of file cmt3.cpp.
References CMT3EXITLOG, CMT3LOG, xsens::Cmt2f::isOpen(), m_lastResult, m_logFile, xsens::Cmt2f::writeMessage(), and XRV_NOFILEOPEN.
Referenced by getConfiguration(), and getEMtsData().
|
protected |
The baudrate that was last set to be used by the port.
Definition at line 48 of file cmt3.h.
Referenced by getBaudrate(), openPort(), and setBaudrate().
|
protected |
The configuration of the connected devices.
Definition at line 67 of file cmt3.h.
Referenced by Cmt3(), createLogFile(), getBusId(), getBusIdInternal(), getConfiguration(), getDeviceCount(), getDeviceId(), getDeviceMode2(), getEMtsData(), getMasterId(), getMtCount(), getMtDeviceId(), isXm(), readDataPacket(), refreshCache(), setDeviceMode2(), setGpsLeverArm(), storeXkfState(), and waitForDataMessage().
|
protected |
void* xsens::Cmt3::m_eMtsData[CMT_MAX_DEVICES_PER_PORT] |
Cached eMTS data.
Definition at line 64 of file cmt3.h.
Referenced by Cmt3(), getEMtsData(), refreshCache(), and ~Cmt3().
|
protected |
|
protected |
The number of times a goto config is attempted before the function fails.
Definition at line 53 of file cmt3.h.
Referenced by Cmt3(), gotoConfig(), and setGotoConfigTries().
|
protected |
Contains the last error reported by hardware.
Definition at line 59 of file cmt3.h.
Referenced by clearHwError(), getEMtsData(), getHwError(), gotoConfig(), readDataPacket(), setGpsLeverArm(), storeXkfState(), and waitForDataMessage().
|
protected |
Contains the Device ID of the device that caused the last hardware error.
Definition at line 60 of file cmt3.h.
Referenced by clearHwError(), getEMtsData(), getHwError(), gotoConfig(), readDataPacket(), setGpsLeverArm(), storeXkfState(), and waitForDataMessage().
|
mutableprotected |
The last result of an operation.
Definition at line 51 of file cmt3.h.
Referenced by closeLogFile(), closePort(), Cmt3(), createLogFile(), getAvailableScenarios(), getBatteryLevel(), getBaudrate(), getBluetoothState(), getBusId(), getBusPowerState(), getConfiguration(), getDataLength(), getDeviceId(), getDeviceMode2(), getEMtsData(), getErrorMode(), getFirmwareRevision(), getGpsLeverArm(), getGpsStatus(), getGravityMagnitude(), getHeading(), getLastResult(), getLocationId(), getLogFileName(), getLogFileReadPosition(), getLogFileSize(), getMagneticDeclination(), getMtDeviceId(), getPortNr(), getProductCode(), getScenario(), getSerialBaudrate(), getSyncInMode(), getSyncInOffset(), getSyncInSettings(), getSyncInSkipFactor(), getSyncMode(), getSyncOutMode(), getSyncOutOffset(), getSyncOutPulseWidth(), getSyncOutSettings(), getSyncOutSkipFactor(), getUtcTime(), getXmOutputMode(), gotoConfig(), gotoMeasurement(), initBus(), openLogFile(), openPort(), peekLogMessageId(), readDataPacket(), refreshCache(), requestData(), reset(), resetLogFileReadPos(), resetOrientation(), restoreFactoryDefaults(), setBaudrate(), setBluetoothState(), setBusPowerState(), setDataSource(), setDeviceMode2(), setErrorMode(), setGotoConfigTries(), setGpsLeverArm(), setGravityMagnitude(), setHeading(), setLocationId(), setLogMode(), setMagneticDeclination(), setScenario(), setSyncInMode(), setSyncInOffset(), setSyncInSettings(), setSyncInSkipFactor(), setSyncMode(), setSyncOutMode(), setSyncOutOffset(), setSyncOutPulseWidth(), setSyncOutSettings(), setSyncOutSkipFactor(), setTimeout(), setTimeoutConfig(), setTimeoutMeasurement(), setXmOutputMode(), setXmPowerOff(), storeXkfState(), waitForDataMessage(), and writeMessageToLogFile().
|
protected |
The (optional) CMT level 2 logfile object that this class operates on.
Definition at line 40 of file cmt3.h.
Referenced by closeLogFile(), closePort(), createLogFile(), getCmt2f(), getConfiguration(), getDeviceCount(), getEMtsData(), getLogFileName(), getLogFileReadPosition(), getLogFileSize(), getMasterId(), getMtCount(), getSyncInMode(), getSyncInOffset(), getSyncInSettings(), getSyncInSkipFactor(), getSyncOutMode(), getSyncOutOffset(), getSyncOutPulseWidth(), getSyncOutSettings(), getSyncOutSkipFactor(), gotoConfig(), gotoMeasurement(), isLogFileOpen(), openLogFile(), openPort(), peekLogMessageId(), readDataPacket(), refreshCache(), reset(), resetLogFileReadPos(), setBaudrate(), setDataSource(), setDeviceMode2(), setGpsLeverArm(), setLogMode(), setSyncInMode(), setSyncInOffset(), setSyncInSettings(), setSyncInSkipFactor(), setSyncOutMode(), setSyncOutOffset(), setSyncOutPulseWidth(), setSyncOutSettings(), setSyncOutSkipFactor(), storeXkfState(), waitForDataMessage(), writeMessageToLogFile(), and ~Cmt3().
|
protected |
Indicates whether to write all received messages to the logfile or not, automatically set to true by createLogFile.
Definition at line 58 of file cmt3.h.
Referenced by closeLogFile(), closePort(), Cmt3(), createLogFile(), getConfiguration(), getEMtsData(), getSyncInMode(), getSyncInOffset(), getSyncInSettings(), getSyncInSkipFactor(), getSyncOutMode(), getSyncOutOffset(), getSyncOutPulseWidth(), getSyncOutSettings(), getSyncOutSkipFactor(), gotoConfig(), gotoMeasurement(), isLogging(), openLogFile(), openPort(), readDataPacket(), refreshCache(), reset(), setBaudrate(), setDataSource(), setDeviceMode2(), setGpsLeverArm(), setLogMode(), setSyncInMode(), setSyncInOffset(), setSyncInSettings(), setSyncInSkipFactor(), setSyncOutMode(), setSyncOutOffset(), setSyncOutPulseWidth(), setSyncOutSettings(), setSyncOutSkipFactor(), storeXkfState(), and waitForDataMessage().
|
protected |
Keeps track of whether the connected device is measuring or being configured.
Definition at line 54 of file cmt3.h.
Referenced by closePort(), Cmt3(), gotoConfig(), gotoMeasurement(), openPort(), refreshCache(), reset(), setBaudrate(), setTimeoutConfig(), and setTimeoutMeasurement().
|
protected |
The sample period of the port.
Definition at line 43 of file cmt3.h.
Referenced by Cmt3(), fillRtc(), getDeviceMode2(), getSampleFrequency(), refreshCache(), and setDeviceMode2().
|
protected |
Indicates whether to read from the log file or from the serial port.
Definition at line 56 of file cmt3.h.
Referenced by closePort(), Cmt3(), getEMtsData(), openLogFile(), peekLogMessageId(), readDataPacket(), setDataSource(), and setLogMode().
|
protected |
|
protected |
Indicates if the rtc is initialised or not.
Definition at line 57 of file cmt3.h.
Referenced by Cmt3(), fillRtc(), gotoMeasurement(), and openPort().
|
protected |
|
protected |
|
protected |
|
protected |
The (optional) CMT level 2 serial object that this class operates on.
Definition at line 39 of file cmt3.h.
Referenced by closePort(), createLogFile(), getBaudrate(), getCmt2s(), getConfiguration(), getDeviceCount(), getEMtsData(), getMasterId(), getMtCount(), getPortNr(), getSyncInMode(), getSyncInOffset(), getSyncInSettings(), getSyncInSkipFactor(), getSyncOutMode(), getSyncOutOffset(), getSyncOutPulseWidth(), getSyncOutSettings(), getSyncOutSkipFactor(), gotoConfig(), gotoMeasurement(), initBus(), isPortOpen(), openLogFile(), openPort(), readDataPacket(), refreshCache(), requestData(), reset(), setBaudrate(), setDataSource(), setDeviceMode2(), setGpsLeverArm(), setSyncInMode(), setSyncInOffset(), setSyncInSettings(), setSyncInSkipFactor(), setSyncOutMode(), setSyncOutOffset(), setSyncOutPulseWidth(), setSyncOutSettings(), setSyncOutSkipFactor(), setTimeout(), setTimeoutConfig(), setTimeoutMeasurement(), setXmPowerOff(), storeXkfState(), waitForDataMessage(), and ~Cmt3().
|
protected |
The skip factor of the port.
Definition at line 44 of file cmt3.h.
Referenced by Cmt3(), fillRtc(), getDeviceMode2(), getSampleFrequency(), refreshCache(), and setDeviceMode2().
|
protected |
The config mode timeout.
Definition at line 49 of file cmt3.h.
Referenced by Cmt3(), getTimeoutConfig(), gotoConfig(), openPort(), and setTimeoutConfig().
|
protected |
The measurement mode timeout.
Definition at line 50 of file cmt3.h.
Referenced by Cmt3(), getTimeoutMeasurement(), gotoMeasurement(), openPort(), setTimeoutMeasurement(), and waitForDataMessage().
bool xsens::Cmt3::m_useRtc |
Indicates if the RTC should be computed or not (to save CPU time).
Definition at line 63 of file cmt3.h.
Referenced by Cmt3(), readDataPacket(), and waitForDataMessage().
Page generated by Doxygen 1.8.14 for MRPT 1.5.7 Git: 5902e14cc Wed Apr 24 15:04:01 2019 +0200 at lun oct 28 01:39:17 CET 2019 |