Browse Source

Plane: send heartbeat to AFS when calibrating sensors

master
Andrew Tridgell 11 years ago
parent
commit
4b01cee330
  1. 5
      ArduPlane/ArduPlane.pde
  2. 2
      ArduPlane/GCS_Mavlink.pde
  3. 8
      ArduPlane/failsafe.pde

5
ArduPlane/ArduPlane.pde

@ -280,6 +280,11 @@ static struct { @@ -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
////////////////////////////////////////////////////////////////////////////////

2
ArduPlane/GCS_Mavlink.pde

@ -984,10 +984,12 @@ void GCS_MAVLINK::handleMessage(mavlink_message_t* msg) @@ -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();

8
ArduPlane/failsafe.pde

@ -39,6 +39,14 @@ void failsafe_check(void) @@ -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;

Loading…
Cancel
Save