coloradocube / balloonsat

COTS balloonsat mission to test the RPi 4 with a battery UPS, a quad camarray, a GPS module, a RockBLOCK module, and a small number of Qwiic sensors
0 stars 5 forks source link

Detect motion vs rest with IMU #21

Closed ivogeorg closed 2 years ago

ivogeorg commented 2 years ago

Description

Having an IMU on board allows doing some nice automatic system administration. Mainly, we can detect whether we are moving (flying) or at rest (on the ground).

Requirements

  1. Log accelerometer (x-axis) data.
  2. Use a moving window to keep the last, say 10, values.
  3. With some tolerance for noise, detect motion from rest.
  4. Accept two callbacks is_in_flight and is_on_ground so other parts of the flight software can be notified when the two conditions are detected.