Browse Source

Fixed a small bug where param values in GPS RAW packets were not correctly updating the GCS state

QGC4.4
lm 14 years ago
parent
commit
7d68c7b605
  1. 6
      src/uas/UAS.cc
  2. 6
      src/ui/map3D/QGCGoogleEarthView.cc

6
src/uas/UAS.cc

@ -605,6 +605,9 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message) @@ -605,6 +605,9 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
{
emit globalPositionChanged(this, pos.lat, pos.lon, pos.alt, time);
emit valueChanged(uasId, "gps speed", "m/s", pos.v, time);
latitude = pos.lat;
longitude = pos.lon;
altitude = pos.alt;
positionLock = true;
// Check for NaN
@ -646,6 +649,9 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message) @@ -646,6 +649,9 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
{
emit globalPositionChanged(this, pos.lat/(double)1E7, pos.lon/(double)1E7, pos.alt/1000.0, time);
emit valueChanged(uasId, "gps speed", "m/s", pos.v, time);
latitude = pos.lat/(double)1E7;
longitude = pos.lon/(double)1E7;
altitude = pos.alt/1000.0;
positionLock = true;
// Check for NaN

6
src/ui/map3D/QGCGoogleEarthView.cc

@ -30,7 +30,7 @@ @@ -30,7 +30,7 @@
QGCGoogleEarthView::QGCGoogleEarthView(QWidget *parent) :
QWidget(parent),
updateTimer(new QTimer(this)),
refreshRateMs(40),
refreshRateMs(100),
mav(NULL),
followCamera(true),
trailEnabled(true),
@ -216,7 +216,7 @@ void QGCGoogleEarthView::updateGlobalPosition(UASInterface* uas, double lat, dou @@ -216,7 +216,7 @@ void QGCGoogleEarthView::updateGlobalPosition(UASInterface* uas, double lat, dou
Q_UNUSED(usec);
javaScript(QString("addTrailPosition(%1, %2, %3, %4);").arg(uas->getUASID()).arg(lat, 0, 'f', 18).arg(lon, 0, 'f', 18).arg(alt, 0, 'f', 15));
//qDebug() << QString("addTrailPosition(%1, %2, %3, %4);").arg(uas->getUASID()).arg(lat, 0, 'f', 15).arg(lon, 0, 'f', 15).arg(alt, 0, 'f', 15);
qDebug() << QString("addTrailPosition(%1, %2, %3, %4);").arg(uas->getUASID()).arg(lat, 0, 'f', 15).arg(lon, 0, 'f', 15).arg(alt, 0, 'f', 15);
}
void QGCGoogleEarthView::showTrail(bool state)
@ -457,6 +457,8 @@ void QGCGoogleEarthView::updateState() @@ -457,6 +457,8 @@ void QGCGoogleEarthView::updateState()
pitch = currMav->getPitch();
yaw = currMav->getYaw();
//qDebug() << "SETTING POSITION FOR" << uasId << lat << lon << alt << roll << pitch << yaw;
javaScript(QString("setAircraftPositionAttitude(%1, %2, %3, %4, %6, %7, %8);")
.arg(uasId)
.arg(lat, 0, 'f', 15)

Loading…
Cancel
Save