mtibasedevice.cpp
Go to the documentation of this file.
1 
2 // Copyright (c) 2003-2021 Xsens Technologies B.V. or subsidiaries worldwide.
3 // All rights reserved.
4 //
5 // Redistribution and use in source and binary forms, with or without modification,
6 // are permitted provided that the following conditions are met:
7 //
8 // 1. Redistributions of source code must retain the above copyright notice,
9 // this list of conditions, and the following disclaimer.
10 //
11 // 2. Redistributions in binary form must reproduce the above copyright notice,
12 // this list of conditions, and the following disclaimer in the documentation
13 // and/or other materials provided with the distribution.
14 //
15 // 3. Neither the names of the copyright holders nor the names of their contributors
16 // may be used to endorse or promote products derived from this software without
17 // specific prior written permission.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
20 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
22 // THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 // SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
24 // OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR
26 // TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.THE LAWS OF THE NETHERLANDS
28 // SHALL BE EXCLUSIVELY APPLICABLE AND ANY DISPUTES SHALL BE FINALLY SETTLED UNDER THE RULES
29 // OF ARBITRATION OF THE INTERNATIONAL CHAMBER OF COMMERCE IN THE HAGUE BY ONE OR MORE
30 // ARBITRATORS APPOINTED IN ACCORDANCE WITH SAID RULES.
31 //
32 
33 
34 // Copyright (c) 2003-2021 Xsens Technologies B.V. or subsidiaries worldwide.
35 // All rights reserved.
36 //
37 // Redistribution and use in source and binary forms, with or without modification,
38 // are permitted provided that the following conditions are met:
39 //
40 // 1. Redistributions of source code must retain the above copyright notice,
41 // this list of conditions, and the following disclaimer.
42 //
43 // 2. Redistributions in binary form must reproduce the above copyright notice,
44 // this list of conditions, and the following disclaimer in the documentation
45 // and/or other materials provided with the distribution.
46 //
47 // 3. Neither the names of the copyright holders nor the names of their contributors
48 // may be used to endorse or promote products derived from this software without
49 // specific prior written permission.
50 //
51 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
52 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
53 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
54 // THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
55 // SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
56 // OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
57 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR
58 // TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
59 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.THE LAWS OF THE NETHERLANDS
60 // SHALL BE EXCLUSIVELY APPLICABLE AND ANY DISPUTES SHALL BE FINALLY SETTLED UNDER THE RULES
61 // OF ARBITRATION OF THE INTERNATIONAL CHAMBER OF COMMERCE IN THE HAGUE BY ONE OR MORE
62 // ARBITRATORS APPOINTED IN ACCORDANCE WITH SAID RULES.
63 //
64 
65 #include "mtibasedevice.h"
66 #include "xsdef.h"
67 #include "synclinemk4.h"
68 #include "synclinegmt.h"
71 #include <xstypes/xsportinfo.h>
72 #include "xsicccommand.h"
73 #include <xstypes/xsmatrix.h>
74 #include "xsiccrepmotionresult.h"
75 #include <xstypes/xsquaternion.h>
76 #include <xstypes/xsvector.h>
77 #include <set>
78 #include <xstypes/xsstatusflag.h>
79 
80 using namespace xsens;
81 
86  : MtDeviceEx(comm)
87 {
88 }
89 
94  : MtDeviceEx(master, XsDeviceId())
95 {
96 }
97 
99 {
100 }
101 
105 {
106  return false;
107 }
108 
112 {
114  return m_outputConfiguration;
115 
117  if (!doTransaction(snd, rcv))
119 
121  XsSize count = rcv.getDataSize() >> 2;
122  for (XsSize row = 0; row < count; row++)
123  {
124  uint16_t dataId, freq;
125  dataId = rcv.getDataShort(row * 4);
126  freq = rcv.getDataShort(2 + row * 4);
127  rv.push_back(XsOutputConfiguration((XsDataIdentifier)dataId, freq));
128  }
129 
130  return rv;
131 }
132 
138 {
139  if (!deviceId().isMti6X0())
140  setStringOutputMode(0, 0, 0);
141 
143 }
144 
148 {
150  snd.setBusId(busId());
151  snd.setDataByte((uint8_t)frame);
152  for (XsSize i = 0; i < 4; ++i)
153  snd.setDataFloat((float)quat[i], (uint16_t)(1 + i * sizeof(float)));
154  return doTransaction(snd);
155 }
156 
160 {
161  XsQuaternion quat;
163  snd.setDataByte(frame);
164  if (doTransaction(snd, rcv))
165  {
166  for (XsSize i = 0; i < 4; ++i)
167  quat[i] = rcv.getDataFloat(1 + i * 4);
168  }
169  return quat;
170 }
171 
175 {
176  return setAlignmentRotationQuaternion(frame, XsQuaternion(matrix).normalized());
177 }
178 
182 {
183  XsMatrix matrix;
184  matrix.fromQuaternion(alignmentRotationQuaternion(frame));
185  return matrix;
186 }
187 
191 {
192  /* Mk4 sync lines:
193  XSL_ClockIn => 0 external clock sync (SMCU)
194  XSL_GnssClockIn => 1 GNSS clock sync (DSP?)
195  XSL_In1 => 2 send data line (IMCU)
196  XSL_Bi1In => 3 SMCU
197  XSL_Bi1Out => 4 SMCU
198  */
199 
200  unsigned int timeResolution = XsDevice::syncSettingsTimeResolutionInMicroSeconds(deviceId());
201 
202  if (s.size() > 10)
203  return false;
204 
205  //if no item, create the length of 1 item with zero values
206  XsMessage snd(XMID_SetSyncConfiguration, (s.size() == 0) ? 12 : s.size() * 12);
207  snd.setBusId(busId());
208 
209  /* create message but abort if we encounter anything out of the ordinary
210  each sync setting is:
211  0: event / action (function)
212  1: line
213  2: polarity
214  3: triggerOnce
215  4-5: skipFirst
216  6-7: skipFactor
217  8-9: pulse width
218  10-11: delay/offset/clock frequency
219  */
220  for (size_t i = 0; i < s.size(); ++i)
221  {
222  const XsSyncSetting& setting = s[i];
223  XsSize offset = i * 12;
224 
225  snd.setDataByte(setting.m_function, offset);
226  const uint8_t line = syncLine(setting);
227  snd.setDataByte(line, offset + 1);
228  assert(setting.m_polarity != XSP_None);
229  snd.setDataByte(setting.m_polarity, offset + 2);
230  snd.setDataByte(setting.m_triggerOnce ? 1 : 0, offset + 3);
231  snd.setDataShort(setting.m_skipFirst, offset + 4);
232  snd.setDataShort(setting.m_skipFactor, offset + 6);
233  snd.setDataShort((uint16_t)(setting.m_pulseWidth / timeResolution), offset + 8);
234  uint16_t value = 0;
235  if (setting.m_function == XSF_ClockBiasEstimation || setting.m_function == XSF_SampleAndSend)
236  snd.setDataShort(setting.m_clockPeriod, offset + 10);
237  else
238  {
239  value = (uint16_t)(int16_t)(setting.m_offset / (int) timeResolution);
240  snd.setDataShort(value, offset + 10);
241  }
242  }
243 
244  return doTransaction(snd);
245 }
246 
250 {
252  if (!doTransaction(snd, rcv))
253  return XsSyncSettingArray();
254 
255  const uint8_t* emtsBuffer = rcv.getDataBuffer();
256  return syncSettingsFromBuffer(emtsBuffer);
257 }
258 
261 {
262  unsigned int timeResolution = XsDevice::syncSettingsTimeResolutionInMicroSeconds(deviceId());
263 
265  for (XsSize i = 0; i < 10; ++i)
266  {
267  uint16_t tmp_pulseWidth;
268  XsSize offset = i * 12;
269  XsSyncSetting ss;
270  ss.m_function = (XsSyncFunction) buffer[offset];
271  ss.m_polarity = (XsSyncPolarity) buffer[offset + 2];
272  if (ss.m_polarity == XSP_None)
273  break;
274 
275  ss.m_line = syncSettingsLine(buffer, offset);
276  ss.m_triggerOnce = buffer[offset + 3];
277  memcpy((void*) &ss.m_skipFirst, (void const*) &buffer[offset + 4], sizeof(uint16_t));
278  memcpy((void*) &ss.m_skipFactor, (void const*) &buffer[offset + 6], sizeof(uint16_t));
279  memcpy((void*) &tmp_pulseWidth, (void const*) &buffer[offset + 8], sizeof(uint16_t));
280  ss.m_pulseWidth = (uint32_t) tmp_pulseWidth * (uint32_t) timeResolution;
282  memcpy((void*) &ss.m_clockPeriod, (void const*) &buffer[offset + 10], sizeof(uint16_t));
283  else
284  {
285  int16_t tmp_offset;
286  memcpy((void*) &tmp_offset, (void const*) &buffer[offset + 10], sizeof(int16_t));
287  ss.m_offset = (int32_t) tmp_offset * (int32_t) timeResolution;
288  }
289 
290  rv.push_back(ss);
291  }
292  return rv;
293 }
294 
300 {
301  int matchLevel = 0;
302  int result = 0;
303 
304  bool groupCheck = ((dataType & XDI_TypeMask) == dataType);
305  for (XsOutputConfigurationArray::const_iterator i = configurations.begin(); i != configurations.end(); ++i)
306  {
307  int ml = 0;
308  if ((dataType & XDI_FullTypeMask) == (i->m_dataIdentifier & XDI_FullTypeMask))
309  {
310  if (dataType == i->m_dataIdentifier)
311  ml = 3;
312  else
313  ml = 2;
314  }
315  else if (groupCheck && (dataType == (i->m_dataIdentifier & XDI_TypeMask)))
316  ml = 1;
317 
318  if (ml > matchLevel)
319  {
320  result = i->m_frequency;
321  if (ml == 3)
322  break;
323  matchLevel = ml;
324  }
325  }
326 
327  return result;
328 }
329 
336 {
337  return calculateUpdateRateImp(dataType, outputConfiguration());
338 }
339 
344 {
345  return getBaseFrequencyInternal(dataType).m_frequency;
346 }
347 
351 {
352  std::vector<int> updateRates;
353  auto baseFreq = getBaseFrequencyInternal(dataType);
354 
355  if (baseFreq.m_frequency == 0)
356  return updateRates;
357 
358  if (!baseFreq.m_divedable)
359  {
360  updateRates.push_back(baseFreq.m_frequency);
361  return updateRates;
362  }
363 
364  for (int skip = 0; skip <= baseFreq.m_frequency; ++skip)
365  {
366  int freq = calcFrequency(baseFreq.m_frequency, (uint16_t) skip);
367  if (freq * (skip + 1) == baseFreq.m_frequency)
368  updateRates.push_back(freq);
369  }
370 
371  return updateRates;
372 }
373 
376 bool MtiBaseDevice::setNoRotation(uint16_t duration)
377 {
378  return MtDeviceEx::setNoRotation(duration);
379 }
380 
384 {
385  uint8_t bid = (uint8_t) busId();
386  if (bid == XS_BID_INVALID || bid == XS_BID_BROADCAST || lla.size() != 3)
387  return false;
388 
389  XsMessage snd(XMID_SetLatLonAlt, 3 * sizeof(double));
390  snd.setDataDouble(lla[0], 0);
391  snd.setDataDouble(lla[1], 8);
392  snd.setDataDouble(lla[2], 16);
393  snd.setBusId(bid);
394 
395  return doTransaction(snd);
396 }
397 
401 {
402  uint8_t bid = (uint8_t) busId();
403  if (bid == XS_BID_INVALID || bid == XS_BID_BROADCAST)
404  return XsTimeInfo();
405 
406  XsMessage snd(XMID_ReqUtcTime, 0), rcv;
407  snd.setBusId(bid);
408 
409  if (!doTransaction(snd, rcv))
410  return XsTimeInfo();
411 
412  XsTimeInfo time;
413  time.m_nano = rcv.getDataLong(0);
414  time.m_year = rcv.getDataShort(4);
415  time.m_month = rcv.getDataByte(6);
416  time.m_day = rcv.getDataByte(7);
417  time.m_hour = rcv.getDataByte(8);
418  time.m_minute = rcv.getDataByte(9);
419  time.m_second = rcv.getDataByte(10);
420  time.m_valid = rcv.getDataByte(11);
421  time.m_utcOffset = 0;
422 
423  return time;
424 }
425 
429 {
430  uint8_t bid = (uint8_t) busId();
431  if (bid == XS_BID_INVALID || bid == XS_BID_BROADCAST)
432  return false;
433 
435  snd.setDataLong(time.m_nano, 0);
436  snd.setDataShort(time.m_year, 4);
437  snd.setDataByte(time.m_month, 6);
438  snd.setDataByte(time.m_day, 7);
439  snd.setDataByte(time.m_hour, 8);
440  snd.setDataByte(time.m_minute, 9);
441  snd.setDataByte(time.m_second, 10);
442  snd.setDataByte(time.m_valid, 11);
443  snd.setBusId(bid);
444 
445  if (!doTransaction(snd))
446  return false;
447 
448  return true;
449 }
450 
454 {
456  return true;
457  return false;
458 }
459 
463 {
465 }
466 
470 {
472  if (!doTransaction(snd, rcv))
473  return 0;
474  return rcv.getDataShort();
475 }
476 
480 {
481  return delay == 0;
482 }
483 
487 {
488  Communicator* comm = communicator();
489  if (!comm)
490  return false;
491 
492  bool removesPort = false;
493  uint16_t vid, pid;
494  comm->portInfo().getVidPid(vid, pid);
495  // Direct connection, COM port will be removed
496  if (vid == XSENS_VENDOR_ID && pid < 0x00FF)
497  removesPort = true;
498 
499  return removesPort;
500 }
501 
504 XsSyncLine MtiBaseDevice::syncSettingsLine(const uint8_t* buff, XsSize offset) const
505 {
506  if (deviceId().isMtMark4() || deviceId().isMtMark5())
507  return xsl4ToXsl((SyncLineMk4) buff[offset + 1]);
508  else
509  return xslgmtToXsl((SyncLineGmt) buff[offset + 1]);
510 }
511 
514 uint8_t MtiBaseDevice::syncLine(const XsSyncSetting& setting) const
515 {
516  if (deviceId().isMtMark4() || deviceId().isMtMark5())
517  {
518  SyncLineMk4 mk4Line = xslToXsl4(setting.m_line);
519  assert(mk4Line != XSL4_Invalid);
520  if (mk4Line == XSL4_ClockIn || mk4Line == XSL4_GnssClockIn)
521  assert(setting.m_function == XSF_ClockBiasEstimation);
522  return static_cast<uint8_t>(mk4Line);
523  }
524  else
525  {
526  SyncLineGmt gmtLine = xslToXslgmt(setting.m_line);
527  assert(gmtLine != XSLGMT_Invalid);
528  if (gmtLine == XSLGMT_ClockIn)
529  assert(setting.m_function == XSF_SampleAndSend);
530  return static_cast<uint8_t>(gmtLine);
531  }
532 }
533 
536 {
538 }
539 
544 {
545  if (!hasIccSupport())
546  return false;
547 
549  return false;
550 
551  XsMessage snd(XMID_IccCommand, 1);
552  snd.setBusId(busId());
553  snd.setDataByte(XIC_StartRepMotion);
554 
555  if (!doTransaction(snd))
556  return false;
557 
558  return true;
559 }
560 
563 {
564  if (!hasIccSupport())
565  return false;
566 
568  return false;
569 
570  bool enabled = false;
571 
572  XsMessage snd(XMID_IccCommand, 1);
573  snd.setBusId(busId());
574  snd.setDataByte(XIC_RepMotionState);
575  XsMessage rcv;
576  if (doTransaction(snd, rcv))
577  enabled = (rcv.getDataByte(1) != 0);
578 
579  return enabled;
580 }
581 
586 {
587  XsIccRepMotionResult result;
588 
589  if (!hasIccSupport())
590  return result;
591 
593  return result;
594 
595  XsMessage snd(XMID_IccCommand, 1), rcv;
596  snd.setBusId(busId());
597  snd.setDataByte(XIC_StopRepMotion);
598 
599  if (doTransaction(snd, rcv, 3500))
600  {
601  result.m_ddtAccuracy = rcv.getDataFloat(1);
602  result.m_dimension = rcv.getDataByte(5);
603  result.m_status = rcv.getDataByte(6);
604  }
605 
606  return result;
607 }
608 
613 {
615  return false;
616 
617  XsMessage snd(XMID_IccCommand, 1);
618  snd.setBusId(busId());
619  snd.setDataByte(XIC_StoreResults);
620 
621  return doTransaction(snd, 2000);
622 }
623 
627 {
628  return (firmwareVersion() >= XsVersion(1, 5, 0));
629 }
630 
632 {
633  if (deviceId().isImu()) // If we are a 100 type device,
634  m_hardwareFilterProfiles.clear(); // there are no filter profiles in the firmware.
635  else // For other device types,
636  MtDeviceEx::fetchAvailableHardwareScenarios(); // fetch the scenarios.
637 }
XS_LEN_ALIGNMENTROTATION
#define XS_LEN_ALIGNMENTROTATION
Definition: xsdef.h:123
XSLGMT_ClockIn
@ XSLGMT_ClockIn
External clock sync XSL_ClockIn.
Definition: synclinegmt.h:81
XsSyncSettingArray
struct XsSyncSettingArray XsSyncSettingArray
Definition: xssyncsettingarray.h:82
XSF_SampleAndSend
@ XSF_SampleAndSend
Sample a sample and send the MT Data message.
Definition: xssyncfunction.h:85
MtiBaseDevice::setOutputConfigurationInternal
XsResultValue setOutputConfigurationInternal(XsOutputConfigurationArray &o) override
Set the output configuration for this device.
Definition: mtibasedevice.cpp:137
XsOutputConfiguration
struct XsOutputConfiguration XsOutputConfiguration
Definition: xsoutputconfiguration.h:118
XsTimeInfo
struct XsTimeInfo XsTimeInfo
Definition: xstimeinfo.h:148
XsMatrix
A class that represents a matrix of real numbers.
Definition: xsmatrix.h:107
XMID_SetLatLonAlt
@ XMID_SetLatLonAlt
Definition: xsxbusmessageid.h:273
XsDevice::deviceId
XsDeviceId const & deviceId() const
Return the device ID of the device.
Definition: xsdevice_def.cpp:742
XsVector
A class that represents a vector of real numbers.
Definition: xsvector.h:113
XSENS_VENDOR_ID
#define XSENS_VENDOR_ID
Definition: xsportinfo.h:75
XsIccRepMotionResult::m_dimension
uint8_t m_dimension
The dimension of the In-Run Compass Calibration.
Definition: xsiccrepmotionresult.h:75
XMID_SetAlignmentRotation
@ XMID_SetAlignmentRotation
Definition: xsxbusmessageid.h:512
MtiBaseDevice::alignmentRotationMatrix
XsMatrix alignmentRotationMatrix(XsAlignmentFrame frame) const override
Retrieve the alignment rotation matrix to rotate S to the chosen frame S'.
Definition: mtibasedevice.cpp:181
XsSyncSetting::m_skipFirst
uint16_t m_skipFirst
Definition: xssyncsetting.h:102
Communicator::portInfo
virtual XsPortInfo portInfo() const =0
MtiBaseDevice::setSyncSettings
bool setSyncSettings(const XsSyncSettingArray &s) override
Set the synchronization settings of the device.
Definition: mtibasedevice.cpp:190
MtiBaseDevice::BaseFrequencyResult::m_frequency
int m_frequency
A frequency value.
Definition: mtibasedevice.h:126
XsTimeInfo::m_hour
uint8_t m_hour
The hour (if time is valid)
Definition: xstimeinfo.h:93
XsIccRepMotionResult
Contains the result of the representative motion processed by ICC.
Definition: xsiccrepmotionresult.h:72
XsDevice::deviceState
virtual XsDeviceState deviceState() const
Return the state of this device.
Definition: xsdevice_def.cpp:1064
MtiBaseDevice::fetchAvailableHardwareScenarios
void fetchAvailableHardwareScenarios() override
Fetches available hardware scenarios.
Definition: mtibasedevice.cpp:631
xslToXsl4
SyncLineMk4 xslToXsl4(XsSyncLine line)
Translate an XsSyncLine into a Mk4-specififc SyncLineMk4.
Definition: synclinemk4.c:100
xsquaternion.h
s
XmlRpcServer s
XsDevice::m_outputConfiguration
XsOutputConfigurationArray m_outputConfiguration
A devices output configuration.
Definition: xsdevice_def.h:715
XsTimeInfo::m_utcOffset
int16_t m_utcOffset
Offset to UTC time in minutes. This value can be added to the stored time to get UTC time.
Definition: xstimeinfo.h:97
xslToXslgmt
SyncLineGmt xslToXslgmt(XsSyncLine line)
Translate an XsSyncLine into a SyncLineGmt.
Definition: synclinegmt.c:104
MtiBaseDevice::syncSettingsLine
virtual XsSyncLine syncSettingsLine(const uint8_t *buff, XsSize offset) const
Returns the sync settings line for a generic mti device.
Definition: mtibasedevice.cpp:504
XsSyncSetting::m_function
XsSyncFunction m_function
Definition: xssyncsetting.h:98
XSF_ClockBiasEstimation
@ XSF_ClockBiasEstimation
Do a clock bias estimation on trigger.
Definition: xssyncfunction.h:87
XsDevice::setStringOutputMode
virtual bool setStringOutputMode(uint16_t type, uint16_t period, uint16_t skipFactor)
Sets the string output mode for this device.
Definition: xsdevice_def.cpp:1220
xsvector.h
XsSyncSetting::m_polarity
XsSyncPolarity m_polarity
Definition: xssyncsetting.h:99
MtiBaseDevice::startRepresentativeMotion
bool startRepresentativeMotion() override
Starts the representative motion.
Definition: mtibasedevice.cpp:543
xsstatusflag.h
MtDevice::updateRateForDataIdentifier
int updateRateForDataIdentifier(XsDataIdentifier dataType) const override
Returns the currently configured update rate for the supplied dataType.
Definition: mtdevice.cpp:176
XMID_ReqUtcTime
@ XMID_ReqUtcTime
Definition: xsxbusmessageid.h:236
XsIccRepMotionResult::m_status
uint8_t m_status
The status of the In-Run Compass Calibration.
Definition: xsiccrepmotionresult.h:76
XSP_None
@ XSP_None
Don't generate or react to trigger level changes.
Definition: xssyncpolarity.h:76
XsVersion
struct XsVersion XsVersion
Definition: xsversion.h:80
MtiBaseDevice::stopRepresentativeMotion
XsIccRepMotionResult stopRepresentativeMotion() override
Stops the representative motion.
Definition: mtibasedevice.cpp:585
MtiBaseDevice::setNoRotation
bool setNoRotation(uint16_t duration)
Set the no rotation period to duration.
Definition: mtibasedevice.cpp:376
MtiBaseDevice::outputConfiguration
XsOutputConfigurationArray outputConfiguration() const
Returns the currently configured output of the device.
Definition: mtibasedevice.cpp:111
XsOutputConfigurationArray
struct XsOutputConfigurationArray XsOutputConfigurationArray
Definition: xsoutputconfigurationarray.h:82
XSLGMT_Invalid
@ XSLGMT_Invalid
Definition: synclinegmt.h:91
XIC_StopRepMotion
@ XIC_StopRepMotion
Indicate to ICC the end of representative motion.
Definition: xsicccommand.h:76
MtiBaseDevice::setAlignmentRotationQuaternion
bool setAlignmentRotationQuaternion(XsAlignmentFrame frame, const XsQuaternion &quat) override
Set an arbitrary alignment rotation matrix Use to rotate either L to the chosen frame L' or S to the ...
Definition: mtibasedevice.cpp:147
MtiBaseDevice::setRs485TransmissionDelay
bool setRs485TransmissionDelay(uint16_t delay)
Set the transmission delay used for RS485 transmissions.
Definition: mtibasedevice.cpp:479
XsDevice::setOutputConfigurationInternal
virtual XsResultValue setOutputConfigurationInternal(XsOutputConfigurationArray &config)
MtiBaseDevice::setInitialPositionLLA
bool setInitialPositionLLA(const XsVector &lla)
Sets the 'Latitude Longitude Altitude' setting of the device to the given vector.
Definition: mtibasedevice.cpp:383
MtiBaseDevice::hasIccSupport
virtual bool hasIccSupport() const
Definition: mtibasedevice.cpp:626
XsQuaternion
A class that implements a quaternion.
Definition: xsquaternion.h:102
xsportinfo.h
XsTimeInfo::m_valid
uint8_t m_valid
Validity indicator.
Definition: xstimeinfo.h:96
XMID_ReqAlignmentRotation
@ XMID_ReqAlignmentRotation
Definition: xsxbusmessageid.h:510
MtiBaseDevice::calculateUpdateRate
virtual int calculateUpdateRate(XsDataIdentifier dataType) const
Definition: mtibasedevice.cpp:335
XsSyncSetting::m_pulseWidth
uint32_t m_pulseWidth
Definition: xssyncsetting.h:100
xsmatrix.h
XsDevice::communicator
Communicator XSNOEXPORT * communicator() const
mtibasedevice.h
XDI_FullTypeMask
@ XDI_FullTypeMask
Mask to get the type of data, without the data format.
Definition: xsdataidentifier.h:88
MtDeviceEx
An abstract struct of MT device.
Definition: mtdevice.h:189
XsResultValue
XsResultValue
Xsens result values.
Definition: xsresultvalue.h:82
MtiBaseDevice::resetRemovesPort
bool resetRemovesPort() const override
Definition: mtibasedevice.cpp:486
XsDevice::busId
virtual int busId() const
The bus ID for this device.
Definition: xsdevice_def.cpp:860
XMID_IccCommand
@ XMID_IccCommand
Definition: xsxbusmessageid.h:282
XsOutputConfigurationArray
A list of XsOutputConfiguration values.
XMID_ReqTransmitDelay
@ XMID_ReqTransmitDelay
Definition: xsxbusmessageid.h:485
XsTimeInfo::m_second
uint8_t m_second
The second (if time is valid)
Definition: xstimeinfo.h:95
MtiBaseDevice::setUtcTime
bool setUtcTime(const XsTimeInfo &time)
Sets the 'UTC Time' setting of the device to the given time.
Definition: mtibasedevice.cpp:428
XsSyncPolarity
XsSyncPolarity
Signal polarity.
Definition: xssyncpolarity.h:74
XsTimeInfo::m_day
uint8_t m_day
The day of the month (if date is valid)
Definition: xstimeinfo.h:92
XsSyncSetting
A structure for storing all xsens sync settings.
Definition: xssyncsetting.h:95
XsDataIdentifier
XsDataIdentifier
Defines the data identifiers.
Definition: xsdataidentifier.h:84
MtiBaseDevice::setHeadingOffset
bool setHeadingOffset(double offset)
Set the 'heading offset' setting of the device.
Definition: mtibasedevice.cpp:104
MtiBaseDevice::syncSettings
XsSyncSettingArray syncSettings() const override
Get all the current synchronization settings of the device.
Definition: mtibasedevice.cpp:249
Communicator
A base struct for a communication interface.
Definition: communicator.h:95
uint32_t
unsigned int uint32_t
Definition: pstdint.h:485
XIC_StoreResults
@ XIC_StoreResults
Update the stored magnetometer calibration using the ICC estimated calibration values.
Definition: xsicccommand.h:77
XEM_IncreasePacketCounterAndSendError
@ XEM_IncreasePacketCounterAndSendError
Increase packet counter when an error occurs, resulting in gaps in the packet counter and send an exp...
Definition: xserrormode.h:78
XsSyncSetting::m_triggerOnce
uint8_t m_triggerOnce
Definition: xssyncsetting.h:105
XsSyncSetting::m_line
XsSyncLine m_line
Definition: xssyncsetting.h:97
XMID_SyncConfiguration
@ XMID_SyncConfiguration
Definition: xsxbusmessageid.h:153
xsdef.h
Macros and types for use in the Xsens communication protocol and Xsens Device API classes.
XsDevice::firmwareVersion
virtual XsVersion firmwareVersion() const
Return the firmware version.
Definition: xsdevice_def.cpp:675
XsQuaternion
struct XsQuaternion XsQuaternion
Definition: xsquaternion.h:80
MtDevice::fetchAvailableHardwareScenarios
virtual void fetchAvailableHardwareScenarios()
Fetches available hardware scenarios.
Definition: mtdevice.cpp:480
XS_BID_BROADCAST
#define XS_BID_BROADCAST
The bus broadcast bus identifier (all devices)
Definition: xsbusid.h:76
MtiBaseDevice::deviceUsesOnBoardFiltering
virtual bool deviceUsesOnBoardFiltering()
Definition: mtibasedevice.cpp:535
SyncLineGmt
SyncLineGmt
Synchronization line identifiers for the generic motion tracker (GMT) devices, only to be used direct...
Definition: synclinegmt.h:79
xslgmtToXsl
XsSyncLine xslgmtToXsl(SyncLineGmt mk4Line)
Translate an SyncLineGmt into a generic XsSyncLine.
Definition: synclinegmt.c:72
XsTimeInfo::m_nano
uint32_t m_nano
Nanosecond part of the time.
Definition: xstimeinfo.h:89
XSL4_ClockIn
@ XSL4_ClockIn
External clock sync XSL_ClockIn.
Definition: synclinemk4.h:76
XDS_Recording
@ XDS_Recording
Definition: xsdevicestate.h:83
MtiBaseDevice::setErrorMode
bool setErrorMode(XsErrorMode errorMode) override
Sets the error mode of the device.
Definition: mtibasedevice.cpp:453
MtiBaseDevice::calculateUpdateRateImp
virtual int calculateUpdateRateImp(XsDataIdentifier dataType, const XsOutputConfigurationArray &configurations) const
Definition: mtibasedevice.cpp:299
xssyncsettingarray.h
XSL4_Invalid
@ XSL4_Invalid
Definition: synclinemk4.h:85
MtiBaseDevice::syncSettingsFromBuffer
virtual XsSyncSettingArray syncSettingsFromBuffer(const uint8_t *buffer) const
Create an XsSyncSttingsArray from the given buffer of sync configuration data.
Definition: mtibasedevice.cpp:260
XsSize
size_t XsSize
XsSize must be unsigned number!
Definition: xstypedefs.h:74
MtiBaseDevice::utcTime
XsTimeInfo utcTime() const
Gets the 'UTC Time' setting of the device.
Definition: mtibasedevice.cpp:400
MtiBaseDevice::representativeMotionState
bool representativeMotionState() override
Definition: mtibasedevice.cpp:562
XMID_ReqOutputConfiguration
@ XMID_ReqOutputConfiguration
Definition: xsxbusmessageid.h:457
MtDevice::setNoRotation
bool setNoRotation(uint16_t duration)
Set the no rotation period to duration.
Definition: mtdevice.cpp:691
MtiBaseDevice::supportedUpdateRates
std::vector< int > supportedUpdateRates(XsDataIdentifier dataType=XDI_None) const override
Ask the device for its supported update rates for the given dataType.
Definition: mtibasedevice.cpp:350
xsicccommand.h
XS_LEN_UTCTIME
#define XS_LEN_UTCTIME
Definition: xsdef.h:132
MtDevice::m_hardwareFilterProfiles
XsFilterProfileArray m_hardwareFilterProfiles
A vector of hardware filter profiles.
Definition: mtdevice.h:178
MtiBaseDevice::alignmentRotationQuaternion
XsQuaternion alignmentRotationQuaternion(XsAlignmentFrame frame) const override
Retrieve the alignment rotation quaternion.
Definition: mtibasedevice.cpp:159
XsMessage
Structure for storing a single message.
Definition: xsmessage.h:202
xsoutputconfigurationarray.h
MtiBaseDevice::rs485TransmissionDelay
uint16_t rs485TransmissionDelay() const
Returns the transmission delay used for RS485 transmissions.
Definition: mtibasedevice.cpp:469
XIC_StartRepMotion
@ XIC_StartRepMotion
Indicate to ICC the start of representative motion.
Definition: xsicccommand.h:75
XsDeviceId
Contains an Xsens device ID and provides operations for determining the type of device.
Definition: xsdeviceid.h:192
XsSyncSetting::m_offset
int32_t m_offset
Definition: xssyncsetting.h:101
XsTimeInfo::m_month
uint8_t m_month
The month (if date is valid)
Definition: xstimeinfo.h:91
MtiBaseDevice::errorMode
XsErrorMode errorMode() const override
Returns the error mode of the device.
Definition: mtibasedevice.cpp:462
XDS_Measurement
@ XDS_Measurement
Definition: xsdevicestate.h:81
XsDevice::syncSettingsTimeResolutionInMicroSeconds
static unsigned int syncSettingsTimeResolutionInMicroSeconds(XsDeviceId const &deviceId)
Definition: xsdevice_def.cpp:4077
XsTimeInfo::m_year
uint16_t m_year
The year (if date is valid)
Definition: xstimeinfo.h:90
XsTimeInfo::m_minute
uint8_t m_minute
The minute (if time is valid)
Definition: xstimeinfo.h:94
MtiBaseDevice::syncLine
virtual uint8_t syncLine(const XsSyncSetting &setting) const
Returns the sync line for a generic mti device.
Definition: mtibasedevice.cpp:514
xsl4ToXsl
XsSyncLine xsl4ToXsl(SyncLineMk4 mk4Line)
Translate an SyncLineMk4 into a generic XsSyncLine.
Definition: synclinemk4.c:72
MtiBaseDevice::getBaseFrequencyInternal
virtual BaseFrequencyResult getBaseFrequencyInternal(XsDataIdentifier dataType=XDI_None) const
An internal function that gets the base frequency.
Definition: mtibasedevice.h:145
MtiBaseDevice::setAlignmentRotationMatrix
bool setAlignmentRotationMatrix(XsAlignmentFrame frame, const XsMatrix &matrix) override
Set an arbitrary alignment rotation matrix Use to rotate either L to the chosen frame L' or S to the ...
Definition: mtibasedevice.cpp:174
MtiBaseDevice::getBaseFrequency
int getBaseFrequency(XsDataIdentifier dataType=XDI_None) const override
Definition: mtibasedevice.cpp:343
XsSyncLine
XsSyncLine
Synchronization line identifiers.
Definition: xssyncline.h:74
xsiccrepmotionresult.h
XsErrorMode
XsErrorMode
Error modes for use in XsDevice::setErrorMode.
Definition: xserrormode.h:74
XIC_RepMotionState
@ XIC_RepMotionState
Retrieve the current state of the representative motion.
Definition: xsicccommand.h:78
XsSyncSettingArray
A list of XsSyncSetting values.
int32_t
signed int int32_t
Definition: pstdint.h:515
synclinegmt.h
XsIccRepMotionResult::m_ddtAccuracy
float m_ddtAccuracy
The ddtAccuracy of the In-Run Compass Calibration.
Definition: xsiccrepmotionresult.h:74
synclinemk4.h
XDI_OrientationGroup
@ XDI_OrientationGroup
Group for orientation related outputs.
Definition: xsdataidentifier.h:117
XsDevice::doTransaction
bool doTransaction(const XsMessage &snd) const
XS_BID_INVALID
#define XS_BID_INVALID
An invalid bus identifier.
Definition: xsbusid.h:84
XsSyncFunction
XsSyncFunction
Actions to be taken on input triggers.
Definition: xssyncfunction.h:74
MtiBaseDevice::~MtiBaseDevice
virtual ~MtiBaseDevice()
Definition: mtibasedevice.cpp:98
XSL4_GnssClockIn
@ XSL4_GnssClockIn
GNSS clock sync XSL_GnssClockIn.
Definition: synclinemk4.h:77
MtiBaseDevice::storeIccResults
bool storeIccResults() override
Stores the ICC results.
Definition: mtibasedevice.cpp:612
XsSyncSetting::m_skipFactor
uint16_t m_skipFactor
Definition: xssyncsetting.h:103
XsDevice
Definition: xsdevice_def.h:164
XMID_SetSyncConfiguration
@ XMID_SetSyncConfiguration
Definition: xsxbusmessageid.h:150
MtDevice::calcFrequency
static int calcFrequency(int baseFrequency, uint16_t skipFactor)
Calculates the frequency.
Definition: mtdevice.cpp:854
xsens
Definition: threading.cpp:78
XDI_TypeMask
@ XDI_TypeMask
Mask for checking the group which a dataidentifier belongs to, Eg. XDI_TimestampGroup or XDI_Orientat...
Definition: xsdataidentifier.h:87
XsSyncSetting::m_clockPeriod
uint16_t m_clockPeriod
Definition: xssyncsetting.h:104
XsAlignmentFrame
XsAlignmentFrame
Alignment frame.
Definition: xsalignmentframe.h:74
SyncLineMk4
SyncLineMk4
Synchronization line identifiers for the Mk4 devices, only to be used directly in Xbus messages.
Definition: synclinemk4.h:74
XsTimeInfo
A structure for storing Time values.
Definition: xstimeinfo.h:87
XMID_SetUtcTime
@ XMID_SetUtcTime
Definition: xsxbusmessageid.h:235
MtiBaseDevice::MtiBaseDevice
MtiBaseDevice(Communicator *comm)
Constructs a device.
Definition: mtibasedevice.cpp:85


xsens_mti_driver
Author(s):
autogenerated on Sun Sep 3 2023 02:43:20