Lesson 4: IMU Sensor¶
Goal / 目標¶
Read IMU (gyroscope + accelerometer) data and visualize via telemetry.
API / 使用するAPI¶
| Function | Description | Unit |
|---|---|---|
ws::gyro_x/y/z() |
Angular velocity | rad/s |
ws::accel_x/y/z() |
Linear acceleration | m/s^2 |
ws::telemetry_send(name, val) |
Send via WiFi | - |
Coordinate System / 座標系¶
Steps / 手順¶
sf lesson switch 4- Read and print gyro/accel values
- Tilt the drone by hand and observe changes
- Send values via telemetry:
sf log wifi - Expected: accel_z ≈ 9.81 m/s^2 when flat
Key Concepts / キーコンセプト¶
- BMI270 6-axis IMU (400Hz)
- NED (North-East-Down) coordinate system
- WiFi telemetry for real-time visualization