00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef _CMTDEF_H_2006_05_01
00031 #define _CMTDEF_H_2006_05_01
00032
00033 #ifndef _CMT_MONOLITHIC
00034 #ifndef _PSTDINT_H_INCLUDED
00035 # include "pstdint.h"
00036 #endif
00037 #endif
00038 #include <time.h>
00039
00040 #ifdef _WIN32
00041 #else
00042 # include <termios.h>
00043 # include <string.h>
00044 # ifndef B460800
00045 # undef B230400
00046 # define B230400 0010003
00047 # define B460800 0010004
00048 # define B921600 0010007
00049 # endif
00050
00051 # define __cdecl __attribute__((cdecl))
00052 # define __stdcall __attribute__((stdcall))
00053 #endif
00054
00055 #ifndef _XSENS_STD_H_2006_09_11
00056 # include "xsens_std.h"
00057 #endif
00058 #if !defined(_XSENS_TIME_2006_09_12) && !defined(_CMT_DLL_IMPORT)
00059 # include "xsens_time.h"
00060 #endif
00061
00062 #ifndef _CMT_FILE_DEF_H_2007_01_24
00063 # include "cmtf.h"
00064 #endif
00065
00066
00067
00068 #define CMT_IND_PREAMBLE 0
00069 #define CMT_IND_BID 1
00070 #define CMT_IND_MID 2
00071 #define CMT_IND_LEN 3
00072 #define CMT_IND_DATA0 4
00073 #define CMT_IND_LENEXTH 4
00074 #define CMT_IND_LENEXTL 5
00075 #define CMT_IND_DATAEXT0 6
00076
00077 #define CMT_PREAMBLE 0xFA
00078 #define CMT_BID_MASTER 0xFF
00079 #define CMT_BID_MT 0x01
00080 #define CMT_EXTLENCODE 0xFF
00081
00082 #define CMT_LEN_MSGHEADER 4
00083 #define CMT_LEN_MSGEXTHEADER 6
00084 #define CMT_LEN_MSGHEADERCS 5
00085 #define CMT_LEN_MSGEXTHEADERCS 7
00086 #define CMT_LEN_CHECKSUM 1
00087 #define CMT_LEN_UNSIGSHORT 2
00088 #define CMT_LEN_UNSIGINT 4
00089 #define CMT_LEN_FLOAT 4
00090
00091
00092 #define CMT_MAXDATALEN 8192
00093 #define CMT_MAXSHORTDATALEN 254
00094 #define CMT_MAXMSGLEN (CMT_MAXDATALEN+7)
00095 #define CMT_MAXSHORTMSGLEN (CMT_MAXSHORTDATALEN+5)
00096 #define CMT_MAXGARBAGE (CMT_MAXMSGLEN+1)
00097
00098
00099
00100 #define CMT_DID_TYPEH_MASK 0x00F00000
00101 #define CMT_DID_TYPEL_MASK 0x000F0000
00102 #define CMT_DID_TYPEH_MT 0x00000000
00103 #define CMT_DID_TYPEH_XM 0x00100000
00104 #define CMT_DID_TYPEH_MTI_MTX 0x00300000
00105 #define CMT_DID_TYPEH_MTIG 0x00500000
00106 #define CMT_DID_TYPE_MASK 0x00FF0000
00107 #define CMT_DID_TYPE_MASK_MT_232 0x00300000
00108 #define CMT_DID_TYPE_MASK_MT_422 0x00310000
00109 #define CMT_DID_TYPE_MASK_MT_XM 0x00020000
00110 #define CMT_DID_TYPE_MASK_MT_485 0x00330000
00111
00112
00113
00114 #define CMT_MID_WAKEUP 0x3E
00115 #define CMT_MID_WAKEUPACK 0x3F
00116
00117
00118 #define CMT_MID_REQDID 0x00
00119 #define CMT_MID_DEVICEID 0x01
00120 #define CMT_LEN_DEVICEID 4
00121 #define CMT_MID_INITBUS 0x02
00122 #define CMT_MID_INITBUSRESULTS 0x03
00123 #define CMT_LEN_INITBUSRESULTS 4
00124 #define CMT_MID_REQPERIOD 0x04
00125 #define CMT_MID_REQPERIODACK 0x05
00126 #define CMT_LEN_PERIOD 2
00127 #define CMT_MID_SETPERIOD 0x04
00128 #define CMT_MID_SETPERIODACK 0x05
00129
00130 #define CMT_MID_SETBID 0x06
00131 #define CMT_MID_SETBIDACK 0x07
00132 #define CMT_MID_AUTOSTART 0x06
00133 #define CMT_MID_AUTOSTARTACK 0x07
00134 #define CMT_MID_BUSPWR 0x08
00135 #define CMT_LEN_BUSPWR 2
00136 #define CMT_MID_BUSPWRACK 0x09
00137
00138 #define CMT_MID_REQDATALENGTH 0x0A
00139 #define CMT_MID_DATALENGTH 0x0B
00140 #define CMT_LEN_DATALENGTH 2
00141 #define CMT_MID_REQCONFIGURATION 0x0C
00142 #define CMT_MID_CONFIGURATION 0x0D
00143 #define CMT_LEN_CONFIGURATION 118
00144 #define CMT_MID_RESTOREFACTORYDEF 0x0E
00145 #define CMT_MID_RESTOREFACTORYDEFACK 0x0F
00146
00147 #define CMT_MID_GOTOMEASUREMENT 0x10
00148 #define CMT_MID_GOTOMEASUREMENTACK 0x11
00149 #define CMT_MID_REQFWREV 0x12
00150 #define CMT_MID_FIRMWAREREV 0x13
00151 #define CMT_LEN_FIRMWAREREV 3
00152
00153 #define CMT_MID_REQBTDISABLE 0x14
00154 #define CMT_MID_REQBTDISABLEACK 0x15
00155 #define CMT_LEN_BTDISABLE 1
00156 #define CMT_MID_DISABLEBT 0x14
00157 #define CMT_MID_DISABLEBTACK 0x15
00158 #define CMT_MID_REQOPMODE 0x16
00159 #define CMT_MID_REQOPMODEACK 0x17
00160 #define CMT_LEN_OPMODE 1
00161 #define CMT_MID_SETOPMODE 0x16
00162 #define CMT_MID_SETOPMODEACK 0x17
00163
00164 #define CMT_MID_REQBAUDRATE 0x18
00165 #define CMT_MID_REQBAUDRATEACK 0x19
00166 #define CMT_LEN_BAUDRATE 1
00167 #define CMT_MID_SETBAUDRATE 0x18
00168 #define CMT_MID_SETBAUDRATEACK 0x19
00169
00170 #define CMT_MID_REQSYNCMODE 0x1A
00171 #define CMT_MID_REQSYNCMODEACK 0x1B
00172 #define CMT_LEN_SYNCMODE 1
00173 #define CMT_MID_SETSYNCMODE 0x1A
00174 #define CMT_MID_SETSYNCMODEACK 0x1B
00175
00176 #define CMT_MID_REQPRODUCTCODE 0x1C
00177 #define CMT_MID_PRODUCTCODE 0x1D
00178 #define CMT_LEN_PRODUCTCODE 20
00179
00180 #define CMT_MID_REQPROCESSINGFLAGS 0x20
00181 #define CMT_MID_REQPROCESSINGFLAGSACK 0x21
00182 #define CMT_LEN_PROCESSINGFLAGS 2
00183 #define CMT_MID_SETPROCESSINGFLAGS 0x20
00184 #define CMT_MID_SETPROCESSINGFLAGSACK 0x21
00185
00186
00187 #define CMT_MID_XMPWROFF 0x44
00188 #define CMT_LEN_XMPWROFF 0
00189
00190
00191 #define CMT_MID_REQOUTPUTMODE 0xD0
00192 #define CMT_MID_REQOUTPUTMODEACK 0xD1
00193 #define CMT_LEN_OUTPUTMODE 2
00194 #define CMT_MID_SETOUTPUTMODE 0xD0
00195 #define CMT_MID_SETOUTPUTMODEACK 0xD1
00196
00197 #define CMT_MID_REQOUTPUTSETTINGS 0xD2
00198 #define CMT_MID_REQOUTPUTSETTINGSACK 0xD3
00199 #define CMT_LEN_OUTPUTSETTINGS 4
00200 #define CMT_MID_SETOUTPUTSETTINGS 0xD2
00201 #define CMT_MID_SETOUTPUTSETTINGSACK 0xD3
00202
00203 #define CMT_MID_REQOUTPUTSKIPFACTOR 0xD4
00204 #define CMT_MID_REQOUTPUTSKIPFACTORACK 0xD5
00205 #define CMT_LEN_OUTPUTSKIPFACTOR 2
00206 #define CMT_MID_SETOUTPUTSKIPFACTOR 0xD4
00207 #define CMT_MID_SETOUTPUTSKIPFACTORACK 0xD5
00208
00209 #define CMT_MID_REQSYNCINSETTINGS 0xD6
00210 #define CMT_MID_REQSYNCINSETTINGSACK 0xD7
00211 #define CMT_LEN_SYNCINMODE 2
00212 #define CMT_LEN_SYNCINSKIPFACTOR 2
00213 #define CMT_LEN_SYNCINOFFSET 4
00214 #define CMT_MID_SETSYNCINSETTINGS 0xD6
00215 #define CMT_MID_SETSYNCINSETTINGSACK 0xD7
00216
00217 #define CMT_MID_REQSYNCOUTSETTINGS 0xD8
00218 #define CMT_MID_REQSYNCOUTSETTINGSACK 0xD9
00219 #define CMT_LEN_SYNCOUTMODE 2
00220 #define CMT_LEN_SYNCOUTSKIPFACTOR 2
00221 #define CMT_LEN_SYNCOUTOFFSET 4
00222 #define CMT_LEN_SYNCOUTPULSEWIDTH 4
00223 #define CMT_MID_SETSYNCOUTSETTINGS 0xD8
00224 #define CMT_MID_SETSYNCOUTSETTINGSACK 0xD9
00225
00226 #define CMT_MID_REQERRORMODE 0xDA
00227 #define CMT_MID_REQERRORMODEACK 0xDB
00228 #define CMT_LEN_ERRORMODE 2
00229 #define CMT_MID_SETERRORMODE 0xDA
00230 #define CMT_MID_SETERRORMODEACK 0xDB
00231
00232 #define CMT_MID_REQTRANSMITDELAY 0xDC
00233 #define CMT_MID_REQTRANSMITDELAYACK 0xDD
00234 #define CMT_LEN_TRANSMITDELAY 2
00235 #define CMT_MID_SETTRANSMITDELAY 0xDC
00236 #define CMT_MID_SETTRANSMITDELAYACK 0xDD
00237
00238 #define CMT_MID_REQOBJECTALIGNMENT 0xE0
00239 #define CMT_MID_REQOBJECTALIGNMENTACK 0xE1
00240 #define CMT_LEN_OBJECTALIGNMENT 36
00241 #define CMT_MID_SETOBJECTALIGNMENT 0xE0
00242 #define CMT_MID_SETOBJECTALIGNMENTACK 0xE1
00243
00244
00245 #define CMT_MID_REQXMERRORMODE 0x82
00246 #define CMT_MID_REQXMERRORMODEACK 0x83
00247 #define CMT_LEN_XMERRORMODE 2
00248 #define CMT_MID_SETXMERRORMODE 0x82
00249 #define CMT_MID_SETXMERRORMODEACK 0x83
00250
00251 #define CMT_MID_REQBUFFERSIZE 0x84
00252 #define CMT_MID_REQBUFFERSIZEACK 0x85
00253 #define CMT_LEN_BUFFERSIZE 2
00254 #define CMT_MID_SETBUFFERSIZE 0x84
00255 #define CMT_MID_SETBUFFERSIZEACK 0x85
00256
00257
00258 #define CMT_MID_REQHEADING 0x82
00259 #define CMT_MID_REQHEADINGACK 0x83
00260 #define CMT_LEN_HEADING 4
00261 #define CMT_MID_SETHEADING 0x82
00262 #define CMT_MID_SETHEADINGACK 0x83
00263
00264 #define CMT_MID_REQMAGNETICDECLINATION 0x6A
00265 #define CMT_MID_REQMAGNETICDECLINATIONACK 0x6B
00266 #define CMT_LEN_MAGNETICDECLINATION 4
00267 #define CMT_MID_SETMAGNETICDECLINATION 0x6A
00268 #define CMT_MID_SETMAGNETICDECLINATIONACK 0x6B
00269
00270 #define CMT_MID_REQLOCATIONID 0x84
00271 #define CMT_MID_REQLOCATIONIDACK 0x85
00272 #define CMT_LEN_LOCATIONID 2
00273 #define CMT_MID_SETLOCATIONID 0x84
00274 #define CMT_MID_SETLOCATIONIDACK 0x85
00275
00276 #define CMT_MID_REQEXTOUTPUTMODE 0x86
00277 #define CMT_MID_REQEXTOUTPUTMODEACK 0x87
00278 #define CMT_LEN_EXTOUTPUTMODE 2
00279 #define CMT_MID_SETEXTOUTPUTMODE 0x86
00280 #define CMT_MID_SETEXTOUTPUTMODEACK 0x87
00281
00282
00283 #define CMT_MID_REQBATLEVEL 0x88
00284 #define CMT_MID_BATLEVEL 0x89
00285
00286
00287 #define CMT_MID_REQINITTRACKMODE 0x88
00288 #define CMT_MID_REQINITTRACKMODEACK 0x89
00289 #define CMT_LEN_INITTRACKMODE 2
00290 #define CMT_MID_SETINITTRACKMODE 0x88
00291 #define CMT_MID_SETINITTRACKMODEACK 0x89
00292
00293
00294
00295
00296
00297
00298 #define CMT_MID_STOREXKFSTATE 0x8A
00299 #define CMT_LEN_STOREXKFSTATE 0
00300 #define CMT_MID_STOREXKFSTATEACK 0x8B
00301
00302 #define CMT_MID_REQUTCTIME 0x60
00303 #define CMT_MID_UTCTIME 0x61
00304 #define CMT_LEN_UTCTIME 12
00305
00306 #define CMT_LEN_SCENARIOLABEL 20
00307 #define CMT_LEN_SCENARIOFULL (1+1+CMT_LEN_SCENARIOLABEL)
00308 #define CMT_MID_REQAVAILABLESCENARIOS 0x62
00309 #define CMT_MID_AVAILABLESCENARIOS 0x63
00310 #define CMT_LEN_AVAILABLESCENARIOS (CMT_MAX_SCENARIOS_IN_MT*CMT_LEN_SCENARIOFULL)
00311
00312 #define CMT_MID_REQSCENARIO 0x64
00313 #define CMT_MID_REQSCENARIOACK 0x65
00314 #define CMT_LEN_REQSCENARIOACK 2
00315 #define CMT_MID_SETSCENARIO 0x64
00316 #define CMT_MID_SETSCENARIOACK 0x65
00317 #define CMT_LEN_SETSCENARIO 1
00318
00319 #define CMT_MID_REQGRAVITYMAGNITUDE 0x66
00320 #define CMT_MID_REQGRAVITYMAGNITUDEACK 0x67
00321 #define CMT_MID_SETGRAVITYMAGNITUDE 0x66
00322 #define CMT_MID_SETGRAVITYMAGNITUDEACK 0x67
00323 #define CMT_LEN_GRAVITYMAGNITUDE 4
00324
00325 #define CMT_MID_REQGPSLEVERARM 0x68
00326 #define CMT_MID_REQGPSLEVERARMACK 0x69
00327 #define CMT_MID_SETGPSLEVERARM 0x68
00328 #define CMT_MID_SETGPSLEVERARMACK 0x69
00329 #define CMT_LEN_GPSLEVERARM 12
00330
00331 #define CMT_MID_REQLATLONALT 0x6E
00332 #define CMT_MID_REQLATLONALTACK 0x6F
00333 #define CMT_LEN_LATLONALT 18
00334 #define CMT_MID_SETLATLONALT 0x6E
00335 #define CMT_MID_SETLATLONALTACK 0x6F
00336
00337
00338 #define CMT_MID_GOTOCONFIG 0x30
00339 #define CMT_MID_GOTOCONFIGACK 0x31
00340 #define CMT_MID_BUSDATA 0x32
00341 #define CMT_MID_MTDATA 0x32
00342
00343 #define CMT_MID_SETNOROTATION 0x22
00344 #define CMT_MID_SETNOROTATIONACK 0x23
00345 #define CMT_LEN_SETNOROTATION 2
00346
00347
00348 #define CMT_MID_PREPAREDATA 0x32
00349 #define CMT_MID_REQDATA 0x34
00350 #define CMT_MID_REQDATAACK 0x35
00351
00352
00353
00354 #define CMT_LEN_RAWDATA 20
00355 #define CMT_LEN_CALIBDATA 36
00356 #define CMT_LEN_CALIB_ACCDATA 12
00357 #define CMT_LEN_CALIB_GYRDATA 12
00358 #define CMT_LEN_CALIB_MAGDATA 12
00359 #define CMT_LEN_ORIENT_QUATDATA 16
00360 #define CMT_LEN_ORIENT_EULERDATA 12
00361 #define CMT_LEN_ORIENT_MATRIXDATA 36
00362 #define CMT_LEN_SAMPLECNT 2
00363 #define CMT_LEN_TEMPDATA 4
00364
00365
00366 #define CMT_LEN_CALIBDATA_FLT 9
00367 #define CMT_LEN_TEMPDATA_FLT 1
00368 #define CMT_LEN_ORIENT_QUATDATA_FLT 4
00369 #define CMT_LEN_ORIENT_EULERDATA_FLT 3
00370 #define CMT_LEN_ORIENT_MATRIXDATA_FLT 9
00371
00372
00373
00374
00375 #define CMT_IND_RAW_ACCX 0
00376 #define CMT_IND_RAW_ACCY 2
00377 #define CMT_IND_RAW_ACCZ 4
00378 #define CMT_IND_RAW_GYRX 6
00379 #define CMT_IND_RAW_GYRY 8
00380 #define CMT_IND_RAW_GYRZ 10
00381 #define CMT_IND_RAW_MAGX 12
00382 #define CMT_IND_RAW_MAGY 14
00383 #define CMT_IND_RAW_MAGZ 16
00384 #define CMT_IND_RAW_TEMP 18
00385
00386 #define CMT_IND_CALIB_ACCX 0
00387 #define CMT_IND_CALIB_ACCY 4
00388 #define CMT_IND_CALIB_ACCZ 8
00389 #define CMT_IND_CALIB_GYRX 12
00390 #define CMT_IND_CALIB_GYRY 16
00391 #define CMT_IND_CALIB_GYRZ 20
00392 #define CMT_IND_CALIB_MAGX 24
00393 #define CMT_IND_CALIB_MAGY 28
00394 #define CMT_IND_CALIB_MAGZ 32
00395
00396 #define CMT_IND_ORIENT_Q0 0
00397 #define CMT_IND_ORIENT_Q1 4
00398 #define CMT_IND_ORIENT_Q2 8
00399 #define CMT_IND_ORIENT_Q3 12
00400
00401 #define CMT_IND_ORIENT_ROLL 0
00402 #define CMT_IND_ORIENT_PITCH 4
00403 #define CMT_IND_ORIENT_YAW 8
00404
00405 #define CMT_IND_ORIENT_A 0
00406 #define CMT_IND_ORIENT_B 4
00407 #define CMT_IND_ORIENT_C 8
00408 #define CMT_IND_ORIENT_D 12
00409 #define CMT_IND_ORIENT_E 16
00410 #define CMT_IND_ORIENT_F 20
00411 #define CMT_IND_ORIENT_G 24
00412 #define CMT_IND_ORIENT_H 28
00413 #define CMT_IND_ORIENT_I 32
00414
00415 #define CMT_IND_SAMPLECNTH 0
00416 #define CMT_IND_SAMPLECNTL 1
00417
00418
00419
00420 #define CMT_FLDNUM_RAW_ACCX 0
00421 #define CMT_FLDNUM_RAW_ACCY 1
00422 #define CMT_FLDNUM_RAW_ACCZ 2
00423 #define CMT_FLDNUM_RAW_GYRX 3
00424 #define CMT_FLDNUM_RAW_GYRY 4
00425 #define CMT_FLDNUM_RAW_GYRZ 5
00426 #define CMT_FLDNUM_RAW_MAGX 6
00427 #define CMT_FLDNUM_RAW_MAGY 7
00428 #define CMT_FLDNUM_RAW_MAGZ 8
00429 #define CMT_FLDNUM_RAW_TEMP 9
00430
00431 #define CMT_FLDNUM_CALIB_ACCX 0
00432 #define CMT_FLDNUM_CALIB_ACCY 1
00433 #define CMT_FLDNUM_CALIB_ACCZ 2
00434 #define CMT_FLDNUM_CALIB_GYRX 3
00435 #define CMT_FLDNUM_CALIB_GYRY 4
00436 #define CMT_FLDNUM_CALIB_GYRZ 5
00437 #define CMT_FLDNUM_CALIB_MAGX 6
00438 #define CMT_FLDNUM_CALIB_MAGY 7
00439 #define CMT_FLDNUM_CALIB_MAGZ 8
00440
00441 #define CMT_FLDNUM_ORIENT_Q0 0
00442 #define CMT_FLDNUM_ORIENT_Q1 1
00443 #define CMT_FLDNUM_ORIENT_Q2 2
00444 #define CMT_FLDNUM_ORIENT_Q3 3
00445
00446 #define CMT_FLDNUM_ORIENT_ROLL 0
00447 #define CMT_FLDNUM_ORIENT_PITCH 1
00448 #define CMT_FLDNUM_ORIENT_YAW 2
00449
00450 #define CMT_FLDNUM_ORIENT_A 0
00451 #define CMT_FLDNUM_ORIENT_B 1
00452 #define CMT_FLDNUM_ORIENT_C 2
00453 #define CMT_FLDNUM_ORIENT_D 3
00454 #define CMT_FLDNUM_ORIENT_E 4
00455 #define CMT_FLDNUM_ORIENT_F 5
00456 #define CMT_FLDNUM_ORIENT_G 6
00457 #define CMT_FLDNUM_ORIENT_H 7
00458 #define CMT_FLDNUM_ORIENT_I 8
00459
00460
00461 #define CMT_LEN_RAW_ACCX 2
00462 #define CMT_LEN_RAW_ACCY 2
00463 #define CMT_LEN_RAW_ACCZ 2
00464 #define CMT_LEN_RAW_GYRX 2
00465 #define CMT_LEN_RAW_GYRY 2
00466 #define CMT_LEN_RAW_GYRZ 2
00467 #define CMT_LEN_RAW_MAGX 2
00468 #define CMT_LEN_RAW_MAGY 2
00469 #define CMT_LEN_RAW_MAGZ 2
00470 #define CMT_LEN_RAW_TEMP 2
00471
00472 #define CMT_LEN_CALIB_ACCX 4
00473 #define CMT_LEN_CALIB_ACCY 4
00474 #define CMT_LEN_CALIB_ACCZ 4
00475 #define CMT_LEN_CALIB_GYRX 4
00476 #define CMT_LEN_CALIB_GYRY 4
00477 #define CMT_LEN_CALIB_GYRZ 4
00478 #define CMT_LEN_CALIB_MAGX 4
00479 #define CMT_LEN_CALIB_MAGY 4
00480 #define CMT_LEN_CALIB_MAGZ 4
00481
00482 #define CMT_LEN_ORIENT_Q0 4
00483 #define CMT_LEN_ORIENT_Q1 4
00484 #define CMT_LEN_ORIENT_Q2 4
00485 #define CMT_LEN_ORIENT_Q3 4
00486
00487 #define CMT_LEN_ORIENT_ROLL 4
00488 #define CMT_LEN_ORIENT_PITCH 4
00489 #define CMT_LEN_ORIENT_YAW 4
00490
00491 #define CMT_LEN_ORIENT_A 4
00492 #define CMT_LEN_ORIENT_B 4
00493 #define CMT_LEN_ORIENT_C 4
00494 #define CMT_LEN_ORIENT_D 4
00495 #define CMT_LEN_ORIENT_E 4
00496 #define CMT_LEN_ORIENT_F 4
00497 #define CMT_LEN_ORIENT_G 4
00498 #define CMT_LEN_ORIENT_H 4
00499 #define CMT_LEN_ORIENT_I 4
00500
00501
00502 #define CMT_VALUE_RAW_ACC 0
00503 #define CMT_VALUE_RAW_GYR 1
00504 #define CMT_VALUE_RAW_MAG 2
00505 #define CMT_VALUE_RAW_TEMP 3
00506 #define CMT_VALUE_CALIB_ACC 4
00507 #define CMT_VALUE_CALIB_GYR 5
00508 #define CMT_VALUE_CALIB_MAG 6
00509 #define CMT_VALUE_ORIENT_QUAT 7
00510 #define CMT_VALUE_ORIENT_EULER 8
00511 #define CMT_VALUE_ORIENT_MATRIX 9
00512 #define CMT_VALUE_SAMPLECNT 10
00513 #define CMT_VALUE_TEMP 11
00514
00515 #define CMT_INVALIDSETTINGVALUE 0xFFFFFFFF
00516
00517
00518
00519 #define CMT_MID_RESET 0x40
00520 #define CMT_MID_RESETACK 0x41
00521 #define CMT_MID_ERROR 0x42
00522
00523 #define CMT_MID_XMPWROFF 0x44
00524
00525
00526 #define CMT_MID_REQFILTERSETTINGS 0xA0
00527 #define CMT_MID_REQFILTERSETTINGSACK 0xA1
00528 #define CMT_LEN_FILTERSETTINGS 4
00529 #define CMT_MID_SETFILTERSETTINGS 0xA0
00530 #define CMT_MID_SETFILTERSETTINGSACK 0xA1
00531 #define CMT_MID_REQAMD 0xA2
00532 #define CMT_MID_REQAMDACK 0xA3
00533 #define CMT_LEN_AMD 2
00534 #define CMT_MID_SETAMD 0xA2
00535 #define CMT_MID_SETAMDACK 0xA3
00536 #define CMT_MID_RESETORIENTATION 0xA4
00537 #define CMT_MID_RESETORIENTATIONACK 0xA5
00538 #define CMT_LEN_RESETORIENTATION 2
00539
00540 #define CMT_MID_REQGPSSTATUS 0xA6
00541 #define CMT_MID_GPSSTATUS 0xA7
00542 #define CMT_LEN_GPSSTATUS (1+5*16)
00543
00544
00545 #define CMT_BAUDCODE_4K8 0x0B
00546 #define CMT_BAUDCODE_9K6 0x09
00547
00548 #define CMT_BAUDCODE_19K2 0x07
00549
00550 #define CMT_BAUDCODE_38K4 0x05
00551 #define CMT_BAUDCODE_57K6 0x04
00552
00553 #define CMT_BAUDCODE_115K2 0x02
00554 #define CMT_BAUDCODE_230K4 0x01
00555 #define CMT_BAUDCODE_460K8 0x00
00556 #define CMT_BAUDCODE_921K6_ALT 0x0A // only usable from FW 2.4.6
00557 #define CMT_BAUDCODE_921K6 0x80
00558
00559
00560 #define CMT_ERROR_NOBUSCOMM 0x01
00561 #define CMT_ERROR_BUSNOTREADY 0x02
00562 #define CMT_ERROR_PERIODINVALID 0x03
00563 #define CMT_ERROR_MESSAGEINVALID 0x04
00564 #define CMT_ERROR_INITOFBUSFAILED1 0x10
00565 #define CMT_ERROR_INITOFBUSFAILED2 0x11
00566 #define CMT_ERROR_INITOFBUSFAILED3 0x12
00567 #define CMT_ERROR_SETBIDPROCFAILED1 0x14
00568 #define CMT_ERROR_SETBIDPROCFAILED2 0x15
00569 #define CMT_ERROR_MEASUREMENTFAILED1 0x18
00570 #define CMT_ERROR_MEASUREMENTFAILED2 0x19
00571 #define CMT_ERROR_MEASUREMENTFAILED3 0x1A
00572 #define CMT_ERROR_MEASUREMENTFAILED4 0x1B
00573 #define CMT_ERROR_MEASUREMENTFAILED5 0x1C
00574 #define CMT_ERROR_MEASUREMENTFAILED6 0x1D
00575 #define CMT_ERROR_TIMEROVERFLOW 0x1E
00576 #define CMT_ERROR_BAUDRATEINVALID 0x20
00577 #define CMT_ERROR_PARAMETERINVALID 0x21
00578 #define CMT_ERROR_MEASUREMENTFAILED7 0x23
00579
00580
00581 #define CMT_ERRORMODE_IGNORE 0x0000
00582 #define CMT_ERRORMODE_INCSAMPLECNT 0x0001
00583 #define CMT_ERRORMODE_INCSAMPLECNT_SENDERROR 0x0002
00584 #define CMT_ERRORMODE_SENDERROR_GOTOCONFIG 0x0003
00585
00586
00587 #define CMT_CONF_MASTERDID 0
00588 #define CMT_CONF_PERIOD 4
00589 #define CMT_CONF_OUTPUTSKIPFACTOR 6
00590 #define CMT_CONF_SYNCIN_MODE 8
00591 #define CMT_CONF_SYNCIN_SKIPFACTOR 10
00592 #define CMT_CONF_SYNCIN_OFFSET 12
00593 #define CMT_CONF_DATE 16
00594 #define CMT_CONF_TIME 24
00595 #define CMT_CONF_NUMDEVICES 96
00596
00597 #define CMT_CONF_DID 98
00598 #define CMT_CONF_DATALENGTH 102
00599 #define CMT_CONF_OUTPUTMODE 104
00600 #define CMT_CONF_OUTPUTSETTINGS 106
00601 #define CMT_CONF_BLOCKLEN 20
00602
00603
00604 #define CMT_CONF_MASTERDIDLEN 4
00605 #define CMT_CONF_PERIODLEN 2
00606 #define CMT_CONF_OUTPUTSKIPFACTORLEN 2
00607 #define CMT_CONF_SYNCIN_MODELEN 2
00608 #define CMT_CONF_SYNCIN_SKIPFACTORLEN 2
00609 #define CMT_CONF_SYNCIN_OFFSETLEN 4
00610 #define CMT_CONF_DATELEN 8
00611 #define CMT_CONF_TIMELEN 8
00612 #define CMT_CONF_RESERVED_CLIENTLEN 32
00613 #define CMT_CONF_RESERVED_HOSTLEN 32
00614 #define CMT_CONF_NUMDEVICESLEN 2
00615
00616 #define CMT_CONF_DIDLEN 4
00617 #define CMT_CONF_DATALENGTHLEN 2
00618 #define CMT_CONF_OUTPUTMODELEN 2
00619 #define CMT_CONF_OUTPUTSETTINGSLEN 4
00620
00621
00622 #define CMT_SYNC_CLOCKFREQMHZ 29.4912
00623 #define CMT_SYNC_CLOCK_NS_TO_TICKS (CMT_SYNC_CLOCKFREQMHZ * 1.0e-3)
00624 #define CMT_SYNC_CLOCK_TICKS_TO_NS (1.0e3 / CMT_SYNC_CLOCKFREQMHZ)
00625
00626
00627 #define CMT_PARAM_SYNCIN_MODE 0x00
00628 #define CMT_PARAM_SYNCIN_SKIPFACTOR 0x01
00629 #define CMT_PARAM_SYNCIN_OFFSET 0x02
00630
00631
00632 #define CMT_SYNCIN_DISABLED 0x0000
00633 #define CMT_SYNCIN_EDGE_RISING 0x0001
00634 #define CMT_SYNCIN_EDGE_FALLING 0x0002
00635 #define CMT_SYNCIN_EDGE_BOTH 0x0003
00636 #define CMT_SYNCIN_EDGE_MASK 0x0003
00637 #define CMT_SYNCIN_TYPE_DOSAMPLING 0x0000
00638 #define CMT_SYNCIN_TYPE_SENDLASTDATA 0x0004
00639 #define CMT_SYNCIN_TYPE_CLOCK 0x0010
00640 #define CMT_SYNCIN_TYPE_MASK 0x001C
00641
00642
00643 #define CMT_PARAM_SYNCOUT_MODE 0x00
00644 #define CMT_PARAM_SYNCOUT_SKIPFACTOR 0x01
00645 #define CMT_PARAM_SYNCOUT_OFFSET 0x02
00646 #define CMT_PARAM_SYNCOUT_PULSEWIDTH 0x03
00647
00648
00649 #define CMT_SYNCOUT_DISABLED 0x0000
00650 #define CMT_SYNCOUT_TYPE_TOGGLE 0x0001
00651 #define CMT_SYNCOUT_TYPE_PULSE 0x0002
00652 #define CMT_SYNCOUT_POL_NEG 0x0000
00653 #define CMT_SYNCOUT_POL_POS 0x0010
00654 #define CMT_SYNCOUT_TYPE_MASK 0x000F
00655 #define CMT_SYNCOUT_POL_MASK 0x0010
00656
00657
00658 #define CMT_OUTPUTMODE_MT9 0x8000
00659 #define CMT_OUTPUTMODE_XM 0x0000
00660 #define CMT_OUTPUTMODE_RAW 0x4000
00661
00662 #define CMT_OUTPUTMODE_GPSPVT_PRESSURE 0x1000
00663 #define CMT_OUTPUTMODE_TEMP 0x0001
00664 #define CMT_OUTPUTMODE_CALIB 0x0002
00665 #define CMT_OUTPUTMODE_ORIENT 0x0004
00666 #define CMT_OUTPUTMODE_AUXILIARY 0x0008
00667 #define CMT_OUTPUTMODE_POSITION 0x0010
00668 #define CMT_OUTPUTMODE_VELOCITY 0x0020
00669 #define CMT_OUTPUTMODE_STATUS 0x0800
00670
00671
00672
00673 #define CMT_OUTPUTSETTINGS_XM 0x00000001
00674 #define CMT_OUTPUTSETTINGS_TIMESTAMP_NONE 0x00000000
00675 #define CMT_OUTPUTSETTINGS_TIMESTAMP_SAMPLECNT 0x00000001
00676 #define CMT_OUTPUTSETTINGS_TIMESTAMP_SAMPLEUTC 0x00000002
00677 #define CMT_OUTPUTSETTINGS_ORIENTMODE_QUATERNION 0x00000000
00678 #define CMT_OUTPUTSETTINGS_ORIENTMODE_EULER 0x00000004
00679 #define CMT_OUTPUTSETTINGS_ORIENTMODE_MATRIX 0x00000008
00680 #define CMT_OUTPUTSETTINGS_CALIBMODE_ACCGYRMAG 0x00000000
00681 #define CMT_OUTPUTSETTINGS_CALIBMODE_ACC 0x00000060
00682 #define CMT_OUTPUTSETTINGS_CALIBMODE_ACCGYR 0x00000040
00683 #define CMT_OUTPUTSETTINGS_CALIBMODE_ACCMAG 0x00000020
00684 #define CMT_OUTPUTSETTINGS_CALIBMODE_GYR 0x00000050
00685 #define CMT_OUTPUTSETTINGS_CALIBMODE_GYRMAG 0x00000010
00686 #define CMT_OUTPUTSETTINGS_CALIBMODE_MAG 0x00000030
00687 #define CMT_OUTPUTSETTINGS_CALIBMODE_ACCGYRMAG_MASK 0x00000070
00688 #define CMT_OUTPUTSETTINGS_DATAFORMAT_FLOAT 0x00000000
00689 #define CMT_OUTPUTSETTINGS_DATAFORMAT_F1220 0x00000100
00690 #define CMT_OUTPUTSETTINGS_DATAFORMAT_FP1632 0x00000200
00691 #define CMT_OUTPUTSETTINGS_AUXILIARYMODE_AIN1 0x00000800
00692 #define CMT_OUTPUTSETTINGS_AUXILIARYMODE_AIN2 0x00000400
00693 #define CMT_OUTPUTSETTINGS_POSITIONMODE_LLA_WGS84 0x00000000
00694 #define CMT_OUTPUTSETTINGS_VELOCITYMODE_MS_XYZ 0x00000000
00695 #define CMT_OUTPUTSETTINGS_TIMESTAMP_MASK 0x00000003
00696 #define CMT_OUTPUTSETTINGS_ORIENTMODE_MASK 0x0000000C
00697 #define CMT_OUTPUTSETTINGS_CALIBMODE_ACC_MASK 0x00000010
00698 #define CMT_OUTPUTSETTINGS_CALIBMODE_GYR_MASK 0x00000020
00699 #define CMT_OUTPUTSETTINGS_CALIBMODE_MAG_MASK 0x00000040
00700 #define CMT_OUTPUTSETTINGS_CALIBMODE_MASK 0x00000070
00701 #define CMT_OUTPUTSETTINGS_DATAFORMAT_MASK 0x00000300
00702 #define CMT_OUTPUTSETTINGS_AUXILIARYMODE_AIN1_MASK 0x00000400
00703 #define CMT_OUTPUTSETTINGS_AUXILIARYMODE_AIN2_MASK 0x00000800
00704 #define CMT_OUTPUTSETTINGS_AUXILIARYMODE_MASK 0x00000C00
00705 #define CMT_OUTPUTSETTINGS_POSITIONMODE_MASK 0x0001C000
00706 #define CMT_OUTPUTSETTINGS_VELOCITYMODE_MASK 0x00060000
00707 #define CMT_OUTPUTSETTINGS_COORDINATES_NED 0x80000000
00708
00709
00710 #define CMT_EXTOUTPUTMODE_DISABLED 0x0000
00711 #define CMT_EXTOUTPUTMODE_EULER 0x0001
00712
00713
00714 #define CMT_INITTRACKMODE_DISABLED 0x0000
00715 #define CMT_INITTRACKMODE_ENABLED 0x0001
00716
00717
00718 #define CMT_PARAM_FILTER_GAIN 0x00
00719 #define CMT_PARAM_FILTER_RHO 0x01
00720 #define CMT_DONOTSTORE 0x00
00721 #define CMT_STORE 0x01
00722
00723
00724 #define CMT_AMDSETTING_DISABLED 0x0000
00725 #define CMT_AMDSETTING_ENABLED 0x0001
00726
00727
00728 #define CMT_PROCESSINGFLAGS_IGBU_ENABLED 0x0001
00729 #define CMT_PROCESSINGFLAGS_FIXED_GRAVITY 0x0002
00730
00731
00732 #define CMT_SENDRAWSTRING_INIT 0
00733 #define CMT_SENDRAWSTRING_DEFAULT 1
00734 #define CMT_SENDRAWSTRING_SEND 2
00735
00736
00737 #define CMT_TO_DEFAULT 500
00738 #define CMT_TO_INIT 250
00739 #define CMT_TO_RETRY 50
00740
00741 #define CMT_PERIOD_10HZ 11520 // invalid with gps pulse time correction
00742 #define CMT_PERIOD_12HZ 9600
00743 #define CMT_PERIOD_15HZ 7680 // invalid with gps pulse time correction
00744 #define CMT_PERIOD_16HZ 7200
00745 #define CMT_PERIOD_18HZ 6400 // invalid with gps pulse time correction
00746 #define CMT_PERIOD_20HZ 5760
00747 #define CMT_PERIOD_24HZ 4800
00748 #define CMT_PERIOD_25HZ 4608 // invalid with gps pulse time correction
00749 #define CMT_PERIOD_30HZ 3840
00750 #define CMT_PERIOD_32HZ 3600
00751 #define CMT_PERIOD_36HZ 3200
00752 #define CMT_PERIOD_40HZ 2880
00753 #define CMT_PERIOD_45HZ 2560 // invalid with gps pulse time correction
00754 #define CMT_PERIOD_48HZ 2400
00755 #define CMT_PERIOD_50HZ 2304 // invalid with gps pulse time correction
00756 #define CMT_PERIOD_60HZ 1920
00757 #define CMT_PERIOD_64HZ 1800
00758 #define CMT_PERIOD_72HZ 1600
00759 #define CMT_PERIOD_75HZ 1536 // invalid with gps pulse time correction
00760 #define CMT_PERIOD_80HZ 1440
00761 #define CMT_PERIOD_90HZ 1280 // invalid with gps pulse time correction
00762 #define CMT_PERIOD_96HZ 1200
00763
00764 #define CMT_PERIOD_100HZ 1152
00765 #define CMT_PERIOD_120HZ 960
00766 #define CMT_PERIOD_128HZ 900
00767 #define CMT_PERIOD_144HZ 800
00768 #define CMT_PERIOD_150HZ 768 // invalid with gps pulse time correction
00769 #define CMT_PERIOD_160HZ 720
00770 #define CMT_PERIOD_180HZ 640
00771 #define CMT_PERIOD_192HZ 600
00772 #define CMT_PERIOD_200HZ 576
00773 #define CMT_PERIOD_225HZ 512 // invalid with gps pulse time correction
00774 #define CMT_PERIOD_240HZ 480
00775 #define CMT_PERIOD_256HZ 450
00776 #define CMT_PERIOD_288HZ 400
00777 #define CMT_PERIOD_300HZ 384
00778 #define CMT_PERIOD_320HZ 360
00779 #define CMT_PERIOD_360HZ 320
00780 #define CMT_PERIOD_384HZ 300
00781 #define CMT_PERIOD_400HZ 288
00782 #define CMT_PERIOD_450HZ 256 // invalid with gps pulse time correction
00783 #define CMT_PERIOD_480HZ 240
00784 #define CMT_PERIOD_512HZ 225
00785
00786
00787 #ifdef _WIN32
00788 #define CMT_BAUD_RATE_4800 CBR_4800
00789 #define CMT_BAUD_RATE_9600 CBR_9600
00790
00791 #define CMT_BAUD_RATE_19K2 CBR_19200
00792
00793 #define CMT_BAUD_RATE_38K4 CBR_38400
00794 #define CMT_BAUD_RATE_57K6 CBR_57600
00795 #define CMT_BAUD_RATE_115K2 CBR_115200
00796 #define CMT_BAUD_RATE_230K4 230400
00797 #define CMT_BAUD_RATE_460K8 460800
00798 #define CMT_BAUD_RATE_921K6 921600
00799 #else
00800 #define CMT_BAUD_RATE_4800 B4800
00801 #define CMT_BAUD_RATE_9600 B9600
00802
00803 #define CMT_BAUD_RATE_19K2 B19200
00804
00805 #define CMT_BAUD_RATE_38K4 B38400
00806 #define CMT_BAUD_RATE_57K6 B57600
00807 #define CMT_BAUD_RATE_115K2 B115200
00808 #define CMT_BAUD_RATE_230K4 B230400
00809 #define CMT_BAUD_RATE_460K8 B460800
00810 #define CMT_BAUD_RATE_921K6 B921600
00811 #endif
00812
00813 #define CMT_DEFAULT_OUTPUT_MODE CMT_OUTPUTMODE_ORIENT
00814 #define CMT_DEFAULT_OUTPUT_SETTINGS (CMT_OUTPUTSETTINGS_ORIENTMODE_QUATERNION |\
00815 CMT_OUTPUTSETTINGS_TIMESTAMP_SAMPLECNT)
00816
00817 #define CMT_GOTO_CONFIG_TRIES 3
00818
00819 #define CMT_MAX_DEVICES_PER_PORT 11
00820 #define CMT_DEFAULT_SAMPLE_FREQUENCY 100
00821 #define CMT_DEFAULT_PERIOD 1152
00822 #define CMT_DEFAULT_SKIP 0
00823 #define CMT_DEFAULT_FILTER_GAIN 1.0f
00824 #define CMT_DEFAULT_FILTER_WEIGHTING 1.0f
00825 #define CMT_SYNCOUT_DEFAULT_PULSE_WIDTH 1000000 // 1ms = 1M ns
00826
00827
00828 #define CMT_MAX_PORTS_PER_THREAD 20
00829 #define CMT_MAX_FILES_PER_THREAD 20
00830 #if CMT_MAX_PORTS_PER_THREAD >= CMT_MAX_FILES_PER_THREAD
00831 # define CMT_MAX_DEVICES (CMT_MAX_PORTS_PER_THREAD * CMT_MAX_DEVICES_PER_PORT)
00832 #else
00833 # define CMT_MAX_DEVICES (CMT_MAX_FILES_PER_THREAD * CMT_MAX_DEVICES_PER_PORT)
00834 #endif
00835 #define CMT_MAX_PACKETS_PER_BUNDLE CMT_MAX_PORTS_PER_THREAD
00836 #define CMT_BUNDLE_QUEUE_SIZE 256
00837 #define CMT_MAX_ITEMS_IN_PACKET 10
00838
00839
00840 #define CMT_DEFAULT_READ_BUFFER_SIZE (CMT_MAXDATALEN*8)
00841
00842 #define CMT_DEFAULT_WRITE_BUFFER_SIZE CMT_MAXDATALEN
00843
00844 #define CMT_DEFAULT_BAUD_RATE CMT_BAUD_RATE_115K2
00845
00846 #define CMT2_DATA_QUEUE_SIZE 60
00847
00848
00849 #define CMT3_CONFIG_TIMEOUT 100
00850
00851 #define CMT1_DEFAULT_TIMEOUT 10
00852
00853 #define CMT2_DEFAULT_TIMEOUT 50
00854
00855 #define CMT3_DEFAULT_TIMEOUT_MEAS 16
00856
00857 #define CMT3_DEFAULT_TIMEOUT_CONF 3000
00858
00859 #define CMT4_DEFAULT_TIMEOUT_MEAS 1
00860
00861 #define CMT4_DEFAULT_TIMEOUT_CONF CMT3_DEFAULT_TIMEOUT_CONF
00862
00863 #define CMT4_MEASUREMENT_REQ_TIMEOUT 100
00864
00865 #define CMT4_DEFAULT_TIMEOUT_DATA 3000
00866
00867 #define CMT4_CONFIGWAIT_TIMEOUT 50
00868
00869 enum CmtControlLine {
00870 CMT_CONTROL_DCD = 0x0001,
00871 CMT_CONTROL_RD = 0x0002,
00872 CMT_CONTROL_TD = 0x0004,
00873 CMT_CONTROL_DTR = 0x0008,
00874 CMT_CONTROL_GND = 0x0010,
00875 CMT_CONTROL_DSR = 0x0020,
00876 CMT_CONTROL_RTS = 0x0040,
00877 CMT_CONTROL_CTS = 0x0080,
00878 CMT_CONTROL_RI = 0x0100
00879 };
00880
00881
00882 enum CmtResetMethod {
00883 CMT_RESETORIENTATION_STORE = 0,
00884 CMT_RESETORIENTATION_HEADING,
00885 CMT_RESETORIENTATION_GLOBAL,
00886 CMT_RESETORIENTATION_OBJECT,
00887 CMT_RESETORIENTATION_ALIGN
00888 };
00889
00890 enum CmtXmSyncMode {
00891 CMT_XM_SYNC_OFF = 0x00,
00892 CMT_XM_SYNC_PWM = 0x01,
00893 CMT_XM_SYNC_MASTER = 0x10,
00894 CMT_XM_SYNC_SLAVE = 0x20,
00895 CMT_XM_SYNC_TOGGLE = 0x30
00896 };
00897
00898
00899 typedef uint32_t CmtDeviceId;
00900
00901
00902 struct CmtVersion {
00903 uint8_t m_major;
00904 uint8_t m_minor;
00905 uint8_t m_revision;
00906 };
00907
00908
00909
00910
00911 #ifdef _MSC_VER
00912 #pragma pack(push, 2)
00913 #endif
00914
00915 struct CmtDeviceConfiguration {
00916 uint32_t m_masterDeviceId;
00917 uint16_t m_samplingPeriod;
00918 uint16_t m_outputSkipFactor;
00919 uint16_t m_syncinMode;
00920 uint16_t m_syncinSkipFactor;
00921 uint32_t m_syncinOffset;
00922 uint8_t m_date[8];
00923 uint8_t m_time[8];
00924 uint8_t m_reservedForHost[32];
00925 uint8_t m_reservedForClient[32];
00926 uint16_t m_numberOfDevices;
00927 struct _devInfo {
00928 uint32_t m_deviceId;
00929 uint16_t m_dataLength;
00930 uint16_t m_outputMode;
00931 uint32_t m_outputSettings;
00932 uint16_t m_currentScenario;
00933 uint8_t m_fwRevMajor;
00934 uint8_t m_fwRevMinor;
00935 uint8_t m_fwRevRevision;
00936 uint8_t m_filterType;
00937 uint8_t m_filterMajor;
00938 uint8_t m_filterMinor;
00939 } m_deviceInfo[CMT_MAX_DEVICES_PER_PORT];
00940
00941 #ifndef _CMT_DLL_IMPORT
00942 void readFromMessage(const void* message);
00943 #endif
00944 }
00945
00946 #ifdef _MSC_VER
00947 ;
00948 #pragma pack(pop)
00949 #else
00950 __attribute__((__packed__)) ;
00951 #endif
00952
00953
00954
00955
00956 typedef uint32_t CmtOutputMode;
00957
00958 typedef uint64_t CmtOutputSettings;
00959
00960
00961 struct CmtDataFormat {
00962 CmtOutputMode m_outputMode;
00963 CmtOutputSettings m_outputSettings;
00964
00965 #ifndef _CMT_DLL_IMPORT
00966
00967 CmtDataFormat( const CmtOutputMode mode = CMT_DEFAULT_OUTPUT_MODE,
00968 const CmtOutputSettings settings = CMT_DEFAULT_OUTPUT_SETTINGS)
00969 : m_outputMode(mode), m_outputSettings(settings) {}
00970 #endif
00971 };
00972
00973
00974 typedef uint16_t CmtMtTimeStamp;
00975
00976 #define CMT_MAX_FILENAME_LENGTH 512
00977
00978 #define CMT_DID_BROADCAST 0x80000000
00979 #define CMT_DID_MASTER 0
00980
00981
00982
00983 struct CmtSyncInSettings {
00984 uint16_t m_mode;
00985 uint16_t m_skipFactor;
00986 uint32_t m_offset;
00987
00988 #ifndef _CMT_DLL_IMPORT
00989
00990 CmtSyncInSettings( const uint16_t mode = 0,
00991 const uint16_t skip = 0,
00992 const uint32_t offset = 0)
00993 : m_mode(mode), m_skipFactor(skip), m_offset(offset) {}
00994 #endif
00995 };
00996
00997
00998 struct CmtSyncOutSettings {
00999 uint16_t m_mode;
01000 uint16_t m_skipFactor;
01001 uint32_t m_offset;
01002 uint32_t m_pulseWidth;
01003
01004 #ifndef _CMT_DLL_IMPORT
01005
01006 CmtSyncOutSettings( const uint16_t mode = 0,
01007 const uint16_t skip = 0,
01008 const uint32_t offset = 0,
01009 const uint32_t width = CMT_SYNCOUT_DEFAULT_PULSE_WIDTH) :
01010 m_mode(mode), m_skipFactor(skip), m_offset(offset),
01011 m_pulseWidth(width) {}
01012 #endif
01013 };
01014
01015
01016 struct CmtUtcTime
01017 {
01018 uint32_t m_nano;
01019 uint16_t m_year;
01020 uint8_t m_month;
01021 uint8_t m_day;
01022 uint8_t m_hour;
01023 uint8_t m_minute;
01024 uint8_t m_second;
01025 uint8_t m_valid;
01026 };
01027
01028
01029 struct CmtDeviceMode {
01030 CmtOutputMode m_outputMode;
01031 CmtOutputSettings m_outputSettings;
01032 uint16_t m_sampleFrequency;
01033
01034 #ifndef _CMT_DLL_IMPORT
01035
01036 CmtDeviceMode( const CmtOutputMode mode = CMT_DEFAULT_OUTPUT_MODE,
01037 const CmtOutputSettings settings = CMT_DEFAULT_OUTPUT_SETTINGS,
01038 const uint16_t frequency = CMT_DEFAULT_SAMPLE_FREQUENCY) :
01039 m_outputMode(mode), m_outputSettings(settings),
01040 m_sampleFrequency(frequency) {}
01041
01042
01043
01044
01045
01046
01047
01048
01049 void getPeriodAndSkipFactor(uint16_t& period, uint16_t& skip) const;
01050
01051
01052
01053
01054 double getRealSampleFrequency(void) const;
01055
01056
01057
01058
01059
01060 void setPeriodAndSkipFactor(uint16_t period, uint16_t skip);
01061
01062
01063 bool operator == (const CmtDeviceMode& dev) const;
01064 #endif
01065 };
01066
01067
01068 struct CmtDeviceMode2 {
01069 CmtOutputMode m_outputMode;
01070 CmtOutputSettings m_outputSettings;
01071 uint16_t m_period;
01072 uint16_t m_skip;
01073
01074 #ifndef _CMT_DLL_IMPORT
01075
01076 CmtDeviceMode2( const CmtOutputMode mode = CMT_DEFAULT_OUTPUT_MODE,
01077 const CmtOutputSettings settings = CMT_DEFAULT_OUTPUT_SETTINGS,
01078 const uint16_t period = CMT_DEFAULT_PERIOD,
01079 const uint16_t skip = CMT_DEFAULT_SKIP) :
01080 m_outputMode(mode), m_outputSettings(settings),
01081 m_period(period), m_skip(skip) {}
01082
01083
01084
01085
01086
01087 double getRealSampleFrequency(void) const;
01088
01089
01090
01091
01092 uint16_t getSampleFrequency(void) const;
01093
01094
01095
01096
01097
01098 void setSampleFrequency(uint16_t freq);
01099
01100
01101 bool operator == (const CmtDeviceMode2& dev) const;
01102 #endif
01103 };
01104
01105 #define CMT_MAX_SCENARIOS_IN_MT 5
01106 #define CMT_MAX_SCENARIOS 254
01107
01108
01109 struct CmtScenario {
01110 uint8_t m_type;
01111 uint8_t m_version;
01112 char m_label[CMT_LEN_SCENARIOLABEL+1];
01113 char m_filterType;
01114 uint8_t m_filterMajor, m_filterMinor;
01115 };
01116
01117 enum CmtCallbackType {
01118 CMT_CALLBACK_LIST_TERMINATOR = -1,
01119
01120 CMT_CALLBACK_ONMEASUREMENTPREPARE,
01121 CMT_CALLBACK_ONMEASUREMENTSTART,
01122 CMT_CALLBACK_ONMEASUREMENTSTOP,
01123 CMT_CALLBACK_ONPOSTPROCESS,
01124 CMT_CALLBACK_ONBYTESRECEIVED,
01125 CMT_CALLBACK_ONMESSAGERECEIVED,
01126 CMT_CALLBACK_ONMESSAGESENT,
01127 CMT_CALLBACK_ONMISSINGSAMPLES,
01128 CMT_CALLBACK_ONWAKEUPRECEIVED,
01129 CMT_CALLBACK_ONINSTANCE,
01130
01131 CMT_CALLBACK_COUNT
01132 };
01133
01134 #define CmtCallbackSelector CmtCallbackType
01135
01136 enum CmtQueueMode {
01137 CMT_QM_FIFO = 0,
01138 CMT_QM_LAST = 1,
01139 CMT_QM_RAW = 2
01140 };
01141
01142 struct CmtBinaryData {
01143 int32_t m_size;
01144 uint8_t m_data[CMT_MAXMSGLEN];
01145 uint16_t m_portNr;
01146 };
01147
01148 typedef void (__cdecl * CmtCallbackFunction)(int32_t instance, int32_t callbackType, void* param, void* userParam);
01149
01150
01151 struct CmtPortInfo {
01152 uint32_t m_baudrate;
01153 uint32_t m_deviceId;
01154 uint16_t m_portNr;
01155 char m_portName[256];
01156 #ifdef __cplusplus
01157 # ifdef _WIN32
01158
01159 bool operator > (const CmtPortInfo& p) const { return m_portNr > p.m_portNr; }
01160
01161 bool operator < (const CmtPortInfo& p) const { return m_portNr < p.m_portNr; }
01162
01163 bool operator == (const CmtPortInfo& p) const { return m_portNr == p.m_portNr; }
01164
01165 bool operator == (const uint16_t port) const { return m_portNr == port; }
01166 # else // Linux
01167
01168 bool operator > (const CmtPortInfo& p) const { return strcmp(m_portName, p.m_portName) > 0; }
01169
01170 bool operator < (const CmtPortInfo& p) const { return strcmp(m_portName, p.m_portName) < 0; }
01171
01172 bool operator == (const CmtPortInfo& p) const { return strcmp(m_portName, p.m_portName) == 0; }
01173
01174 bool operator == (const uint16_t port) const { (void)port; return false; }
01175 # endif // ifdef _WIN32/Linux
01176 #endif
01177 };
01178
01179 struct CmtShortVector {
01180 uint16_t m_data[3];
01181 };
01182 struct CmtRawData {
01183 CmtShortVector m_acc,m_gyr,m_mag;
01184 uint16_t m_temp;
01185 };
01186 struct CmtGpsPvtData { uint16_t m_pressure;
01187 uint8_t m_pressureAge;
01188 uint32_t m_itow;
01189 int32_t m_latitude;
01190 int32_t m_longitude;
01191 int32_t m_height;
01192 int32_t m_veln;
01193 int32_t m_vele;
01194 int32_t m_veld;
01195 uint32_t m_hacc;
01196 uint32_t m_vacc;
01197 uint32_t m_sacc;
01198 uint8_t m_gpsAge;
01199 };
01200 #define CmtRawGpsData CmtGpsPvtData //!< obsolete, use CmtGpsPvtData instead
01201 struct CmtRawPressureData {
01202 uint16_t m_pressure;
01203 uint8_t m_pressureAge;
01204 };
01205 struct CmtAnalogInData
01206 {
01207 uint16_t m_data;
01208 };
01209 struct CmtVector {
01210 double m_data[3];
01211 };
01212 struct CmtCalData {
01213 CmtVector m_acc,m_gyr,m_mag;
01214 };
01215 struct CmtQuat {
01216 double m_data[4];
01217 };
01218 struct CmtEuler {
01219 double m_roll;
01220 double m_pitch;
01221 double m_yaw;
01222 };
01223 struct CmtMatrix {
01224 double m_data[3][3];
01225 };
01226
01227 #define CMT_MAX_SVINFO 16
01228 struct CmtGpsSatelliteInfo {
01229 uint8_t m_id;
01230 uint8_t m_navigationStatus;
01231 uint8_t m_signalQuality;
01232 uint8_t m_signalStrength;
01233 };
01234 struct CmtGpsStatus {
01235 CmtGpsSatelliteInfo m_svInfo[CMT_MAX_SVINFO];
01236 };
01237
01238 typedef uint64_t CmtTimeStamp;
01239
01240 #define CMT_AUTO_SAVE_FRAMES 5000
01241 #define CMT_FILE_LAST_FRAME 0xFFFFFFFF
01242
01243 #define CMT_BID_BROADCAST (const uint8_t)0x00
01244 #define CMT_BID_INVALID (const uint8_t)0xFE
01245 #define CMT_MID_REQEMTS (const uint8_t)0x90
01246 #define CMT_MID_EMTSDATA (const uint8_t)0x91
01247 #define CMT_EMTS_SIZE 1320
01248
01249 #define CMT_STATUSFLAG_SELFTEST 0x01
01250 #define CMT_STATUSFLAG_XKFVALID 0x02
01251 #define CMT_STATUSFLAG_GPSVALID 0x04
01252 #define CMT_STATUSFLAG_NOROTATION_MASK 0x18
01253 #define CMT_STATUSFLAG_NOROTATION 0x18
01254 #define CMT_STATUSFLAG_NOROTATION_ABORTED 0x10
01255 #define CMT_STATUSFLAG_NOROTATION_SAMPLES_REJECTED 0x08
01256
01257 #define CMT_MAX_VPORTNAME_LEN 32
01258
01259 #endif