xsstatusflag.h
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 #ifndef XSSTATUSFLAG_H
66 #define XSSTATUSFLAG_H
67 
68 #include "pstdint.h"
69 
80 {
83  , XSF_GpsValid = 0x04
84 
89 
91 
93 
95 
96  , XSF_ClipAccX = 0x00000100
97  , XSF_ClipAccY = 0x00000200
98  , XSF_ClipAccZ = 0x00000400
99  , XSF_ClipGyrX = 0x00000800
100  , XSF_ClipGyrY = 0x00001000
101  , XSF_ClipGyrZ = 0x00002000
102  , XSF_ClipMagX = 0x00004000
103  , XSF_ClipMagY = 0x00008000
104  , XSF_ClipMagZ = 0x00010000
105 
106  , XSF_Retransmitted = 0x00040000
107  , XSF_ClippingDetected = 0x00080000
108  , XSF_Interpolated = 0x00100000
109  , XSF_SyncIn = 0x00200000
110  , XSF_SyncOut = 0x00400000
111 
112  , XSF_FilterMode = 0x03800000
113  , XSF_HaveGnssTimePulse = 0x04000000
114 
115  , XSF_RtkStatus = 0x18000000
116 };
117 
125 {
130 
133 
143 
147  , XSFO_SyncIn = 21
149 
150  , XSFO_FilterMode = 23 // bits 23 -> 23 + XSFO_FilterModeNrOfBits - 1
151  , XSFO_FilterModeNrOfBits = 3 // note: bit 26 is reserved for future use
152 
156 };
157 
161 
163 inline static bool anyAccClipped(int status)
164 {
165  return 0 != (status & (XSF_ClipAccX | XSF_ClipAccY | XSF_ClipAccZ));
166 }
167 
169 inline static bool anyGyrClipped(int status)
170 {
171  return 0 != (status & (XSF_ClipGyrX | XSF_ClipGyrY | XSF_ClipGyrZ));
172 }
173 
175 inline static bool anyMagClipped(int status)
176 {
177  return 0 != (status & (XSF_ClipMagX | XSF_ClipMagY | XSF_ClipMagZ));
178 }
179 
180 
182 class XsStatus
183 {
184 public:
188  inline XsStatus(const XsStatus& s) : m_status(s.m_status)
189  {
190  }
191 
195  inline XsStatus(int status) : m_status((uint32_t)status)
196  {
197  }
198 
200  inline XsStatus() : m_status(0)
201  {
202  }
203 
205  inline XsStatusFlag get() const
206  {
207  return (XsStatusFlag) m_status;
208  }
209 
213  inline void set(XsStatus const& a)
214  {
215  m_status = a.m_status;
216  }
217 
221  inline void set(uint32_t a)
222  {
223  m_status = a;
224  }
225 
229  inline void set(int a)
230  {
231  m_status = (uint32_t)(a & 0x1FFFF);
232  }
233 
238  inline XsStatus const& operator = (XsStatus const& a)
239  {
240  m_status = a.m_status;
241  return *this;
242  }
243 
248  inline XsStatus const& operator = (int a)
249  {
250  m_status = (uint32_t)(a & 0x1FFFF);
251  return *this;
252  }
253 
258  inline XsStatus const& operator |= (XsStatus const& a)
259  {
260  m_status |= a.m_status;
261  return *this;
262  }
263 
268  inline XsStatus const& operator |= (int a)
269  {
270  m_status |= (uint32_t)(a & 0x1FFFF);
271  return *this;
272  }
273 
278  inline XsStatus const& operator &= (XsStatus const& a)
279  {
280  m_status &= a.m_status;
281  return *this;
282  }
283 
288  inline XsStatus const& operator &= (int a)
289  {
290  m_status &= (uint32_t)(a & 0x1FFFF);
291  return *this;
292  }
293 
295  inline bool anyAccClipped() const
296  {
298  }
299 
301  inline bool anyGyrClipped() const
302  {
304  }
305 
307  inline bool anyMagClipped() const
308  {
310  }
311 
313  inline void clear()
314  {
315  m_status = 0;
316  }
317 
318 protected:
320 };
321 
322 #endif
XSF_SyncIn
@ XSF_SyncIn
When set indicates a sync-in event has been triggered.
Definition: xsstatusflag.h:109
XSFO_OffsetClipAccZ
@ XSFO_OffsetClipAccZ
Definition: xsstatusflag.h:136
XsStatus::XsStatus
XsStatus(int status)
Status object constructor.
Definition: xsstatusflag.h:195
XsStatus::operator=
XsStatus const & operator=(XsStatus const &a)
Assignment operator.
Definition: xsstatusflag.h:238
XsStatus::clear
void clear()
Clear status object.
Definition: xsstatusflag.h:313
XSF_ClipGyrZ
@ XSF_ClipGyrZ
Definition: xsstatusflag.h:101
XSFO_FilterMode
@ XSFO_FilterMode
Definition: xsstatusflag.h:150
XSF_GpsValid
@ XSF_GpsValid
Is set when the device has a GPS receiver and the receiver says that there is a GPS position fix.
Definition: xsstatusflag.h:83
s
XmlRpcServer s
XSFO_HaveGnssTimePulse
@ XSFO_HaveGnssTimePulse
Definition: xsstatusflag.h:153
XSFO_ClippingDetected
@ XSFO_ClippingDetected
Definition: xsstatusflag.h:145
XSF_NoRotationRunningNormally
@ XSF_NoRotationRunningNormally
If all these flags are set (out of the XSF_NoRotationMask) then the No Rotation algorithm is running ...
Definition: xsstatusflag.h:88
XSFO_OffsetClipMagX
@ XSFO_OffsetClipMagX
Definition: xsstatusflag.h:140
XSFO_OffsetClipGyrX
@ XSFO_OffsetClipGyrX
Definition: xsstatusflag.h:137
XSFO_FilterModeNrOfBits
@ XSFO_FilterModeNrOfBits
Definition: xsstatusflag.h:151
XsStatus::operator|=
XsStatus const & operator|=(XsStatus const &a)
Binary OR operator.
Definition: xsstatusflag.h:258
XSF_NoRotationSamplesRejected
@ XSF_NoRotationSamplesRejected
If only this flag is set (out of the XSF_NoRotationMask) then the No Rotation algorithm is running bu...
Definition: xsstatusflag.h:87
XsStatus::operator&=
XsStatus const & operator&=(XsStatus const &a)
Binary AND operator.
Definition: xsstatusflag.h:278
XSFO_OffsetClipAccY
@ XSFO_OffsetClipAccY
Definition: xsstatusflag.h:135
XSF_ClippingDetected
@ XSF_ClippingDetected
When set Indicates clipping has occurred.
Definition: xsstatusflag.h:107
XSFO_OffsetClipMagZ
@ XSFO_OffsetClipMagZ
Definition: xsstatusflag.h:142
XSF_Interpolated
@ XSF_Interpolated
When set Indicates the sample is an interpolation between other samples.
Definition: xsstatusflag.h:108
XSFO_OffsetClipGyrZ
@ XSFO_OffsetClipGyrZ
Definition: xsstatusflag.h:139
anyGyrClipped
static bool anyGyrClipped(int status)
Return if any gyr channel clipped.
Definition: xsstatusflag.h:169
XSFO_SyncIn
@ XSFO_SyncIn
Definition: xsstatusflag.h:147
XSFO_RtkStatus
@ XSFO_RtkStatus
Definition: xsstatusflag.h:154
XSF_ClipMagZ
@ XSF_ClipMagZ
Definition: xsstatusflag.h:104
XSFO_RtkStatusNrOfBits
@ XSFO_RtkStatusNrOfBits
Definition: xsstatusflag.h:155
XSF_RepresentativeMotion
@ XSF_RepresentativeMotion
Indicates if the In-Run Compass Calibration is doing the representative motion analysis.
Definition: xsstatusflag.h:90
XsStatus::set
void set(XsStatus const &a)
Set statusflag of status object.
Definition: xsstatusflag.h:213
XSF_FilterMode
@ XSF_FilterMode
Mask for the 3 bit filter mode field.
Definition: xsstatusflag.h:112
XSF_NoRotationAborted
@ XSF_NoRotationAborted
If only this flag is set (out of the XSF_NoRotationMask) then the No Rotation algorithm was aborted b...
Definition: xsstatusflag.h:86
XSFO_OffsetSelfTestOk
@ XSFO_OffsetSelfTestOk
Definition: xsstatusflag.h:126
XSF_ClipAccX
@ XSF_ClipAccX
Definition: xsstatusflag.h:96
XSF_SelfTestOk
@ XSF_SelfTestOk
Is set when the self test result was ok.
Definition: xsstatusflag.h:81
XsStatus::set
void set(uint32_t a)
Set statusflag of status object.
Definition: xsstatusflag.h:221
XSF_NoRotationMask
@ XSF_NoRotationMask
If all of these flags are set, the No Rotation algorithm is running.
Definition: xsstatusflag.h:85
anyAccClipped
static bool anyAccClipped(int status)
Return if any acc channel clipped.
Definition: xsstatusflag.h:163
XSF_ExternalClockSynced
@ XSF_ExternalClockSynced
Indicates whether the internal clock is synced with an external clock (Either GNNS or custom provided...
Definition: xsstatusflag.h:92
XSF_OrientationValid
@ XSF_OrientationValid
Is set when the computed orientation is valid. The orientation may be invalid during startup or when ...
Definition: xsstatusflag.h:82
XSF_ClipMagX
@ XSF_ClipMagX
Definition: xsstatusflag.h:102
XSF_RtkStatus
@ XSF_RtkStatus
Mask for 2 bit RTK status field 00: No RTK; 01: RTK floating; 10: RTK fixed.
Definition: xsstatusflag.h:115
XSFO_OffsetNoRotation
@ XSFO_OffsetNoRotation
Definition: xsstatusflag.h:129
XSFO_OffsetClipMagY
@ XSFO_OffsetClipMagY
Definition: xsstatusflag.h:141
XsStatus::get
XsStatusFlag get() const
Return statusflag of status object.
Definition: xsstatusflag.h:205
uint32_t
unsigned int uint32_t
Definition: pstdint.h:485
anyMagClipped
static bool anyMagClipped(int status)
Return if any mag channel clipped.
Definition: xsstatusflag.h:175
XSFO_SyncOut
@ XSFO_SyncOut
Definition: xsstatusflag.h:148
XsStatus::anyMagClipped
bool anyMagClipped() const
Return if any mag channel clipped.
Definition: xsstatusflag.h:307
XSFO_OffsetRepresentativeMotion
@ XSFO_OffsetRepresentativeMotion
Definition: xsstatusflag.h:131
XsStatus
Status object.
Definition: xsstatusflag.h:182
XSFO_OffsetClipAccX
@ XSFO_OffsetClipAccX
Definition: xsstatusflag.h:134
XSF_ClipGyrX
@ XSF_ClipGyrX
Definition: xsstatusflag.h:99
XsStatus::XsStatus
XsStatus()
Status object constructor, clears all flags.
Definition: xsstatusflag.h:200
XsStatus::set
void set(int a)
Set statusflag of status object.
Definition: xsstatusflag.h:229
XsStatusFlagOffset
XsStatusFlagOffset
Status flag bit offsets.
Definition: xsstatusflag.h:124
XsStatus::m_status
uint32_t m_status
Statusflag.
Definition: xsstatusflag.h:319
XSF_ClipGyrY
@ XSF_ClipGyrY
Definition: xsstatusflag.h:100
XSFO_OffsetGpsValid
@ XSFO_OffsetGpsValid
Definition: xsstatusflag.h:128
XSF_Retransmitted
@ XSF_Retransmitted
When set Indicates the sample was received as a retransmission.
Definition: xsstatusflag.h:106
XsStatus::anyGyrClipped
bool anyGyrClipped() const
Return if any gyr channel clipped.
Definition: xsstatusflag.h:301
pstdint.h
XSF_ClipAccZ
@ XSF_ClipAccZ
Definition: xsstatusflag.h:98
XSFO_OffsetClipGyrY
@ XSFO_OffsetClipGyrY
Definition: xsstatusflag.h:138
XSFO_OffsetExternalClockSynced
@ XSFO_OffsetExternalClockSynced
Definition: xsstatusflag.h:132
XSF_SyncOut
@ XSF_SyncOut
When set Indicates a sync-out event has been generated.
Definition: xsstatusflag.h:110
XsStatusFlag
XsStatusFlag
Status flags.
Definition: xsstatusflag.h:79
XsStatus::anyAccClipped
bool anyAccClipped() const
Return if any acc channel clipped.
Definition: xsstatusflag.h:295
XsStatus::XsStatus
XsStatus(const XsStatus &s)
Status object constructor.
Definition: xsstatusflag.h:188
XSF_ClipMagY
@ XSF_ClipMagY
Definition: xsstatusflag.h:103
XSF_ClipAccY
@ XSF_ClipAccY
Definition: xsstatusflag.h:97
XSFO_OffsetOrientationValid
@ XSFO_OffsetOrientationValid
Definition: xsstatusflag.h:127
XSF_HaveGnssTimePulse
@ XSF_HaveGnssTimePulse
Indicates that the 1PPS GNSS time pulse is present.
Definition: xsstatusflag.h:113
XSFO_Retransmitted
@ XSFO_Retransmitted
Definition: xsstatusflag.h:144
XSF_FilterInputStart
@ XSF_FilterInputStart
Marks that the corresponding data is the first data fed to the (onboard) filter.
Definition: xsstatusflag.h:94
XSFO_Interpolated
@ XSFO_Interpolated
Definition: xsstatusflag.h:146


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