Browse Source

Merge pull request #6300 from DonLakeFlyer/GeoTagULog

GeoTag fixes
QGC4.4
Don Gagne 7 years ago committed by GitHub
parent
commit
4d339acec1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      src/AnalyzeView/GeoTagController.cc
  2. 12
      src/AnalyzeView/ULogParser.cc

5
src/AnalyzeView/GeoTagController.cc

@ -259,6 +259,11 @@ void GeoTagWorker::run(void) @@ -259,6 +259,11 @@ void GeoTagWorker::run(void)
int maxIndex = std::min(_imageIndices.count(), _triggerIndices.count());
maxIndex = std::min(maxIndex, _imageList.count());
for(int i = 0; i < maxIndex; i++) {
int imageIndex = _imageIndices[i];
if (imageIndex >= _imageList.count()) {
emit error(tr("Geotagging failed. Image requested not present."));
return;
}
QFile fileRead(_imageList.at(_imageIndices[i]).absoluteFilePath());
if (!fileRead.open(QIODevice::ReadOnly)) {
emit error(tr("Geotagging failed. Couldn't open an image."));

12
src/AnalyzeView/ULogParser.cc

@ -139,15 +139,10 @@ bool ULogParser::getTagsFromLog(QByteArray& log, QList<GeoTagWorker::cameraFeedb @@ -139,15 +139,10 @@ bool ULogParser::getTagsFromLog(QByteArray& log, QList<GeoTagWorker::cameraFeedb
case (int)ULogMessageType::DATA:
{
if (!geotagFound) {
qWarning() << "Could not detect geotag packets in ULog";
return false;
}
uint16_t msgID = -1;
memcpy(&msgID, log.data() + index + ULOG_MSG_HEADER_LEN, 2);
if(msgID == _cameraCaptureMsgID) {
if (geotagFound && msgID == _cameraCaptureMsgID) {
// Completely dynamic parsing, so that changing/reordering the message format will not break the parser
GeoTagWorker::cameraFeedbackPacket feedback;
@ -179,5 +174,10 @@ bool ULogParser::getTagsFromLog(QByteArray& log, QList<GeoTagWorker::cameraFeedb @@ -179,5 +174,10 @@ bool ULogParser::getTagsFromLog(QByteArray& log, QList<GeoTagWorker::cameraFeedb
}
if (cameraFeedback.count() == 0) {
qWarning() << "Could not detect camera_capture packets in ULog";
return false;
}
return true;
}

Loading…
Cancel
Save