From b409173aaec0bbc68f534c1f6dfb44ca86a54561 Mon Sep 17 00:00:00 2001 From: James Goppert Date: Thu, 20 Oct 2011 02:28:47 -0400 Subject: [PATCH] Corrected battery monitoring in apo. --- apo/ControllerQuad.h | 2 +- libraries/APO/AP_Autopilot.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apo/ControllerQuad.h b/apo/ControllerQuad.h index 466e9add86..59b1e9a6ea 100644 --- a/apo/ControllerQuad.h +++ b/apo/ControllerQuad.h @@ -127,7 +127,7 @@ public: _mode = MAV_MODE_FAILSAFE; _hal->gcs->sendText(SEVERITY_HIGH, PSTR("configure gcs to send heartbeat")); // if battery less than 5%, go to failsafe - } else if (_hal->batteryMonitor->getPercentage() < 5) { + } else if (_hal->batteryMonitor && _hal->batteryMonitor->getPercentage() < 5) { _mode = MAV_MODE_FAILSAFE; _hal->gcs->sendText(SEVERITY_HIGH, PSTR("recharge battery")); // manual/auto switch diff --git a/libraries/APO/AP_Autopilot.cpp b/libraries/APO/AP_Autopilot.cpp index dc1f246d0a..1c600eef44 100644 --- a/libraries/APO/AP_Autopilot.cpp +++ b/libraries/APO/AP_Autopilot.cpp @@ -211,10 +211,10 @@ void AP_Autopilot::callback2(void * data) { if (apo->getHal()->gcs) { // send messages apo->getHal()->gcs->sendMessage(MAVLINK_MSG_ID_GPS_RAW); - //apo->getHal()->gcs->sendMessage(MAVLINK_MSG_ID_RC_CHANNELS_SCALED); + apo->getHal()->gcs->sendMessage(MAVLINK_MSG_ID_RC_CHANNELS_SCALED); + apo->getHal()->gcs->sendMessage(MAVLINK_MSG_ID_RC_CHANNELS_RAW); //apo->getHal()->gcs->sendMessage(MAVLINK_MSG_ID_GLOBAL_POSITION); - //apo->getHal()->gcs->sendMessage(MAVLINK_MSG_ID_RC_CHANNELS_RAW); - //apo->getHal()->gcs->sendMessage(MAVLINK_MSG_ID_SCALED_IMU); + apo->getHal()->gcs->sendMessage(MAVLINK_MSG_ID_SCALED_IMU); } /*