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:
parent
195c811c90
commit
77f4fbe919
@ -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)) {
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user