mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-14 23:40:20 +08:00
Fixed GraphView re-scaled when ground truth is null. PreferencesDialog: fixed a bug where some parameters were wrongly modified by default values in the *.ui (blocking signals when setParameter() is called to avoid addParameter() to be called)
This commit is contained in:
@@ -574,6 +574,8 @@ void GraphViewer::updateGTGraph(const std::map<int, Transform> & poses)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(_gtNodeItems.size() || _gtLinkItems.size())
|
||||||
|
{
|
||||||
this->scene()->setSceneRect(this->scene()->itemsBoundingRect()); // Re-shrink the scene to it's bounding contents
|
this->scene()->setSceneRect(this->scene()->itemsBoundingRect()); // Re-shrink the scene to it's bounding contents
|
||||||
|
|
||||||
if(wasEmpty)
|
if(wasEmpty)
|
||||||
@@ -581,6 +583,7 @@ void GraphViewer::updateGTGraph(const std::map<int, Transform> & poses)
|
|||||||
QRectF rect = this->scene()->itemsBoundingRect();
|
QRectF rect = this->scene()->itemsBoundingRect();
|
||||||
this->fitInView(rect.adjusted(-rect.width()/2.0f, -rect.height()/2.0f, rect.width()/2.0f, rect.height()/2.0f), Qt::KeepAspectRatio);
|
this->fitInView(rect.adjusted(-rect.width()/2.0f, -rect.height()/2.0f, rect.width()/2.0f, rect.height()/2.0f), Qt::KeepAspectRatio);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
UDEBUG("_gtNodeItems=%d, _gtLinkItems=%d", _gtNodeItems.size(), _gtLinkItems.size());
|
UDEBUG("_gtNodeItems=%d, _gtLinkItems=%d", _gtNodeItems.size(), _gtLinkItems.size());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1735,8 +1735,15 @@ void PreferencesDialog::writeSettings(const QString & filePath)
|
|||||||
emit settingsChanged(_obsoletePanels);
|
emit settingsChanged(_obsoletePanels);
|
||||||
}
|
}
|
||||||
|
|
||||||
uInsert(_parameters, _modifiedParameters); // update cached parameters
|
for(ParametersMap::iterator iter = _modifiedParameters.begin(); iter!=_modifiedParameters.end(); ++iter)
|
||||||
|
{
|
||||||
|
if( _parameters.at(iter->first).compare(iter->second) != 0)
|
||||||
|
{
|
||||||
|
UINFO("modified %s = %s->%s", iter->first.c_str(), _parameters.at(iter->first).c_str(), iter->second.c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
uInsert(_parameters, _modifiedParameters); // update cached parameters
|
||||||
_modifiedParameters.clear();
|
_modifiedParameters.clear();
|
||||||
_obsoletePanels = kPanelDummy;
|
_obsoletePanels = kPanelDummy;
|
||||||
}
|
}
|
||||||
@@ -2683,6 +2690,7 @@ void PreferencesDialog::setParameter(const std::string & key, const std::string
|
|||||||
QWidget * obj = _ui->stackedWidget->findChild<QWidget*>(key.c_str());
|
QWidget * obj = _ui->stackedWidget->findChild<QWidget*>(key.c_str());
|
||||||
if(obj)
|
if(obj)
|
||||||
{
|
{
|
||||||
|
bool oldState = obj->blockSignals(true);
|
||||||
QSpinBox * spin = qobject_cast<QSpinBox *>(obj);
|
QSpinBox * spin = qobject_cast<QSpinBox *>(obj);
|
||||||
QDoubleSpinBox * doubleSpin = qobject_cast<QDoubleSpinBox *>(obj);
|
QDoubleSpinBox * doubleSpin = qobject_cast<QDoubleSpinBox *>(obj);
|
||||||
QComboBox * combo = qobject_cast<QComboBox *>(obj);
|
QComboBox * combo = qobject_cast<QComboBox *>(obj);
|
||||||
@@ -2790,6 +2798,7 @@ void PreferencesDialog::setParameter(const std::string & key, const std::string
|
|||||||
{
|
{
|
||||||
ULOGGER_WARN("QObject called %s can't be cast to a supported widget", key.c_str());
|
ULOGGER_WARN("QObject called %s can't be cast to a supported widget", key.c_str());
|
||||||
}
|
}
|
||||||
|
obj->blockSignals(oldState);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -2853,6 +2862,10 @@ void PreferencesDialog::addParameter(const QObject * object, int value)
|
|||||||
const QSpinBox * spinbox = qobject_cast<const QSpinBox*>(object);
|
const QSpinBox * spinbox = qobject_cast<const QSpinBox*>(object);
|
||||||
if(comboBox || spinbox)
|
if(comboBox || spinbox)
|
||||||
{
|
{
|
||||||
|
// Add parameter
|
||||||
|
UDEBUG("modify param %s=%s", object->objectName().toStdString().c_str(), uNumber2Str(value).c_str());
|
||||||
|
uInsert(_modifiedParameters, rtabmap::ParametersPair(object->objectName().toStdString(), QString::number(value).toStdString()));
|
||||||
|
|
||||||
if(comboBox)
|
if(comboBox)
|
||||||
{
|
{
|
||||||
// Add related panels to parameters
|
// Add related panels to parameters
|
||||||
@@ -2925,8 +2938,6 @@ void PreferencesDialog::addParameter(const QObject * object, int value)
|
|||||||
this->addParameters(_ui->groupBox_icp2);
|
this->addParameters(_ui->groupBox_icp2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Add parameter
|
|
||||||
uInsert(_modifiedParameters, rtabmap::ParametersPair(object->objectName().toStdString(), QString::number(value).toStdString()));
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -2950,6 +2961,7 @@ void PreferencesDialog::addParameter(const QObject * object, bool value)
|
|||||||
if(checkbox || radio || groupBox)
|
if(checkbox || radio || groupBox)
|
||||||
{
|
{
|
||||||
// Add parameter
|
// Add parameter
|
||||||
|
UDEBUG("modify param %s=%s", object->objectName().toStdString().c_str(), uBool2Str(value).c_str());
|
||||||
uInsert(_modifiedParameters, rtabmap::ParametersPair(object->objectName().toStdString(), uBool2Str(value)));
|
uInsert(_modifiedParameters, rtabmap::ParametersPair(object->objectName().toStdString(), uBool2Str(value)));
|
||||||
|
|
||||||
// RGBD panel
|
// RGBD panel
|
||||||
@@ -2966,16 +2978,6 @@ void PreferencesDialog::addParameter(const QObject * object, bool value)
|
|||||||
|
|
||||||
if(groupBox)
|
if(groupBox)
|
||||||
{
|
{
|
||||||
// RGBD panel
|
|
||||||
if(value && groupBox == _ui->groupBox_localDetection_time)
|
|
||||||
{
|
|
||||||
this->addParameters(_ui->groupBox_visualTransform2);
|
|
||||||
}
|
|
||||||
if(value && groupBox == _ui->groupBox_localDetection_space)
|
|
||||||
{
|
|
||||||
this->addParameters(_ui->groupBox_icp2);
|
|
||||||
}
|
|
||||||
|
|
||||||
this->addParameters(groupBox);
|
this->addParameters(groupBox);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2995,6 +2997,7 @@ void PreferencesDialog::addParameter(const QObject * object, double value)
|
|||||||
{
|
{
|
||||||
if(object)
|
if(object)
|
||||||
{
|
{
|
||||||
|
UDEBUG("modify param %s=%s", object->objectName().toStdString().c_str(), uBool2Str(value).c_str());
|
||||||
uInsert(_modifiedParameters, rtabmap::ParametersPair(object->objectName().toStdString(), QString::number(value).toStdString()));
|
uInsert(_modifiedParameters, rtabmap::ParametersPair(object->objectName().toStdString(), QString::number(value).toStdString()));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -3007,9 +3010,8 @@ void PreferencesDialog::addParameter(const QObject * object, const QString & val
|
|||||||
{
|
{
|
||||||
if(object)
|
if(object)
|
||||||
{
|
{
|
||||||
// Make sure the value is inserted, check if the same key already exists
|
UDEBUG("modify param %s=%s", object->objectName().toStdString().c_str(), value.toStdString().c_str());
|
||||||
uInsert(_modifiedParameters, rtabmap::ParametersPair(object->objectName().toStdString(), value.toStdString()));
|
uInsert(_modifiedParameters, rtabmap::ParametersPair(object->objectName().toStdString(), value.toStdString()));
|
||||||
//ULOGGER_DEBUG("PreferencesDialog::addParameter(object, QString) Added [\"%s\",\"%s\"]", object->objectName().toStdString().c_str(), QString::number(value).toStdString().c_str());
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user