1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-20 10:54:14 +01:00

Fixed a rare issue with Heading becoming NaN and not checked by GCS (froze the GCS). Update op_dfu.cpp to reflect latest changes by PT_Dreamer on the CLI.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2268 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
edouard 2010-12-21 21:10:31 +00:00 committed by edouard
parent 195c811c90
commit 77f4fbe919
2 changed files with 4 additions and 2 deletions

View File

@ -256,6 +256,8 @@ void PFDGadgetWidget::updateAttitude(UAVObject *object1) {
// to it. That way you always get the "shorter difference" to turn in."
double fac = compassBandWidth/540;
headingTarget = yawField->getDouble()*(-fac);
if (headingTarget != headingTarget)
headingTarget = headingValue; // NaN checking.
if ((headingValue - headingTarget)/fac > 180) {
headingTarget += 360*fac;
} else if (((headingValue - headingTarget)/fac < -180)) {

View File

@ -248,9 +248,9 @@ bool DFUObject::UploadData(qint32 const & numberOfBytes, QByteArray & data)
// }
// qDebug()<<" Data0="<<(int)data[0]<<" Data0="<<(int)data[1]<<" Data0="<<(int)data[2]<<" Data0="<<(int)data[3]<<" buf6="<<(int)buf[6]<<" buf7="<<(int)buf[7]<<" buf8="<<(int)buf[8]<<" buf9="<<(int)buf[9];
//delay::msleep(send_delay);
if(StatusRequest()!=OP_DFU::uploading) return false;
//if(StatusRequest()!=OP_DFU::uploading) return false;
int result = sendData(buf, BUF_LEN);
//int result = hidHandle.send(0,buf, BUF_LEN, 5000);
// qDebug()<<"sent:"<<result;
if(result<1)
{