Commit 4b34688a authored by Helen Oleynikova's avatar Helen Oleynikova

Fixed video transmission.

parent e63127ad
...@@ -1329,10 +1329,13 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message) ...@@ -1329,10 +1329,13 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
++imagePacketsArrived; ++imagePacketsArrived;
// emit signal if all packets arrived // emit signal if all packets arrived
// && seq >= imagePackets-1
if ((imagePacketsArrived >= imagePackets)) if ((imagePacketsArrived >= imagePackets))
{ {
// Restart statemachine // Restart statemachine
emit imageReady(this); emit imageReady(this);
//imagePacketsArrived = 0;
//imagePackets = 0;
//qDebug() << "imageReady emitted. all packets arrived"; //qDebug() << "imageReady emitted. all packets arrived";
} }
} }
...@@ -2142,11 +2145,16 @@ QImage UAS::getImage() ...@@ -2142,11 +2145,16 @@ QImage UAS::getImage()
if (!image.loadFromData(imageRecBuffer)) if (!image.loadFromData(imageRecBuffer))
{ {
qDebug() << __FILE__ << __LINE__ << "Loading data from image buffer failed!"; qDebug() << __FILE__ << __LINE__ << "Loading data from image buffer failed!";
//imagePacketsArrived = 0;
//imagePackets = 0;
return QImage();
} }
} }
// Restart statemachine // Restart statemachine
imagePacketsArrived = 0; imagePacketsArrived = 0;
//imageRecBuffer.clear(); imagePackets = 0;
imageRecBuffer.clear();
return image; return image;
} }
...@@ -3148,7 +3156,7 @@ void UAS::sendHilGroundTruth(quint64 time_us, float roll, float pitch, float yaw ...@@ -3148,7 +3156,7 @@ void UAS::sendHilGroundTruth(quint64 time_us, float roll, float pitch, float yaw
Q_UNUSED(xacc); Q_UNUSED(xacc);
Q_UNUSED(yacc); Q_UNUSED(yacc);
Q_UNUSED(zacc); Q_UNUSED(zacc);
// Emit attitude for cross-check // Emit attitude for cross-check
emit valueChanged(uasId, "roll sim", "rad", roll, getUnixTime()); emit valueChanged(uasId, "roll sim", "rad", roll, getUnixTime());
emit valueChanged(uasId, "pitch sim", "rad", pitch, getUnixTime()); emit valueChanged(uasId, "pitch sim", "rad", pitch, getUnixTime());
......
...@@ -119,7 +119,7 @@ HUD::HUD(int width, int height, QWidget* parent) ...@@ -119,7 +119,7 @@ HUD::HUD(int width, int height, QWidget* parent)
{ {
Q_UNUSED(width); Q_UNUSED(width);
Q_UNUSED(height); Q_UNUSED(height);
// Set auto fill to false // Set auto fill to false
setAutoFillBackground(false); setAutoFillBackground(false);
...@@ -1374,7 +1374,10 @@ void HUD::copyImage(UASInterface* uas) ...@@ -1374,7 +1374,10 @@ void HUD::copyImage(UASInterface* uas)
UAS* u = qobject_cast<UAS*>(uas); UAS* u = qobject_cast<UAS*>(uas);
if (u) if (u)
{ {
this->glImage = u->getImage(); QImage temp_im = u->getImage();
if (temp_im.byteCount() > 0) {
this->glImage = temp_im;//u->getImage();
}
// Save to directory if logging is enabled // Save to directory if logging is enabled
if (imageLoggingEnabled) if (imageLoggingEnabled)
......
Markdown is supported
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