|
20 | 20 | #include <math.h> |
21 | 21 | #include <stdint.h> |
22 | 22 |
|
| 23 | +/// @struct sfe_otos_pose2d_t |
23 | 24 | /// @brief 2D pose structure, including x and y coordinates and heading angle |
24 | 25 | /// @note Although pose is traditionally used for position and orientation, this |
25 | 26 | /// structure is also used for velocity and accleration by the OTOS driver |
26 | 27 | typedef struct |
27 | 28 | { |
| 29 | + /// @brief X value |
28 | 30 | float x; |
| 31 | + |
| 32 | + /// @brief Y value |
29 | 33 | float y; |
| 34 | + |
| 35 | + /// @brief Heading value |
30 | 36 | float h; |
31 | 37 | } sfe_otos_pose2d_t; |
32 | 38 |
|
33 | | -/// @brief Enumerations for the linear units |
| 39 | +/// @enum sfe_otos_linear_unit_t |
| 40 | +/// @brief Enumerations for linear units used by the OTOS driver |
34 | 41 | typedef enum |
35 | 42 | { |
| 43 | + /// @brief Meters |
36 | 44 | kSfeOtosLinearUnitMeters = 0, |
| 45 | + |
| 46 | + /// @brief Inches (default) |
37 | 47 | kSfeOtosLinearUnitInches = 1 |
38 | 48 | } sfe_otos_linear_unit_t; |
39 | 49 |
|
40 | | -/// @brief Enumerations for the angular units |
| 50 | +/// @enum sfe_otos_angular_unit_t |
| 51 | +/// @brief Enumerations for angular units used by the OTOS driver |
41 | 52 | typedef enum |
42 | 53 | { |
| 54 | + /// @brief Radians |
43 | 55 | kSfeOtosAngularUnitRadians = 0, |
| 56 | + |
| 57 | + /// @brief Degrees (default) |
44 | 58 | kSfeOtosAngularUnitDegrees = 1 |
45 | 59 | } sfe_otos_angular_unit_t; |
46 | 60 |
|
| 61 | +/// @union sfe_otos_version_t |
47 | 62 | /// @brief Version register bit fields |
48 | 63 | typedef union { |
49 | 64 | struct |
50 | 65 | { |
| 66 | + /// @brief Minor version number |
51 | 67 | uint8_t minor : 4; |
| 68 | + |
| 69 | + /// @brief Major version number |
52 | 70 | uint8_t major : 4; |
53 | 71 | }; |
| 72 | + |
| 73 | + /// @brief Raw register value |
54 | 74 | uint8_t value; |
55 | 75 | } sfe_otos_version_t; |
56 | 76 |
|
| 77 | +/// @union sfe_otos_signal_process_config_t |
57 | 78 | /// @brief Signal process config register bit fields |
58 | 79 | typedef union { |
59 | 80 | struct |
60 | 81 | { |
| 82 | + /// @brief Whether to use the internal lookup table calibration for the |
| 83 | + /// optical sensor |
61 | 84 | uint8_t enLut : 1; |
| 85 | + |
| 86 | + /// @brief Whether to feed the accelerometer data to the Kalman filters |
62 | 87 | uint8_t enAcc : 1; |
| 88 | + |
| 89 | + /// @brief Whether to rotate the IMU and optical sensor data by the |
| 90 | + /// heading angle |
63 | 91 | uint8_t enRot : 1; |
| 92 | + |
| 93 | + /// @brief Whether to use the correct sensor variance in the Kalman |
| 94 | + /// filters, or use 0 varaince to effectively disable the filters |
64 | 95 | uint8_t enVar : 1; |
| 96 | + |
| 97 | + /// @brief Reserved bits, do not use |
65 | 98 | uint8_t reserved : 4; |
66 | 99 | }; |
| 100 | + |
| 101 | + /// @brief Raw register value |
67 | 102 | uint8_t value; |
68 | 103 | } sfe_otos_signal_process_config_t; |
69 | 104 |
|
| 105 | +/// @union sfe_otos_self_test_config_t |
70 | 106 | /// @brief Self test register bit fields |
71 | 107 | typedef union { |
72 | 108 | struct |
73 | 109 | { |
| 110 | + /// @brief Write 1 to start the self test |
74 | 111 | uint8_t start : 1; |
| 112 | + |
| 113 | + /// @brief Returns 1 while the self test is in progress |
75 | 114 | uint8_t inProgress : 1; |
| 115 | + |
| 116 | + /// @brief Returns 1 if the self test passed |
76 | 117 | uint8_t pass : 1; |
| 118 | + |
| 119 | + /// @brief Returns 1 if the self test failed |
77 | 120 | uint8_t fail : 1; |
| 121 | + |
| 122 | + /// @brief Reserved bits, do not use |
78 | 123 | uint8_t reserved : 4; |
79 | 124 | }; |
| 125 | + |
| 126 | + /// @brief Raw register value |
80 | 127 | uint8_t value; |
81 | 128 | } sfe_otos_self_test_config_t; |
82 | 129 |
|
| 130 | +/// @union sfe_otos_status_t |
83 | 131 | /// @brief Status register bit fields |
84 | 132 | typedef union { |
85 | 133 | struct |
86 | 134 | { |
| 135 | + /// @brief Returns 1 if the tilt angle threshold has been exceeded. |
| 136 | + /// While set, the accelerometer data is ignored |
87 | 137 | uint8_t warnTiltAngle : 1; |
| 138 | + |
| 139 | + /// @brief Returns 1 if the optical tracking is unreliable. While set, |
| 140 | + /// only the IMU data is used for tracking unless warnTiltAngle is set |
88 | 141 | uint8_t warnOpticalTracking : 1; |
| 142 | + |
| 143 | + /// @brief Reserved bits, do not use |
89 | 144 | uint8_t reserved : 4; |
| 145 | + |
| 146 | + /// @brief Returns 1 if the optical sensor has a fatal error |
90 | 147 | uint8_t errorPaa : 1; |
| 148 | + |
| 149 | + /// @brief Returns 1 if the IMU has a fatal error |
91 | 150 | uint8_t errorLsm : 1; |
92 | 151 | }; |
| 152 | + |
| 153 | + /// @brief Raw register value |
93 | 154 | uint8_t value; |
94 | 155 | } sfe_otos_status_t; |
95 | 156 |
|
|
0 commit comments