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  ,
41  /** InitBus and/or SetBID are not issued */
42  ,
44  /** Period sent is invalid */
45  ,
47  /** The message is invalid or not implemented */
48  ,
50  /** A slave did not respond to WaitForSetBID */
51  ,
53  /** An incorrect answer received after WaitForSetBID */
54  ,
56  /** After four bus-scans still undetected Motion Trackers */
57  ,
59  /** No reply to SetBID message during SetBID procedure */
60  ,
62  /** Other than SetBIDAck received */
63  ,
65  /** Timer overflow - period too short to collect all data from Motion
66  Trackers */
67  ,
69  /** Motion Tracker responds with other than SlaveData message */
70  ,
72  /** Total bytes of data of Motion Trackers including sample counter exceeds
73  255 bytes */
74  ,
76  /** Timer overflows during measurement */
77  ,
79  /** Timer overflows during measurement */
80  ,
82  /** No correct response from Motion Tracker during measurement */
83  ,
85  /** Timer overflows during measurement */
86  ,
88  /** Baud rate does not comply with valid range */
89  ,
91  /** An invalid parameter is supplied */
92  ,
94  /** An invalid parameter is supplied */
95  ,
97  /** TX PC Buffer is full */
98  ,
100  /** TX PC Buffer overflow, cannot fit full message */
101  ,
103 
104  // CMT / XME / etc
105  /** A generic error occurred */
106  ,
107  XRV_ERROR = 256
108  /** Operation not implemented in this version (yet) */
109  ,
111  /** A timeout occurred */
112  ,
114  /** Operation aborted because of no data read */
115  ,
117  /** Checksum fault occured */
118  ,
120  /** No internal memory available */
121  ,
123  /** The requested item was not found */
124  ,
126  /** Unexpected message received (e.g. no acknowledge message received) */
127  ,
129  /** Invalid id supplied */
130  ,
132  /** Operation is invalid at this point */
133  ,
135  /** Insufficient buffer space available */
136  ,
138  /** The specified i/o device can not be opened */
139  ,
141  /** The specified i/o device can not be opened */
142  ,
144  /** An I/O device is already opened with this object */
145  ,
147  /** End of file is reached */
148  ,
150  /** A required settings file could not be opened or is missing some data */
151  ,
153  /** No data is available */
154  ,
156  /** Tried to change a read-only value */
157  ,
159  /** Tried to supply a nullptr value where it is not allowed */
160  ,
162  /** Insufficient data was supplied to a function */
163  ,
165  /** Busy processing, try again later */
166  ,
167  XRV_BUSY = 276
168  /** Invalid instance called */
169  ,
171  /** A trusted data stream proves to contain corrupted data */
172  ,
174 
175  /** Failure during read of settings */
176  ,
178  /** Could not find any Moven-compatible hardware */
179  ,
181  /** Found only one responding Xbus Master */
182  ,
184  /** No sensors found */
185  ,
187  /** One or more sensors are not where they were expected */
188  ,
190  /** Not enough sensors were found */
191  ,
193  /** Failure during initialization of Fusion Engine */
194  ,
196  /** Something else was received than was requested */
197  ,
198  XRV_OTHER = 286
199 
200  /** No file opened for reading/writing */
201  ,
203  /** No serial port opened for reading/writing */
204  ,
206  /** No file or serial port opened for reading/writing */
207  ,
209  /** A required port could not be found */
210  ,
212  /** The low-level port handler failed to initialize */
213  ,
215  /** A calibration routine failed */
216  ,
218 
219  /** The in-config check of the device failed */
220  ,
222  /** The operation is once only and has already been performed */
223  ,
225 
226  /** The single connected device is configured as a slave */
227  ,
229  /** More than one master was detected */
230  ,
232  /** A device was detected that was neither master nor slave */
233  ,
235  /** No master detected */
236  ,
238  /** A device is not sending enough data */
239  ,
241 
242  /** The version of the object is too low for the requested operation */
243  ,
245  /** The object has an unrecognized version, so it's not safe to perform the
246  operation */
247  ,
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
Operation was performed successfully.
Definition: xsens_std.h:35
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: 8fe78517f Sun Jul 14 19:43:28 2019 +0200 at lun oct 28 02:10:00 CET 2019