Main MRPT website > C++ reference for MRPT 1.9.9
mtwsdidata.cpp
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2018, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #include <xsens/xsrange.h>
10 #include <xsens/xsrssi.h>
11 #include "mtwsdidata.h"
12 
13 /*!
14  \class MtwSdiData
15  \brief Class to store strapdown integration data.
16  \note Intended for internal use.
17 */
18 
19 /*! \brief Construct an empty strapdown integration data object */
21  : m_deviceId(0),
22  m_timeSync(0),
23  m_firstFrameNumber(0),
24  m_lastFrameNumber(0),
25  m_aidingData(0),
26  m_barometer(0),
27  m_rssi(0)
28 {
29 }
30 
31 /*! \brief Construct a copy of \a other */
33  : m_deviceId(other.m_deviceId),
34  m_timeSync(other.m_timeSync),
35  m_firstFrameNumber(other.m_firstFrameNumber),
36  m_lastFrameNumber(other.m_lastFrameNumber),
37  m_currentBias(other.m_currentBias),
38  m_orientationIncrement(other.m_orientationIncrement),
39  m_velocityIncrement(other.m_velocityIncrement),
40  m_aidingData(other.m_aidingData),
41  m_barometer(other.m_barometer),
42  m_magnetoMeter(other.m_magnetoMeter),
43  m_rssi(other.m_rssi)
44 {
45 }
46 
47 /*! \brief Destroy the strapdown integration data structure. */
49 /*! \brief Assign \a other to this. */
51 {
52  if (this == &other) return *this;
53  m_deviceId = other.m_deviceId;
54  m_timeSync = other.m_timeSync;
60  m_aidingData = other.m_aidingData;
61  m_barometer = other.m_barometer;
63  m_rssi = other.m_rssi;
64  return *this;
65 }
66 
67 /*! \brief Test if this is a null Awinda object. */
68 inline bool MtwSdiData::empty() const { return !m_deviceId.toInt(); }
69 /*! \brief Test if strapdown integration data is available. */
71 {
72  if (empty()) return false;
73  return m_aidingData;
74 }
75 
76 /*! \brief Get the orientation increment value. */
78 {
79  if (empty()) return XsQuaternion();
81 }
82 
83 /*! \brief Get the velocity increment value. */
85 {
86  if (empty()) return XsVector();
87  return m_velocityIncrement;
88 }
89 
90 /*! \brief Get the pressure as measured by the barometer in hPa. */
91 double MtwSdiData::pressure() const
92 {
93  if (empty()) return 0;
94  return m_barometer;
95 }
96 
97 /*! \brief Get the magnetic field value. */
99 {
100  if (empty()) return XsVector();
101  return m_magnetoMeter;
102 }
103 
104 /*! \brief Get the current gyroscope bias value. */
106 {
107  if (empty()) return XsVector();
108  return m_currentBias;
109 }
110 
111 /*! \brief Get the frame range of the current strapdown integration data. */
113 {
114  if (empty()) return XsRange();
116 }
117 
118 /*! \brief Get the rssi of the received strapdown integration data */
119 double MtwSdiData::rssi() const
120 {
121  if (empty()) return XS_RSSI_UNKNOWN;
122  return (double)m_rssi;
123 }
XsQuaternion
Definition: xsquaternion.h:57
MtwSdiData::~MtwSdiData
~MtwSdiData()
Destroy the strapdown integration data structure.
Definition: mtwsdidata.cpp:48
MtwSdiData::m_orientationIncrement
XsQuaternion m_orientationIncrement
The orientation increment (delta Q) over the interval.
Definition: mtwsdidata.h:34
MtwSdiData::empty
bool empty() const
Test if this is a null Awinda object.
Definition: mtwsdidata.cpp:68
MtwSdiData::m_currentBias
XsVector3 m_currentBias
The gyroscope bias used during the SDI interval.
Definition: mtwsdidata.h:32
MtwSdiData::pressure
double pressure() const
Get the pressure as measured by the barometer in hPa.
Definition: mtwsdidata.cpp:91
XsRange
Definition: xsrange.h:35
xsrange.h
MtwSdiData::magneticField
XsVector magneticField() const
Get the magnetic field value.
Definition: mtwsdidata.cpp:98
MtwSdiData::frameRange
XsRange frameRange() const
Get the frame range of the current strapdown integration data.
Definition: mtwsdidata.cpp:112
XsVector
Definition: xsvector.h:59
MtwSdiData::m_rssi
int8_t m_rssi
The Received Signal Strength Indication (RSSI) of the message.
Definition: mtwsdidata.h:44
XS_RSSI_UNKNOWN
#define XS_RSSI_UNKNOWN
Definition: xsrssi.h:15
MtwSdiData::velocityIncrement
XsVector velocityIncrement() const
Get the velocity increment value.
Definition: mtwsdidata.cpp:84
MtwSdiData::containsAidingData
bool containsAidingData() const
Test if strapdown integration data is available.
Definition: mtwsdidata.cpp:70
XsQuaternion
struct XsQuaternion XsQuaternion
Definition: xsquaternion.h:30
MtwSdiData::m_aidingData
bool m_aidingData
reserved
Definition: mtwsdidata.h:38
MtwSdiData::rssi
double rssi() const
Get the rssi of the received strapdown integration data.
Definition: mtwsdidata.cpp:119
MtwSdiData
Class to store strapdown integration data.
Definition: mtwsdidata.h:19
MtwSdiData::orientationIncrement
XsQuaternion orientationIncrement() const
Get the orientation increment value.
Definition: mtwsdidata.cpp:77
MtwSdiData::m_deviceId
XsDeviceId m_deviceId
The ID of the device that generated the data.
Definition: mtwsdidata.h:22
MtwSdiData::m_firstFrameNumber
uint16_t m_firstFrameNumber
The first frame number of the SDI interval.
Definition: mtwsdidata.h:27
XsVector
struct XsVector XsVector
Definition: xsvector.h:28
MtwSdiData::MtwSdiData
MtwSdiData()
Construct an empty strapdown integration data object.
Definition: mtwsdidata.cpp:20
MtwSdiData::operator=
const MtwSdiData & operator=(const MtwSdiData &other)
Assign other to this.
Definition: mtwsdidata.cpp:50
xsrssi.h
MtwSdiData::m_magnetoMeter
XsVector3 m_magnetoMeter
The magnetometer values during the interval.
Definition: mtwsdidata.h:42
mtwsdidata.h
MtwSdiData::m_velocityIncrement
XsVector3 m_velocityIncrement
The velocity increment (delta V) over the interval.
Definition: mtwsdidata.h:36
XsRange
struct XsRange XsRange
Definition: xsrange.h:89
MtwSdiData::m_lastFrameNumber
uint16_t m_lastFrameNumber
The last frame number of the SDI interval.
Definition: mtwsdidata.h:30
MtwSdiData::m_timeSync
uint8_t m_timeSync
Indicates if the time sync is in order (unused)
Definition: mtwsdidata.h:24
MtwSdiData::currentBias
XsVector currentBias() const
Get the current gyroscope bias value.
Definition: mtwsdidata.cpp:105
MtwSdiData::m_barometer
double m_barometer
The barometer value during the interval.
Definition: mtwsdidata.h:40



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST