MRPT
1.9.9
xsens_std.h
Go to the documentation of this file.
1
/* +------------------------------------------------------------------------+
2
| Mobile Robot Programming Toolkit (MRPT) |
3
| https://www.mrpt.org/ |
4
| |
5
| Copyright (c) 2005-2019, Individual contributors, see AUTHORS file |
6
| See: https://www.mrpt.org/Authors - All rights reserved. |
7
| Released under BSD License. See: https://www.mrpt.org/License |
8
+------------------------------------------------------------------------+ */
9
10
/*! \cond NODOXYGEN */
11
12
#ifndef _XSENS_STD_H_2006_09_11
13
#define _XSENS_STD_H_2006_09_11
14
15
//////////////////////////////////////////////////////////////////////////////////////////
16
17
#if defined(_WIN32) && !defined(_WIN32_WINNT)
18
#define _WIN32_WINNT 0x0502
19
#endif
20
21
#ifdef _WIN32
22
#include <windows.h>
23
#endif
24
25
/*! \endcond */
26
27
//////////////////////////////////////////////////////////////////////////////////////////
28
//! Xsens return values
29
// NOTE!!! When adding a value to this list, also add its description in
30
// xsens_std.cpp
31
typedef
enum
/*! \cond NODOXYGEN */
_XsensResultValue_
/*! \endcond */
32
{
33
// general OK
34
/** Operation was performed successfully */
35
XRV_OK
= 0
36
37
// communication protocol
38
/** No bus communication possible */
39
,
40
XRV_NOBUS
= 1
41
/** InitBus and/or SetBID are not issued */
42
,
43
XRV_BUSNOTREADY
= 2
44
/** Period sent is invalid */
45
,
46
XRV_INVALIDPERIOD
= 3
47
/** The message is invalid or not implemented */
48
,
49
XRV_INVALIDMSG
= 4
50
/** A slave did not respond to WaitForSetBID */
51
,
52
XRV_INITBUSFAIL1
= 16
53
/** An incorrect answer received after WaitForSetBID */
54
,
55
XRV_INITBUSFAIL2
= 17
56
/** After four bus-scans still undetected Motion Trackers */
57
,
58
XRV_INITBUSFAIL3
= 18
59
/** No reply to SetBID message during SetBID procedure */
60
,
61
XRV_SETBIDFAIL1
= 20
62
/** Other than SetBIDAck received */
63
,
64
XRV_SETBIDFAIL2
= 21
65
/** Timer overflow - period too short to collect all data from Motion
66
Trackers */
67
,
68
XRV_MEASUREMENTFAIL1
= 24
69
/** Motion Tracker responds with other than SlaveData message */
70
,
71
XRV_MEASUREMENTFAIL2
= 25
72
/** Total bytes of data of Motion Trackers including sample counter exceeds
73
255 bytes */
74
,
75
XRV_MEASUREMENTFAIL3
= 26
76
/** Timer overflows during measurement */
77
,
78
XRV_MEASUREMENTFAIL4
= 27
79
/** Timer overflows during measurement */
80
,
81
XRV_MEASUREMENTFAIL5
= 28
82
/** No correct response from Motion Tracker during measurement */
83
,
84
XRV_MEASUREMENTFAIL6
= 29
85
/** Timer overflows during measurement */
86
,
87
XRV_TIMEROVERFLOW
= 30
88
/** Baud rate does not comply with valid range */
89
,
90
XRV_BAUDRATEINVALID
= 32
91
/** An invalid parameter is supplied */
92
,
93
XRV_PARAMINVALID
= 33
94
/** An invalid parameter is supplied */
95
,
96
XRV_INVALIDPARAM
= 33
97
/** TX PC Buffer is full */
98
,
99
XRV_MEASUREMENTFAIL7
= 35
100
/** TX PC Buffer overflow, cannot fit full message */
101
,
102
XRV_MEASUREMENTFAIL8
= 36
103
104
// CMT / XME / etc
105
/** A generic error occurred */
106
,
107
XRV_ERROR
= 256
108
/** Operation not implemented in this version (yet) */
109
,
110
XRV_NOTIMPLEMENTED
= 257
111
/** A timeout occurred */
112
,
113
XRV_TIMEOUT
= 258
114
/** Operation aborted because of no data read */
115
,
116
XRV_TIMEOUTNODATA
= 259
117
/** Checksum fault occured */
118
,
119
XRV_CHECKSUMFAULT
= 260
120
/** No internal memory available */
121
,
122
XRV_OUTOFMEMORY
= 261
123
/** The requested item was not found */
124
,
125
XRV_NOTFOUND
= 262
126
/** Unexpected message received (e.g. no acknowledge message received) */
127
,
128
XRV_UNEXPECTEDMSG
= 263
129
/** Invalid id supplied */
130
,
131
XRV_INVALIDID
= 264
132
/** Operation is invalid at this point */
133
,
134
XRV_INVALIDOPERATION
= 265
135
/** Insufficient buffer space available */
136
,
137
XRV_INSUFFICIENTSPACE
= 266
138
/** The specified i/o device can not be opened */
139
,
140
XRV_INPUTCANNOTBEOPENED
= 267
141
/** The specified i/o device can not be opened */
142
,
143
XRV_OUTPUTCANNOTBEOPENED
= 268
144
/** An I/O device is already opened with this object */
145
,
146
XRV_ALREADYOPEN
= 269
147
/** End of file is reached */
148
,
149
XRV_ENDOFFILE
= 270
150
/** A required settings file could not be opened or is missing some data */
151
,
152
XRV_COULDNOTREADSETTINGS
= 271
153
/** No data is available */
154
,
155
XRV_NODATA
= 272
156
/** Tried to change a read-only value */
157
,
158
XRV_READONLY
= 273
159
/** Tried to supply a nullptr value where it is not allowed */
160
,
161
XRV_NULLPTR
= 274
162
/** Insufficient data was supplied to a function */
163
,
164
XRV_INSUFFICIENTDATA
= 275
165
/** Busy processing, try again later */
166
,
167
XRV_BUSY
= 276
168
/** Invalid instance called */
169
,
170
XRV_INVALIDINSTANCE
= 277
171
/** A trusted data stream proves to contain corrupted data */
172
,
173
XRV_DATACORRUPT
= 278
174
175
/** Failure during read of settings */
176
,
177
XRV_READINITFAILED
= 279
178
/** Could not find any Moven-compatible hardware */
179
,
180
XRV_NOXMFOUND
= 280
181
/** Found only one responding Xbus Master */
182
,
183
XRV_ONLYONEXMFOUND
= 281
184
/** No sensors found */
185
,
186
XRV_MTCOUNTZERO
= 282
187
/** One or more sensors are not where they were expected */
188
,
189
XRV_MTLOCATIONINVALID
= 283
190
/** Not enough sensors were found */
191
,
192
XRV_INSUFFICIENTMTS
= 284
193
/** Failure during initialization of Fusion Engine */
194
,
195
XRV_INITFUSIONFAILED
= 285
196
/** Something else was received than was requested */
197
,
198
XRV_OTHER
= 286
199
200
/** No file opened for reading/writing */
201
,
202
XRV_NOFILEOPEN
= 287
203
/** No serial port opened for reading/writing */
204
,
205
XRV_NOPORTOPEN
= 288
206
/** No file or serial port opened for reading/writing */
207
,
208
XRV_NOFILEORPORTOPEN
= 289
209
/** A required port could not be found */
210
,
211
XRV_PORTNOTFOUND
= 290
212
/** The low-level port handler failed to initialize */
213
,
214
XRV_INITPORTFAILED
= 291
215
/** A calibration routine failed */
216
,
217
XRV_CALIBRATIONFAILED
= 292
218
219
/** The in-config check of the device failed */
220
,
221
XRV_CONFIGCHECKFAIL
= 293
222
/** The operation is once only and has already been performed */
223
,
224
XRV_ALREADYDONE
= 294
225
226
/** The single connected device is configured as a slave */
227
,
228
XRV_SYNC_SINGLE_SLAVE
= 295
229
/** More than one master was detected */
230
,
231
XRV_SYNC_SECOND_MASTER
= 296
232
/** A device was detected that was neither master nor slave */
233
,
234
XRV_SYNC_NO_SYNC
= 297
235
/** No master detected */
236
,
237
XRV_SYNC_NO_MASTER
= 298
238
/** A device is not sending enough data */
239
,
240
XRV_SYNC_DATA_MISSING
= 299
241
242
/** The version of the object is too low for the requested operation */
243
,
244
XRV_VERSION_TOO_LOW
= 300
245
/** The object has an unrecognized version, so it's not safe to perform the
246
operation */
247
,
248
XRV_VERSION_PROBLEM
= 301
249
}
XsensResultValue
;
250
251
//////////////////////////////////////////////////////////////////////////////////////////
252
253
/*! \cond NODOXYGEN */
254
#ifndef DELNUL
255
//! This macro deletes a pointer and sets it to NULL
256
#define DELNUL(ptr) \
257
{ \
258
delete ptr; \
259
ptr = nullptr; \
260
}
261
//! This macro deletes a pointer if it is not nullptr and then sets it to NULL
262
#define CHKDELNUL(ptr) \
263
{ \
264
if (ptr != nullptr) \
265
{ \
266
delete ptr; \
267
ptr = nullptr; \
268
} \
269
}
270
//! This macro deletes a multi-object pointer and sets it to NULL
271
#define LSTDELNUL(ptr) \
272
{ \
273
delete[] ptr; \
274
ptr = nullptr; \
275
}
276
//! This macro deletes a multi-object pointer if it is not nullptr and then sets
277
//! it to NULL
278
#define LSTCHKDELNUL(ptr) \
279
{ \
280
if (ptr != nullptr) \
281
{ \
282
delete[] ptr; \
283
ptr = nullptr; \
284
} \
285
}
286
287
//! This macro frees a pointer and then sets it to NULL
288
#define FREENUL(ptr) \
289
{ \
290
free(ptr); \
291
ptr = nullptr; \
292
}
293
//! This macro frees a pointer if it is not nullptr and then sets it to NULL
294
#define CHKFREENUL(ptr) \
295
{ \
296
if (ptr != nullptr) \
297
{ \
298
free(ptr); \
299
ptr = nullptr; \
300
} \
301
}
302
#endif
303
/*! \endcond */
304
305
//////////////////////////////////////////////////////////////////////////////////////////
306
307
/* \brief Retrieve a string corresponding to the given result code.
308
309
This function uses the CmtResultText list to return a string with the
310
relevant result
311
code in a textual format. If the supplied result code is invalid the
312
"!!Invalid result code!!" string is returned.
313
*/
314
#if !defined(_CMT_DLL_IMPORT) && !defined(_XME_DLL_IMPORT)
315
const
char
*
xsensResultText
(
const
XsensResultValue
result);
316
#endif
317
318
//////////////////////////////////////////////////////////////////////////////////////////
319
320
/** The maximum length of a label */
321
#define XSENS_LABEL_SIZE 64
322
/** The maximum length of a short string */
323
#define XSENS_SHORT_STRING_SIZE 256
324
/** The maximum length of a long string */
325
#define XSENS_LONG_STRING_SIZE 16384
326
327
//////////////////////////////////////////////////////////////////////////////////////////
328
329
#endif // _XSENS_STD_H_2006_09_11
XRV_OK
Operation was performed successfully.
Definition:
xsens_std.h:35
XRV_CALIBRATIONFAILED
Definition:
xsens_std.h:217
XRV_INITBUSFAIL1
Definition:
xsens_std.h:52
XRV_NOBUS
Definition:
xsens_std.h:40
XRV_ONLYONEXMFOUND
Definition:
xsens_std.h:183
XRV_MTCOUNTZERO
Definition:
xsens_std.h:186
XRV_SETBIDFAIL2
Definition:
xsens_std.h:64
XRV_TIMEOUT
Definition:
xsens_std.h:113
XRV_MEASUREMENTFAIL8
Definition:
xsens_std.h:102
XRV_TIMEOUTNODATA
Definition:
xsens_std.h:116
XRV_MTLOCATIONINVALID
Definition:
xsens_std.h:189
XRV_NOTIMPLEMENTED
Definition:
xsens_std.h:110
XRV_SETBIDFAIL1
Definition:
xsens_std.h:61
XRV_SYNC_DATA_MISSING
Definition:
xsens_std.h:240
XRV_INPUTCANNOTBEOPENED
Definition:
xsens_std.h:140
XRV_OUTPUTCANNOTBEOPENED
Definition:
xsens_std.h:143
XRV_INITBUSFAIL3
Definition:
xsens_std.h:58
XRV_PARAMINVALID
Definition:
xsens_std.h:93
XRV_PORTNOTFOUND
Definition:
xsens_std.h:211
XRV_INVALIDOPERATION
Definition:
xsens_std.h:134
XRV_NOXMFOUND
Definition:
xsens_std.h:180
XRV_TIMEROVERFLOW
Definition:
xsens_std.h:87
XRV_OUTOFMEMORY
Definition:
xsens_std.h:122
XRV_INSUFFICIENTSPACE
Definition:
xsens_std.h:137
XRV_ENDOFFILE
Definition:
xsens_std.h:149
XRV_INITBUSFAIL2
Definition:
xsens_std.h:55
XRV_BUSNOTREADY
Definition:
xsens_std.h:43
XRV_READONLY
Definition:
xsens_std.h:158
XRV_COULDNOTREADSETTINGS
Definition:
xsens_std.h:152
XRV_INVALIDID
Definition:
xsens_std.h:131
XRV_CHECKSUMFAULT
Definition:
xsens_std.h:119
XRV_ALREADYDONE
Definition:
xsens_std.h:224
XRV_NOPORTOPEN
Definition:
xsens_std.h:205
XRV_BAUDRATEINVALID
Definition:
xsens_std.h:90
XRV_DATACORRUPT
Definition:
xsens_std.h:173
XRV_NODATA
Definition:
xsens_std.h:155
XsensResultValue
XsensResultValue
Xsens return values.
Definition:
xsens_std.h:31
XRV_MEASUREMENTFAIL2
Definition:
xsens_std.h:71
XRV_NOTFOUND
Definition:
xsens_std.h:125
XRV_READINITFAILED
Definition:
xsens_std.h:177
XRV_CONFIGCHECKFAIL
Definition:
xsens_std.h:221
XRV_INVALIDPERIOD
Definition:
xsens_std.h:46
XRV_SYNC_SINGLE_SLAVE
Definition:
xsens_std.h:228
XRV_SYNC_SECOND_MASTER
Definition:
xsens_std.h:231
XRV_INSUFFICIENTDATA
Definition:
xsens_std.h:164
XRV_SYNC_NO_SYNC
Definition:
xsens_std.h:234
XRV_VERSION_PROBLEM
Definition:
xsens_std.h:248
XRV_INITFUSIONFAILED
Definition:
xsens_std.h:195
XRV_MEASUREMENTFAIL5
Definition:
xsens_std.h:81
XRV_INITPORTFAILED
Definition:
xsens_std.h:214
XRV_INVALIDINSTANCE
Definition:
xsens_std.h:170
XRV_INVALIDPARAM
Definition:
xsens_std.h:96
XRV_MEASUREMENTFAIL7
Definition:
xsens_std.h:99
XRV_MEASUREMENTFAIL4
Definition:
xsens_std.h:78
XRV_NULLPTR
Definition:
xsens_std.h:161
XRV_OTHER
Definition:
xsens_std.h:198
XRV_MEASUREMENTFAIL6
Definition:
xsens_std.h:84
XRV_ERROR
Definition:
xsens_std.h:107
xsensResultText
const char * xsensResultText(const XsensResultValue result)
Definition:
xsens_std.cpp:13
XRV_VERSION_TOO_LOW
Definition:
xsens_std.h:244
XRV_INSUFFICIENTMTS
Definition:
xsens_std.h:192
XRV_MEASUREMENTFAIL1
Definition:
xsens_std.h:68
XRV_UNEXPECTEDMSG
Definition:
xsens_std.h:128
XRV_ALREADYOPEN
Definition:
xsens_std.h:146
XRV_BUSY
Definition:
xsens_std.h:167
XRV_SYNC_NO_MASTER
Definition:
xsens_std.h:237
XRV_NOFILEOPEN
Definition:
xsens_std.h:202
XRV_MEASUREMENTFAIL3
Definition:
xsens_std.h:75
XRV_INVALIDMSG
Definition:
xsens_std.h:49
XRV_NOFILEORPORTOPEN
Definition:
xsens_std.h:208
Page generated by
Doxygen 1.8.14
for MRPT 1.9.9 Git: 8fe78517f Sun Jul 14 19:43:28 2019 +0200 at lun oct 28 02:10:00 CET 2019