From 78164c97704adbe004938974854617b9f86f85d1 Mon Sep 17 00:00:00 2001 From: matlabbe Date: Wed, 14 Oct 2015 17:11:30 -0400 Subject: [PATCH] DbViewer: added ground angle and cluster size parameters for grid projection map --- guilib/src/DatabaseViewer.cpp | 18 +++++-- guilib/src/ui/DatabaseViewer.ui | 85 ++++++++++++++++++++++++++------- 2 files changed, 81 insertions(+), 22 deletions(-) diff --git a/guilib/src/DatabaseViewer.cpp b/guilib/src/DatabaseViewer.cpp index 90c175f9..572ea28b 100644 --- a/guilib/src/DatabaseViewer.cpp +++ b/guilib/src/DatabaseViewer.cpp @@ -236,6 +236,8 @@ DatabaseViewer::DatabaseViewer(QWidget * parent) : connect(ui_->doubleSpinBox_gridCellSize, SIGNAL(editingFinished()), this, SLOT(updateGrid())); connect(ui_->spinBox_projDecimation, SIGNAL(editingFinished()), this, SLOT(updateGrid())); connect(ui_->doubleSpinBox_projMaxDepth, SIGNAL(editingFinished()), this, SLOT(updateGrid())); + connect(ui_->doubleSpinBox_projMaxAngle, SIGNAL(editingFinished()), this, SLOT(updateGrid())); + connect(ui_->spinBox_projClusterSize, SIGNAL(editingFinished()), this, SLOT(updateGrid())); connect(ui_->spinBox_stereo_flowIterations, SIGNAL(valueChanged(int)), this, SLOT(updateStereo())); connect(ui_->spinBox_stereo_flowMaxLevel, SIGNAL(valueChanged(int)), this, SLOT(updateStereo())); @@ -275,6 +277,8 @@ DatabaseViewer::DatabaseViewer(QWidget * parent) : connect(ui_->doubleSpinBox_gridCellSize, SIGNAL(valueChanged(double)), this, SLOT(configModified())); connect(ui_->spinBox_projDecimation, SIGNAL(valueChanged(int)), this, SLOT(configModified())); connect(ui_->doubleSpinBox_projMaxDepth, SIGNAL(valueChanged(double)), this, SLOT(configModified())); + connect(ui_->doubleSpinBox_projMaxAngle, SIGNAL(valueChanged(double)), this, SLOT(configModified())); + connect(ui_->spinBox_projClusterSize, SIGNAL(valueChanged(int)), this, SLOT(configModified())); connect(ui_->groupBox_posefiltering, SIGNAL(clicked(bool)), this, SLOT(configModified())); connect(ui_->doubleSpinBox_posefilteringRadius, SIGNAL(valueChanged(double)), this, SLOT(configModified())); connect(ui_->doubleSpinBox_posefilteringAngle, SIGNAL(valueChanged(double)), this, SLOT(configModified())); @@ -399,6 +403,8 @@ void DatabaseViewer::readSettings() ui_->doubleSpinBox_gridCellSize->setValue(settings.value("gridCellSize", ui_->doubleSpinBox_gridCellSize->value()).toDouble()); ui_->spinBox_projDecimation->setValue(settings.value("projDecimation", ui_->spinBox_projDecimation->value()).toInt()); ui_->doubleSpinBox_projMaxDepth->setValue(settings.value("projMaxDepth", ui_->doubleSpinBox_projMaxDepth->value()).toDouble()); + ui_->doubleSpinBox_projMaxAngle->setValue(settings.value("projMaxAngle", ui_->doubleSpinBox_projMaxAngle->value()).toDouble()); + ui_->spinBox_projClusterSize->setValue(settings.value("projClusterSize", ui_->spinBox_projClusterSize->value()).toInt()); ui_->groupBox_posefiltering->setChecked(settings.value("poseFiltering", ui_->groupBox_posefiltering->isChecked()).toBool()); ui_->doubleSpinBox_posefilteringRadius->setValue(settings.value("poseFilteringRadius", ui_->doubleSpinBox_posefilteringRadius->value()).toDouble()); ui_->doubleSpinBox_posefilteringAngle->setValue(settings.value("poseFilteringAngle", ui_->doubleSpinBox_posefilteringAngle->value()).toDouble()); @@ -497,6 +503,8 @@ void DatabaseViewer::writeSettings() settings.setValue("gridCellSize", ui_->doubleSpinBox_gridCellSize->value()); settings.setValue("projDecimation", ui_->spinBox_projDecimation->value()); settings.setValue("projMaxDepth", ui_->doubleSpinBox_projMaxDepth->value()); + settings.setValue("projMaxAngle", ui_->doubleSpinBox_projMaxAngle->value()); + settings.setValue("projClusterSize", ui_->spinBox_projClusterSize->value()); settings.setValue("poseFiltering", ui_->groupBox_posefiltering->isChecked()); settings.setValue("poseFilteringRadius", ui_->doubleSpinBox_posefilteringRadius->value()); settings.setValue("poseFilteringAngle", ui_->doubleSpinBox_posefilteringAngle->value()); @@ -2712,8 +2720,8 @@ void DatabaseViewer::sliderIterationsValueChanged(int value) { UTimer timer; float cellSize = ui_->doubleSpinBox_gridCellSize->value(); - float groundNormalMaxAngle = M_PI_4; - int minClusterSize = 20; + float groundNormalMaxAngle = ui_->doubleSpinBox_projMaxAngle->value(); + int minClusterSize = ui_->spinBox_projClusterSize->value(); cv::Mat ground, obstacles; util3d::occupancy2DFromCloud3D( @@ -3016,9 +3024,11 @@ void DatabaseViewer::updateGraphView() void DatabaseViewer::updateGrid() { - if((sender() != ui_->spinBox_projDecimation && sender() != ui_->doubleSpinBox_projMaxDepth) || + if((sender() != ui_->spinBox_projDecimation && sender() != ui_->doubleSpinBox_projMaxDepth && sender()!=ui_->doubleSpinBox_projMaxAngle && sender()!=ui_->spinBox_projClusterSize) || (sender() == ui_->spinBox_projDecimation && ui_->groupBox_gridFromProjection->isChecked()) || - (sender() == ui_->doubleSpinBox_projMaxDepth && ui_->groupBox_gridFromProjection->isChecked())) + (sender() == ui_->doubleSpinBox_projMaxDepth && ui_->groupBox_gridFromProjection->isChecked()) || + (sender() == ui_->doubleSpinBox_projMaxAngle && ui_->groupBox_gridFromProjection->isChecked()) || + (sender() == ui_->spinBox_projClusterSize && ui_->groupBox_gridFromProjection->isChecked())) { localMaps_.clear(); updateGraphView(); diff --git a/guilib/src/ui/DatabaseViewer.ui b/guilib/src/ui/DatabaseViewer.ui index 0cb1029a..6525930d 100644 --- a/guilib/src/ui/DatabaseViewer.ui +++ b/guilib/src/ui/DatabaseViewer.ui @@ -50,8 +50,8 @@ 0 0 - 154 - 184 + 166 + 173 @@ -236,8 +236,8 @@ 0 0 - 154 - 184 + 165 + 173 @@ -418,7 +418,7 @@ 0 0 1285 - 22 + 25 @@ -829,15 +829,15 @@ - 1 + 3 0 0 - 312 - 314 + 338 + 303 @@ -1056,8 +1056,8 @@ 0 0 - 366 - 391 + 351 + 380 @@ -1376,7 +1376,7 @@ 0 0 338 - 330 + 333 @@ -1613,9 +1613,9 @@ 0 - 0 - 248 - 343 + -100 + 338 + 377 @@ -1741,6 +1741,55 @@ + + + + Cluster size + + + + + + + Max ground angle + + + + + + + rad + + + 2 + + + 0.000000000000000 + + + 3.140000000000000 + + + 0.100000000000000 + + + 0.790000000000000 + + + + + + + 1 + + + 10000 + + + 20 + + + @@ -1822,8 +1871,8 @@ 0 0 - 201 - 126 + 351 + 176 @@ -1922,8 +1971,8 @@ 0 0 - 283 - 322 + 338 + 309