Skip to content

Commit

Permalink
[ahrs] AllAhrsAligned check
Browse files Browse the repository at this point in the history
  • Loading branch information
dewagter committed Sep 2, 2015
1 parent 860f67a commit 2b67558
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Expand Up @@ -56,7 +56,7 @@ The goal of this flightplan is to have a safe, simple no-brainer flightplan for
<blocks>
<block name="Init">
<call fun="NavKillThrottle()"/>
<while cond="!GpsFixValid() || gps.pacc > 400 || !(ahrs.status == AHRS_RUNNING)"/>
<while cond="!GpsFixValid() || gps.pacc > 400 || !(ahrs_all_aligned())"/>
</block>
<block name="Geo init">
<while cond="LessThan(NavBlockTime(), 8)"/>
Expand Down
2 changes: 1 addition & 1 deletion sw/airborne/subsystems/ahrs.c
Expand Up @@ -61,7 +61,7 @@ void ahrs_register_impl(AhrsEnableOutput enable, AhrsIsAligned aligned)
for (i=0; i < AHRS_NB_IMPL; i++) {
if (ahrs_impls[i].enable == NULL) {
ahrs_impls[i].enable = enable;
ahrs_impls[i].enable = aligned;
ahrs_impls[i].aligned = aligned;
break;
}
}
Expand Down
7 changes: 6 additions & 1 deletion sw/airborne/subsystems/ahrs/ahrs_sim.c
Expand Up @@ -60,9 +60,14 @@ void update_ahrs_from_sim(void)

}

static bool_t ahrs_sim_is_aligned(void)
{
return TRUE;
}


void ahrs_sim_register(void)
{
// dummy, simple ocaml sim only supports one basic fake AHRS anyway
ahrs_register_impl(NULL);
ahrs_register_impl(NULL,ahrs_sim_is_aligned);
}

0 comments on commit 2b67558

Please sign in to comment.