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



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