Main MRPT website > C++ reference for MRPT 1.5.7
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-2017, 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 xsens_std.cpp
30 typedef enum /*! \cond NODOXYGEN */ _XsensResultValue_ /*! \endcond */ {
31  // general OK
32  XRV_OK = 0 //!< Operation was performed successfully
33 
34  // communication protocol
35  ,XRV_NOBUS = 1 //!< No bus communication possible
36  ,XRV_BUSNOTREADY = 2 //!< InitBus and/or SetBID are not issued
37  ,XRV_INVALIDPERIOD = 3 //!< Period sent is invalid
38  ,XRV_INVALIDMSG = 4 //!< The message is invalid or not implemented
39  ,XRV_INITBUSFAIL1 = 16 //!< A slave did not respond to WaitForSetBID
40  ,XRV_INITBUSFAIL2 = 17 //!< An incorrect answer received after WaitForSetBID
41  ,XRV_INITBUSFAIL3 = 18 //!< After four bus-scans still undetected Motion Trackers
42  ,XRV_SETBIDFAIL1 = 20 //!< No reply to SetBID message during SetBID procedure
43  ,XRV_SETBIDFAIL2 = 21 //!< Other than SetBIDAck received
44  ,XRV_MEASUREMENTFAIL1 = 24 //!< Timer overflow - period too short to collect all data from Motion Trackers
45  ,XRV_MEASUREMENTFAIL2 = 25 //!< Motion Tracker responds with other than SlaveData message
46  ,XRV_MEASUREMENTFAIL3 = 26 //!< Total bytes of data of Motion Trackers including sample counter exceeds 255 bytes
47  ,XRV_MEASUREMENTFAIL4 = 27 //!< Timer overflows during measurement
48  ,XRV_MEASUREMENTFAIL5 = 28 //!< Timer overflows during measurement
49  ,XRV_MEASUREMENTFAIL6 = 29 //!< No correct response from Motion Tracker during measurement
50  ,XRV_TIMEROVERFLOW = 30 //!< Timer overflows during measurement
51  ,XRV_BAUDRATEINVALID = 32 //!< Baud rate does not comply with valid range
52  ,XRV_PARAMINVALID = 33 //!< An invalid parameter is supplied
53  ,XRV_INVALIDPARAM = 33 //!< An invalid parameter is supplied
54  ,XRV_MEASUREMENTFAIL7 = 35 //!< TX PC Buffer is full
55  ,XRV_MEASUREMENTFAIL8 = 36 //!< TX PC Buffer overflow, cannot fit full message
56 
57  // CMT / XME / etc
58  ,XRV_ERROR = 256 //!< A generic error occurred
59  ,XRV_NOTIMPLEMENTED = 257 //!< Operation not implemented in this version (yet)
60  ,XRV_TIMEOUT = 258 //!< A timeout occurred
61  ,XRV_TIMEOUTNODATA = 259 //!< Operation aborted because of no data read
62  ,XRV_CHECKSUMFAULT = 260 //!< Checksum fault occured
63  ,XRV_OUTOFMEMORY = 261 //!< No internal memory available
64  ,XRV_NOTFOUND = 262 //!< The requested item was not found
65  ,XRV_UNEXPECTEDMSG = 263 //!< Unexpected message received (e.g. no acknowledge message received)
66  ,XRV_INVALIDID = 264 //!< Invalid id supplied
67  ,XRV_INVALIDOPERATION = 265 //!< Operation is invalid at this point
68  ,XRV_INSUFFICIENTSPACE = 266 //!< Insufficient buffer space available
69  ,XRV_INPUTCANNOTBEOPENED = 267 //!< The specified i/o device can not be opened
70  ,XRV_OUTPUTCANNOTBEOPENED = 268 //!< The specified i/o device can not be opened
71  ,XRV_ALREADYOPEN = 269 //!< An I/O device is already opened with this object
72  ,XRV_ENDOFFILE = 270 //!< End of file is reached
73  ,XRV_COULDNOTREADSETTINGS = 271 //!< A required settings file could not be opened or is missing some data
74  ,XRV_NODATA = 272 //!< No data is available
75  ,XRV_READONLY = 273 //!< Tried to change a read-only value
76  ,XRV_NULLPTR = 274 //!< Tried to supply a NULL value where it is not allowed
77  ,XRV_INSUFFICIENTDATA = 275 //!< Insufficient data was supplied to a function
78  ,XRV_BUSY = 276 //!< Busy processing, try again later
79  ,XRV_INVALIDINSTANCE = 277 //!< Invalid instance called
80  ,XRV_DATACORRUPT = 278 //!< A trusted data stream proves to contain corrupted data
81 
82  ,XRV_READINITFAILED = 279 //!< Failure during read of settings
83  ,XRV_NOXMFOUND = 280 //!< Could not find any Moven-compatible hardware
84  ,XRV_ONLYONEXMFOUND = 281 //!< Found only one responding Xbus Master
85  ,XRV_MTCOUNTZERO = 282 //!< No sensors found
86  ,XRV_MTLOCATIONINVALID = 283 //!< One or more sensors are not where they were expected
87  ,XRV_INSUFFICIENTMTS = 284 //!< Not enough sensors were found
88  ,XRV_INITFUSIONFAILED = 285 //!< Failure during initialization of Fusion Engine
89  ,XRV_OTHER = 286 //!< Something else was received than was requested
90 
91  ,XRV_NOFILEOPEN = 287 //!< No file opened for reading/writing
92  ,XRV_NOPORTOPEN = 288 //!< No serial port opened for reading/writing
93  ,XRV_NOFILEORPORTOPEN = 289 //!< No file or serial port opened for reading/writing
94  ,XRV_PORTNOTFOUND = 290 //!< A required port could not be found
95  ,XRV_INITPORTFAILED = 291 //!< The low-level port handler failed to initialize
96  ,XRV_CALIBRATIONFAILED = 292 //!< A calibration routine failed
97 
98  ,XRV_CONFIGCHECKFAIL = 293 //!< The in-config check of the device failed
99  ,XRV_ALREADYDONE = 294 //!< The operation is once only and has already been performed
100 
101  ,XRV_SYNC_SINGLE_SLAVE = 295 //!< The single connected device is configured as a slave
102  ,XRV_SYNC_SECOND_MASTER = 296 //!< More than one master was detected
103  ,XRV_SYNC_NO_SYNC = 297 //!< A device was detected that was neither master nor slave
104  ,XRV_SYNC_NO_MASTER = 298 //!< No master detected
105  ,XRV_SYNC_DATA_MISSING = 299 //!< A device is not sending enough data
106 
107  ,XRV_VERSION_TOO_LOW = 300 //!< The version of the object is too low for the requested operation
108  ,XRV_VERSION_PROBLEM = 301 //!< The object has an unrecognized version, so it's not safe to perform the operation
110 
111 //////////////////////////////////////////////////////////////////////////////////////////
112 
113 /*! \cond NODOXYGEN */
114 #ifndef DELNUL
115 //! This macro deletes a pointer and sets it to NULL
116 #define DELNUL(ptr) { delete ptr; ptr = NULL; }
117 //! This macro deletes a pointer if it is not NULL and then sets it to NULL
118 #define CHKDELNUL(ptr) { if (ptr != NULL) { delete ptr; ptr = NULL; } }
119 //! This macro deletes a multi-object pointer and sets it to NULL
120 #define LSTDELNUL(ptr) { delete[] ptr; ptr = NULL; }
121 //! This macro deletes a multi-object pointer if it is not NULL and then sets it to NULL
122 #define LSTCHKDELNUL(ptr) { if (ptr != NULL) { delete[] ptr; ptr = NULL; } }
123 
124 //! This macro frees a pointer and then sets it to NULL
125 #define FREENUL(ptr) { free(ptr); ptr = NULL; }
126 //! This macro frees a pointer if it is not NULL and then sets it to NULL
127 #define CHKFREENUL(ptr) { if (ptr != NULL) { free(ptr); ptr = NULL; } }
128 #endif
129 /*! \endcond */
130 
131 //////////////////////////////////////////////////////////////////////////////////////////
132 
133 /* \brief Retrieve a string corresponding to the given result code.
134 
135  This function uses the CmtResultText list to return a string with the relevant result
136  code in a textual format. If the supplied result code is invalid the
137  "!!Invalid result code!!" string is returned.
138 */
139 #if !defined(_CMT_DLL_IMPORT) && !defined(_XME_DLL_IMPORT)
140 const char* xsensResultText(const XsensResultValue result);
141 #endif
142 
143 //////////////////////////////////////////////////////////////////////////////////////////
144 
145 #define XSENS_LABEL_SIZE 64 //!< The maximum length of a label
146 #define XSENS_SHORT_STRING_SIZE 256 //!< The maximum length of a short string
147 #define XSENS_LONG_STRING_SIZE 16384 //!< The maximum length of a long string
148 
149 //////////////////////////////////////////////////////////////////////////////////////////
150 
151 #endif // _XSENS_STD_H_2006_09_11
Operation was performed successfully.
Definition: xsens_std.h:32
A calibration routine failed.
Definition: xsens_std.h:96
A slave did not respond to WaitForSetBID.
Definition: xsens_std.h:39
No bus communication possible.
Definition: xsens_std.h:35
Found only one responding Xbus Master.
Definition: xsens_std.h:84
No sensors found.
Definition: xsens_std.h:85
Other than SetBIDAck received.
Definition: xsens_std.h:43
A timeout occurred.
Definition: xsens_std.h:60
TX PC Buffer overflow, cannot fit full message.
Definition: xsens_std.h:55
Operation aborted because of no data read.
Definition: xsens_std.h:61
One or more sensors are not where they were expected.
Definition: xsens_std.h:86
Operation not implemented in this version (yet)
Definition: xsens_std.h:59
No reply to SetBID message during SetBID procedure.
Definition: xsens_std.h:42
A device is not sending enough data.
Definition: xsens_std.h:105
The specified i/o device can not be opened.
Definition: xsens_std.h:69
The specified i/o device can not be opened.
Definition: xsens_std.h:70
After four bus-scans still undetected Motion Trackers.
Definition: xsens_std.h:41
An invalid parameter is supplied.
Definition: xsens_std.h:52
A required port could not be found.
Definition: xsens_std.h:94
Operation is invalid at this point.
Definition: xsens_std.h:67
Could not find any Moven-compatible hardware.
Definition: xsens_std.h:83
Timer overflows during measurement.
Definition: xsens_std.h:50
No internal memory available.
Definition: xsens_std.h:63
Insufficient buffer space available.
Definition: xsens_std.h:68
End of file is reached.
Definition: xsens_std.h:72
An incorrect answer received after WaitForSetBID.
Definition: xsens_std.h:40
InitBus and/or SetBID are not issued.
Definition: xsens_std.h:36
Tried to change a read-only value.
Definition: xsens_std.h:75
A required settings file could not be opened or is missing some data.
Definition: xsens_std.h:73
Invalid id supplied.
Definition: xsens_std.h:66
Checksum fault occured.
Definition: xsens_std.h:62
The operation is once only and has already been performed.
Definition: xsens_std.h:99
No serial port opened for reading/writing.
Definition: xsens_std.h:92
Baud rate does not comply with valid range.
Definition: xsens_std.h:51
A trusted data stream proves to contain corrupted data.
Definition: xsens_std.h:80
No data is available.
Definition: xsens_std.h:74
XsensResultValue
Xsens return values.
Definition: xsens_std.h:30
Motion Tracker responds with other than SlaveData message.
Definition: xsens_std.h:45
The requested item was not found.
Definition: xsens_std.h:64
Failure during read of settings.
Definition: xsens_std.h:82
The in-config check of the device failed.
Definition: xsens_std.h:98
Period sent is invalid.
Definition: xsens_std.h:37
The single connected device is configured as a slave.
Definition: xsens_std.h:101
More than one master was detected.
Definition: xsens_std.h:102
Insufficient data was supplied to a function.
Definition: xsens_std.h:77
A device was detected that was neither master nor slave.
Definition: xsens_std.h:103
The object has an unrecognized version, so it&#39;s not safe to perform the operation.
Definition: xsens_std.h:108
Failure during initialization of Fusion Engine.
Definition: xsens_std.h:88
Timer overflows during measurement.
Definition: xsens_std.h:48
The low-level port handler failed to initialize.
Definition: xsens_std.h:95
Invalid instance called.
Definition: xsens_std.h:79
An invalid parameter is supplied.
Definition: xsens_std.h:53
TX PC Buffer is full.
Definition: xsens_std.h:54
Timer overflows during measurement.
Definition: xsens_std.h:47
Tried to supply a NULL value where it is not allowed.
Definition: xsens_std.h:76
Something else was received than was requested.
Definition: xsens_std.h:89
No correct response from Motion Tracker during measurement.
Definition: xsens_std.h:49
A generic error occurred.
Definition: xsens_std.h:58
const char * xsensResultText(const XsensResultValue result)
Definition: xsens_std.cpp:13
The version of the object is too low for the requested operation.
Definition: xsens_std.h:107
Not enough sensors were found.
Definition: xsens_std.h:87
Timer overflow - period too short to collect all data from Motion Trackers.
Definition: xsens_std.h:44
Unexpected message received (e.g. no acknowledge message received)
Definition: xsens_std.h:65
An I/O device is already opened with this object.
Definition: xsens_std.h:71
Busy processing, try again later.
Definition: xsens_std.h:78
No master detected.
Definition: xsens_std.h:104
No file opened for reading/writing.
Definition: xsens_std.h:91
Total bytes of data of Motion Trackers including sample counter exceeds 255 bytes.
Definition: xsens_std.h:46
The message is invalid or not implemented.
Definition: xsens_std.h:38
No file or serial port opened for reading/writing.
Definition: xsens_std.h:93



Page generated by Doxygen 1.8.14 for MRPT 1.5.7 Git: 5902e14cc Wed Apr 24 15:04:01 2019 +0200 at lun oct 28 01:39:17 CET 2019