Plane: send heartbeat to AFS when calibrating sensors

This commit is contained in:
Andrew Tridgell 2014-09-24 11:03:35 +10:00
parent 5eee51b5a4
commit 4b01cee330
3 changed files with 15 additions and 0 deletions

View File

@ -280,6 +280,11 @@ static struct {
// should throttle be pass-thru in guided?
static bool guided_throttle_passthru;
// are we doing calibration? This is used to allow heartbeat to
// external failsafe boards during baro and airspeed calibration
static bool in_calibration;
////////////////////////////////////////////////////////////////////////////////
// GCS selection
////////////////////////////////////////////////////////////////////////////////

View File

@ -984,10 +984,12 @@ void GCS_MAVLINK::handleMessage(mavlink_message_t* msg)
packet.param2 == 1) {
startup_INS_ground(true);
} else if (packet.param3 == 1) {
in_calibration = true;
init_barometer();
if (airspeed.enabled()) {
zero_airspeed();
}
in_calibration = false;
}
if (packet.param4 == 1) {
trim_radio();

View File

@ -39,6 +39,14 @@ void failsafe_check(void)
if (in_failsafe && tnow - last_timestamp > 20000) {
last_timestamp = tnow;
#if OBC_FAILSAFE == ENABLED
if (in_calibration) {
// tell the failsafe system that we are calibrating
// sensors, so don't trigger failsafe
obc.heartbeat();
}
#endif
if (hal.rcin->num_channels() == 0) {
// we don't have any RC input to pass through
return;