You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The IMU (Inertial Measurement Unit) component provides sensor data related to motion and orientation of the craft. It interfaces with two sensors: the LIS2MDL magnetometer and the LSM6DSO accelerometer/gyroscope to provide acceleration, angular velocity, magnetic field, and temperature measurements.
4
4
5
5
## Usage Examples
6
-
Add usage examples here
6
+
7
+
The IMU component is designed to be scheduled periodically to collect sensor data and output telemetry. It operates as a passive component that responds to scheduler calls.
7
8
8
9
### Diagrams
9
-
Add diagrams here
10
+
11
+
```mermaid
12
+
sequenceDiagram
13
+
participant Scheduler
14
+
participant IMU
15
+
participant Telemetry
16
+
17
+
Scheduler->>IMU: run
18
+
IMU->>Telemetry: Output sensor data
19
+
```
10
20
11
21
### Typical Usage
12
-
And the typical usage of the component here
22
+
23
+
1. The component is instantiated and initialized during system startup
24
+
2. The scheduler calls the `run` port at regular intervals (configured at 12.5 Hz)
25
+
3. On each run call, the component:
26
+
- Fetches fresh sensor samples from both IMU sensors
27
+
- Converts sensor data to F Prime data structures
28
+
- Outputs telemetry for acceleration, angular velocity, magnetic field, and temperature
13
29
14
30
## Class Diagram
15
-
Add a class diagram here
31
+
32
+
```mermaid
33
+
classDiagram
34
+
namespace Components {
35
+
class ImuComponentBase {
36
+
<<Auto-generated>>
37
+
}
38
+
class Imu {
39
+
- lis2mdl: device*
40
+
- lsm6dso: device*
41
+
+ Imu(char* compName)
42
+
+ ~Imu()
43
+
- run_handler(FwIndexType portNum, U32 context)
44
+
- sensor_value_to_f64(sensor_value* val): F64
45
+
- get_acceleration(): Imu_Acceleration
46
+
- get_angular_velocity(): Imu_AngularVelocity
47
+
- get_magnetic_field(): Imu_MagneticField
48
+
- get_temperature(): F64
49
+
}
50
+
}
51
+
ImuComponentBase <|-- Imu : inherits
52
+
```
53
+
16
54
17
55
## Port Descriptions
18
-
| Name | Description |
19
-
|---|---|
20
-
|---|---|
56
+
| Name | Type | Description |
57
+
|---|---|---|
58
+
| run | sync input | Scheduler port that triggers sensor data collection and telemetry output |
59
+
| timeCaller | time get | Port for requesting current system time |
60
+
| tlmOut | telemetry | Port for sending telemetry data to downlink |
21
61
22
62
## Component States
23
-
Add component states in the chart below
24
63
| Name | Description |
25
64
|---|---|
26
-
|---|---|
65
+
| Initialized | Component has been constructed and both IMU sensors are ready |
66
+
| Running | Component is actively collecting sensor data when scheduled |
67
+
| Error | One or both sensors failed initialization (assertion failure) |
27
68
28
69
## Sequence Diagrams
29
70
Add sequence diagrams here
30
71
31
-
## Parameters
32
-
| Name | Description |
33
-
|---|---|
34
-
|---|---|
35
-
36
-
## Commands
37
-
| Name | Description |
38
-
|---|---|
39
-
|---|---|
40
-
41
-
## Events
42
-
| Name | Description |
43
-
|---|---|
44
-
|---|---|
45
-
46
72
## Telemetry
47
73
| Name | Description |
48
74
|---|---|
49
-
|---|---|
75
+
| Acceleration | Telemetry channel for acceleration in m/s^2 |
76
+
| AngularVelocity | Telemetry channel for angular velocity in rad/s |
77
+
| MagneticField | Telemetry channel for magnetic field in gauss |
78
+
| Temperature | Telemetry channel for temperature in degrees Celsius |
50
79
51
80
## Unit Tests
52
81
Add unit test descriptions in the chart below
@@ -58,9 +87,12 @@ Add unit test descriptions in the chart below
58
87
Add requirements in the chart below
59
88
| Name | Description | Validation |
60
89
|---|---|---|
61
-
|---|---|---|
90
+
| AccelerationTelemetry | The component shall provide acceleration telemetry in m/s^2 | Verify telemetry output matches expected values from sensor datasheet |
91
+
| AngularVelocityTelemetry | The component shall provide angular velocity telemetry in rad/s | Verify telemetry output matches expected values from sensor datasheet |
92
+
| MagneticFieldTelemetry | The component shall provide magnetic field telemetry in gauss | Verify telemetry output matches expected values from sensor datasheet |
93
+
| TemperatureTelemetry | The component shall provide temperature telemetry in degrees Celsius | Verify telemetry output matches expected values from sensor datasheet |
0 commit comments