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
Operation was performed successfully.
Definition: xsens_std.h:34
XsensResultValue
Xsens return values.
Definition: xsens_std.h:31
const char * xsensResultText(const XsensResultValue result)
Definition: xsens_std.cpp:13



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020