Skip to content

Commit

Permalink
sanitycheck.c: Add power-on grace period
Browse files Browse the repository at this point in the history
Introduce a delay after powering up the flight controller to prevent arming before flight/Modules/Attitude/attitude.c has completed it's warmup routine, so that gyro calibration will have a higher chance of obtaining sensible values.
  • Loading branch information
fxbisto authored Apr 3, 2019
1 parent 295b84b commit 850f4f2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions flight/Libraries/sanitycheck.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,10 @@ static int32_t check_stabilization_settings(int index, bool multirotor)
*/
static int32_t check_safe_to_arm()
{
// 8 Second grace period while gyrobias completes warmup
if (PIOS_Thread_Systime() < 8000) {
return SYSTEMALARMS_CONFIGERROR_UNSAFETOARM;
}
FlightStatusData flightStatus;
FlightStatusGet(&flightStatus);

Expand Down

0 comments on commit 850f4f2

Please sign in to comment.