Commit 7d68c7b6 authored by lm's avatar lm
Browse files

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

parent 99c25b99
......@@ -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)
{
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
......
......@@ -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
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()
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)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment