diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 8b77a700..e81c7e7e 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -1425,6 +1425,7 @@ void MainWindow::update(const cv::Mat & image) //update likelihood plot + UDEBUG("Set likelihood score curve values (%d)", scores.size()); likelihoodCurve_->setData(scores, QMap()); QMap inlierScores; for(QMap::iterator iter=scores.begin(); iter!=scores.end(); ++iter) @@ -1444,6 +1445,7 @@ void MainWindow::update(const cv::Mat & image) } inlierScores.insert(iter.key(), maxValue); } + UDEBUG("Set inliers score curve values (%d)", inlierScores.size()); inliersCurve_->setData(inlierScores, QMap()); if(ui_->likelihoodPlot->isVisible()) { diff --git a/src/rtabmap/PdfPlot.cpp b/src/rtabmap/PdfPlot.cpp index fba1a7a8..57bd16b8 100644 --- a/src/rtabmap/PdfPlot.cpp +++ b/src/rtabmap/PdfPlot.cpp @@ -20,8 +20,7 @@ */ #include "PdfPlot.h" - -#define ULOGGER_DEBUG(A, ...) +#include "find_object/utilite/ULogger.h" namespace rtabmap { @@ -145,15 +144,14 @@ void PdfPlotCurve::setData(const QMap & dataMap, const QMap // update values QList::iterator iter = _items.begin(); - QMap::const_iterator j=weightsMap.begin(); - for(QMap::const_iterator i=dataMap.begin(); i!=dataMap.end(); ++i, ++j) + for(QMap::const_iterator i=dataMap.begin(); i!=dataMap.end(); ++i) { - ((PdfPlotItem*)*iter)->setLikelihood(i.key(), i.value(), j!=weightsMap.end()?j.value():-1); + UASSERT(iter!= _items.end()); + ((PdfPlotItem*)*iter)->setLikelihood(i.key(), i.value(), weightsMap.value(i.key(),-1)); //2 times... ++iter; ++iter; } - //reset minMax, this will force the plot to update the axes this->updateMinMax(); Q_EMIT dataChanged(this);