-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsensorsstructures.py
More file actions
107 lines (92 loc) · 2.8 KB
/
Copy pathsensorsstructures.py
File metadata and controls
107 lines (92 loc) · 2.8 KB
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
"""++
Copyright (c) Microsoft Corporation. All rights reserved.
Module Name:
SensorsStructures.h
Abstract:
Sensor structures header file
--"""
from . import cpreproc
from .minwindef import FLOAT, CStructure, POINTER, Union, INT, IArray
# The following flag is required to prevent structure redefinition with WpSensor.h
# we keep the #pragma above to benefit from the speed advantages this pragma brings.
if cpreproc.pragma_once("_SENSORS_STRUCTURES"):
class VEC3D(CStructure):
_fields_ = [
("X", FLOAT),
("Y", FLOAT),
("Z", FLOAT)
]
X: float
Y: float
Z: float
PVEC3D = POINTER(VEC3D)
class MATRIX3X3(Union):
class U(Union):
class S1(CStructure):
_fields_ = [
("A11", FLOAT),
("A12", FLOAT),
("A13", FLOAT),
("A21", FLOAT),
("A22", FLOAT),
("A23", FLOAT),
("A31", FLOAT),
("A32", FLOAT),
("A33", FLOAT)
]
class S2(CStructure):
_fields_ = [
("V1", VEC3D),
("V2", VEC3D),
("V3", VEC3D)
]
_fields_ = [
("s1", S1),
("s2", S2),
("M", FLOAT * 3 * 3)
]
_anonymous_ = ['s1', 's2']
_fields_ = [
("u", U)
]
_anonymous_ = ['u']
A11: float
A12: float
A13: float
A21: float
A22: float
A23: float
A31: float
A32: float
A33: float
V1: VEC3D
V2: VEC3D
V3: VEC3D
M: IArray[IArray[float]]
PMATRIX3X3 = POINTER(MATRIX3X3)
class QUATERNION(CStructure):
"""
Simple structure representing a 4 dimensional vector used for simple 3D rotation operation.
The rotation is done around the axis formed by the vector v= [X, Y, Z] and is of angle ?, and we have:
W=cos(theta/2)
|v|=sin(theta/2)
"""
_fields_ = [
("X", FLOAT), # x component of rotation axis vector * sin(theta/2) also i (imaginary) coefficient
("Y", FLOAT), # y component of rotation axis vector * sin(theta/2) also j coefficient
("Z", FLOAT), # z component of rotation axis vector * sin(theta/2) also k coefficient
("W", FLOAT) # real coefficient = cos(theta/2)
]
X: float
Y: float
Z: float
W: float
PQUATERNION = POINTER(QUATERNION)
AXIS = INT
if True:
AXIS_X = 0
AXIS_Y = 1
AXIS_Z = 2
AXIS_MAX = 3
PAXIS = POINTER(AXIS)
# _SENSORS_STRUCTURES