Main MRPT website > C++ reference for MRPT 1.5.7
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-2017, 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 {
50 }
51 
52 /*! \brief Assign \a other to this. */
54 {
55  if (this == &other)
56  return *this;
57  m_deviceId = other.m_deviceId;
58  m_timeSync = other.m_timeSync;
64  m_aidingData = other.m_aidingData;
65  m_barometer = other.m_barometer;
67  m_rssi = other.m_rssi;
68  return *this;
69 }
70 
71 
72 /*! \brief Test if this is a null Awinda object. */
73 inline bool MtwSdiData::empty() const
74 {
75  return !m_deviceId.toInt();
76 }
77 
78 /*! \brief Test if strapdown integration data is available. */
80 {
81  if (empty())
82  return false;
83  return m_aidingData;
84 }
85 
86 /*! \brief Get the orientation increment value. */
88 {
89  if (empty())
90  return XsQuaternion();
92 }
93 
94 /*! \brief Get the velocity increment value. */
96 {
97  if (empty())
98  return XsVector();
99  return m_velocityIncrement;
100 }
101 
102 /*! \brief Get the pressure as measured by the barometer in hPa. */
103 double MtwSdiData::pressure() const
104 {
105  if (empty())
106  return 0;
107  return m_barometer;
108 }
109 
110 /*! \brief Get the magnetic field value. */
112 {
113  if (empty())
114  return XsVector();
115  return m_magnetoMeter;
116 }
117 
118 /*! \brief Get the current gyroscope bias value. */
120 {
121  if (empty())
122  return XsVector();
123  return m_currentBias;
124 }
125 
126 /*! \brief Get the frame range of the current strapdown integration data. */
128 {
129  if (empty())
130  return XsRange();
132 }
133 
134 /*! \brief Get the rssi of the received strapdown integration data */
135 double MtwSdiData::rssi() const
136 {
137  if(empty())
138  return XS_RSSI_UNKNOWN;
139  return (double)m_rssi;
140 }
141 
double rssi() const
Get the rssi of the received strapdown integration data.
Definition: mtwsdidata.cpp:135
XsVector3 m_currentBias
The gyroscope bias used during the SDI interval.
Definition: mtwsdidata.h:25
XsVector velocityIncrement() const
Get the velocity increment value.
Definition: mtwsdidata.cpp:95
XsQuaternion orientationIncrement() const
Get the orientation increment value.
Definition: mtwsdidata.cpp:87
Class to store strapdown integration data.
Definition: mtwsdidata.h:19
const MtwSdiData & operator=(const MtwSdiData &other)
Assign other to this.
Definition: mtwsdidata.cpp:53
bool empty() const
Test if this is a null Awinda object.
Definition: mtwsdidata.cpp:73
struct XsVector XsVector
Definition: xsvector.h:25
XsDeviceId m_deviceId
The ID of the device that generated the data.
Definition: mtwsdidata.h:21
uint16_t m_firstFrameNumber
The first frame number of the SDI interval. The time of the interval is [first, last) ...
Definition: mtwsdidata.h:23
XsVector3 m_velocityIncrement
The velocity increment (delta V) over the interval.
Definition: mtwsdidata.h:27
XsVector currentBias() const
Get the current gyroscope bias value.
Definition: mtwsdidata.cpp:119
XsVector magneticField() const
Get the magnetic field value.
Definition: mtwsdidata.cpp:111
double m_barometer
The barometer value during the interval.
Definition: mtwsdidata.h:29
int8_t m_rssi
The Received Signal Strength Indication (RSSI) of the message.
Definition: mtwsdidata.h:31
MtwSdiData()
Construct an empty strapdown integration data object.
Definition: mtwsdidata.cpp:20
struct XsQuaternion XsQuaternion
Definition: xsquaternion.h:23
XsVector3 m_magnetoMeter
The magnetometer values during the interval.
Definition: mtwsdidata.h:30
bool containsAidingData() const
Test if strapdown integration data is available.
Definition: mtwsdidata.cpp:79
uint16_t m_lastFrameNumber
The last frame number of the SDI interval. The time of the interval is [first, last) ...
Definition: mtwsdidata.h:24
#define XS_RSSI_UNKNOWN
Definition: xsrssi.h:15
~MtwSdiData()
Destroy the strapdown integration data structure.
Definition: mtwsdidata.cpp:48
uint8_t m_timeSync
Indicates if the time sync is in order (unused)
Definition: mtwsdidata.h:22
double pressure() const
Get the pressure as measured by the barometer in hPa.
Definition: mtwsdidata.cpp:103
XsQuaternion m_orientationIncrement
The orientation increment (delta Q) over the interval.
Definition: mtwsdidata.h:26
struct XsRange XsRange
Definition: xsrange.h:109
bool m_aidingData
reserved
Definition: mtwsdidata.h:28
XsRange frameRange() const
Get the frame range of the current strapdown integration data.
Definition: mtwsdidata.cpp:127



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