-
Notifications
You must be signed in to change notification settings - Fork 0
/
datatype.go
124 lines (108 loc) · 2.83 KB
/
datatype.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
package xsens
// DataType represents an Xsens data type.
type DataType uint16
//go:generate stringer -type DataType -trimprefix DataType
// Data group: Temperature.
const (
DataTypeTemperature DataType = 0x0810
)
// Data group: Timestamp.
const (
DataTypeUTCTime DataType = 0x1010
DataTypePacketCounter DataType = 0x1020
DataTypeITOW DataType = 0x1030
DataTypeGPSAge DataType = 0x1040
DataTypePressureAge DataType = 0x1050
DataTypeSampleTimeFine DataType = 0x1060
DataTypeSampleTimeCoarse DataType = 0x1070
)
// Data group: Orientation.
const (
DataTypeQuaternion DataType = 0x2010
DataTypeRotationMatrix DataType = 0x2020
DataTypeEulerAngles DataType = 0x2030
)
// Data group: Pressure.
const (
DataTypeBaroPressure DataType = 0x3010
)
// Data group: Acceleration.
const (
DataTypeDeltaV DataType = 0x4010
DataTypeAcceleration DataType = 0x4020
DataTypeFreeAcceleration DataType = 0x4030
DataTypeAccelerationHR DataType = 0x4040
)
// Data group: Position.
const (
DataTypeAltitudeEllipsoid DataType = 0x5020
DataTypePositionECEF DataType = 0x5030
DataTypeLatLon DataType = 0x5040
)
// Data group: GNSS.
const (
DataTypeGNSSPVTData DataType = 0x7010
DataTypeGNSSSatInfo DataType = 0x7020
)
// Data group: Angular velocity.
const (
DataTypeRateOfTurn DataType = 0x8020
DataTypeDeltaQ DataType = 0x8030
DataTypeRateOfTurnHR DataType = 0x8040
)
// Data group: GPS.
const (
DataTypeGPSDOP DataType = 0x8830
DataTypeGPSSOL DataType = 0x8840
DataTypeGPSTimeUTC DataType = 0x8880
DataTypeGPSSVInfo DataType = 0x88a0
)
// Data group: Magnetic.
const (
DataTypeMagneticField DataType = 0xc020
)
// Data group: Velocity.
const (
DataTypeVelocityXYZ DataType = 0xd010
)
// Data group: Status.
const (
DataTypeStatusByte DataType = 0xe010
DataTypeStatusWord DataType = 0xe020
)
// HasPrecision returns true for data types which support configurable output precision.
func (d DataType) HasPrecision() bool {
switch d {
case
// temperature
DataTypeTemperature,
// orientation
DataTypeQuaternion, DataTypeRotationMatrix, DataTypeEulerAngles,
// acceleration
DataTypeDeltaV, DataTypeAcceleration, DataTypeFreeAcceleration, DataTypeAccelerationHR,
// position
DataTypeAltitudeEllipsoid, DataTypePositionECEF, DataTypeLatLon,
// angular velocity
DataTypeDeltaQ, DataTypeRateOfTurn, DataTypeRateOfTurnHR,
// velocity
DataTypeVelocityXYZ,
// magnetic
DataTypeMagneticField:
return true
default:
return false
}
}
// HasCoordinateSystem returns true for data types which support configurable coordinate system.
func (d DataType) HasCoordinateSystem() bool {
switch d {
case
// orientation
DataTypeQuaternion, DataTypeRotationMatrix, DataTypeEulerAngles,
// velocity
DataTypeVelocityXYZ:
return true
default:
return false
}
}