Added octomap ground is an obstacle option

This commit is contained in:
matlabbe
2016-07-16 10:57:59 -04:00
parent b4b7b6f455
commit f161609a24
4 changed files with 53 additions and 15 deletions
@@ -154,6 +154,7 @@ public:
bool isCloudsShown(int index) const; // 0=map, 1=odom
bool isOctomapShown() const;
int getOctomapTreeDepth() const;
bool isOctomapGroundAnObstacle() const;
int getCloudDecimation(int index) const; // 0=map, 1=odom
double getCloudMaxDepth(int index) const; // 0=map, 1=odom
double getCloudMinDepth(int index) const; // 0=map, 1=odom
+5
View File
@@ -2646,6 +2646,11 @@ void MainWindow::createAndAddProjectionMap(
groundCloud = util3d::transformPointCloud(groundCloud, tinv);
obstaclesCloud = util3d::transformPointCloud(obstaclesCloud, tinv);
}
if(_preferencesDialog->isOctomapGroundAnObstacle())
{
*obstaclesCloud += *groundCloud;
groundCloud->clear();
}
_octomap->addToCache(nodeId, groundCloud, obstaclesCloud);
}
#endif
+10 -1
View File
@@ -159,7 +159,8 @@ PreferencesDialog::PreferencesDialog(QWidget * parent) :
_ui->label_octomap->setEnabled(false);
_ui->spinBox_octomap_treeDepth->setEnabled(false);
_ui->label_octomap_treeDepth->setEnabled(false);
_ui->checkBox_octomap_groundObstacle->setEnabled(false);
_ui->label_octomap_groundObstacle->setEnabled(false);
#endif
#ifndef RTABMAP_NONFREE
@@ -390,6 +391,7 @@ PreferencesDialog::PreferencesDialog(QWidget * parent) :
connect(_ui->checkBox_octomap, SIGNAL(clicked(bool)), this, SLOT(makeObsoleteCloudRenderingPanel()));
connect(_ui->spinBox_octomap_treeDepth, SIGNAL(valueChanged(int)), this, SLOT(makeObsoleteCloudRenderingPanel()));
connect(_ui->checkBox_octomap_groundObstacle, SIGNAL(clicked(bool)), this, SLOT(makeObsoleteCloudRenderingPanel()));
connect(_ui->groupBox_organized, SIGNAL(clicked(bool)), this, SLOT(makeObsoleteCloudRenderingPanel()));
connect(_ui->doubleSpinBox_mesh_angleTolerance, SIGNAL(valueChanged(double)), this, SLOT(makeObsoleteCloudRenderingPanel()));
@@ -1228,6 +1230,7 @@ void PreferencesDialog::resetSettings(QGroupBox * groupBox)
_ui->checkBox_octomap->setChecked(false);
_ui->spinBox_octomap_treeDepth->setValue(16);
_ui->checkBox_octomap_groundObstacle->setChecked(true);
_ui->doubleSpinBox_mesh_angleTolerance->setValue(15.0);
#if PCL_VERSION_COMPARE(>=, 1, 7, 2)
@@ -1589,6 +1592,7 @@ void PreferencesDialog::readGuiSettings(const QString & filePath)
_ui->checkBox_octomap->setChecked(settings.value("octomap", _ui->checkBox_octomap->isChecked()).toBool());
_ui->spinBox_octomap_treeDepth->setValue(settings.value("octomap_depth", _ui->spinBox_octomap_treeDepth->value()).toInt());
_ui->checkBox_octomap_groundObstacle->setChecked(settings.value("octomap_ground_is_obstacle", _ui->checkBox_octomap_groundObstacle->isChecked()).toBool());
_ui->groupBox_organized->setChecked(settings.value("meshing", _ui->groupBox_organized->isChecked()).toBool());
_ui->doubleSpinBox_mesh_angleTolerance->setValue(settings.value("meshing_angle", _ui->doubleSpinBox_mesh_angleTolerance->value()).toDouble());
@@ -1999,6 +2003,7 @@ void PreferencesDialog::writeGuiSettings(const QString & filePath) const
settings.setValue("octomap", _ui->checkBox_octomap->isChecked());
settings.setValue("octomap_depth", _ui->spinBox_octomap_treeDepth->value());
settings.setValue("octomap_ground_is_obstacle", _ui->checkBox_octomap_groundObstacle->isChecked());
settings.setValue("meshing", _ui->groupBox_organized->isChecked());
settings.setValue("meshing_angle", _ui->doubleSpinBox_mesh_angleTolerance->value());
@@ -3663,6 +3668,10 @@ int PreferencesDialog::getOctomapTreeDepth() const
{
return _ui->spinBox_octomap_treeDepth->value();
}
bool PreferencesDialog::isOctomapGroundAnObstacle() const
{
return _ui->checkBox_octomap_groundObstacle->isChecked();
}
double PreferencesDialog::getMapVoxel() const
{
+37 -14
View File
@@ -63,7 +63,7 @@
<property name="geometry">
<rect>
<x>0</x>
<y>-464</y>
<y>-568</y>
<width>686</width>
<height>2023</height>
</rect>
@@ -785,6 +785,19 @@ Show a yellow background when the number of odometry inliers goes under this thr
</item>
<item>
<layout class="QGridLayout" name="gridLayout_67" columnstretch="0,1">
<item row="5" column="0">
<widget class="QDoubleSpinBox" name="doubleSpinBox_projMaxObstaclesHeight">
<property name="suffix">
<string> m</string>
</property>
<property name="decimals">
<number>2</number>
</property>
<property name="maximum">
<double>9999.000000000000000</double>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLabel" name="label_309">
<property name="text">
@@ -928,19 +941,6 @@ Show a yellow background when the number of odometry inliers goes under this thr
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QDoubleSpinBox" name="doubleSpinBox_projMaxObstaclesHeight">
<property name="suffix">
<string> m</string>
</property>
<property name="decimals">
<number>2</number>
</property>
<property name="maximum">
<double>9999.000000000000000</double>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QCheckBox" name="checkBox_octomap">
<property name="text">
@@ -990,6 +990,29 @@ Show a yellow background when the number of odometry inliers goes under this thr
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QLabel" name="label_octomap_groundObstacle">
<property name="text">
<string>Octomap: ground is an obstacle.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QCheckBox" name="checkBox_octomap_groundObstacle">
<property name="text">
<string/>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>