mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 17:40:23 +08:00
Fixed compilation error with PCL < 1.7.2 (disabled graph frustums option)
This commit is contained in:
@@ -1247,6 +1247,10 @@ void CloudViewer::addOrUpdateFrustum(
|
||||
return;
|
||||
}
|
||||
|
||||
#if PCL_VERSION_COMPARE(<, 1, 7, 2)
|
||||
this->removeFrustum(id);
|
||||
#endif
|
||||
|
||||
if(!transform.isNull())
|
||||
{
|
||||
if(_frustums.find(id)==_frustums.end())
|
||||
@@ -1267,7 +1271,12 @@ void CloudViewer::addOrUpdateFrustum(
|
||||
c = color;
|
||||
}
|
||||
Transform opticalRotInv(0, -1, 0, 0, 0, 0, -1, 0, 1, 0, 0, 0);
|
||||
|
||||
#if PCL_VERSION_COMPARE(<, 1, 7, 2)
|
||||
Eigen::Affine3f t = (transform*localTransform*opticalRotInv).toEigen3f();
|
||||
#else
|
||||
Eigen::Affine3f t = (localTransform*opticalRotInv).toEigen3f();
|
||||
#endif
|
||||
for(int i=0; i<frustumSize; ++i)
|
||||
{
|
||||
frustumPoints[i].x = frustum_vertices[i*3]*scaleX;
|
||||
@@ -1288,10 +1297,12 @@ void CloudViewer::addOrUpdateFrustum(
|
||||
_visualizer->addPolylineFromPolygonMesh(mesh, id);
|
||||
_visualizer->setShapeRenderingProperties(pcl::visualization::PCL_VISUALIZER_COLOR, c.redF(), c.greenF(), c.blueF(), id);
|
||||
}
|
||||
#if PCL_VERSION_COMPARE(>=, 1, 7, 2)
|
||||
if(!this->updateFrustumPose(id, transform))
|
||||
{
|
||||
UERROR("Failed updating pose of frustum %s!?", id.c_str());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1303,6 +1314,7 @@ bool CloudViewer::updateFrustumPose(
|
||||
const std::string & id,
|
||||
const Transform & pose)
|
||||
{
|
||||
#if PCL_VERSION_COMPARE(>=, 1, 7, 2)
|
||||
QMap<std::string, Transform>::iterator iter=_frustums.find(id);
|
||||
if(iter != _frustums.end() && !pose.isNull())
|
||||
{
|
||||
@@ -1335,6 +1347,9 @@ bool CloudViewer::updateFrustumPose(
|
||||
|
||||
return true;
|
||||
}
|
||||
#else
|
||||
UERROR("updateFrustumPose() cannot be used with PCL<1.7.2. Use addOrUpdateFrustum() instead.");
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -259,6 +259,11 @@ PreferencesDialog::PreferencesDialog(QWidget * parent) :
|
||||
_ui->openni2_exposure->setEnabled(CameraOpenNI2::exposureGainAvailable());
|
||||
_ui->openni2_gain->setEnabled(CameraOpenNI2::exposureGainAvailable());
|
||||
|
||||
#if PCL_VERSION_COMPARE(<, 1, 7, 2)
|
||||
_ui->checkBox_showFrustums->setEnabled(false);
|
||||
_ui->checkBox_showFrustums->setChecked(false);
|
||||
#endif
|
||||
|
||||
// in case we change the ui, we should not forget to change stuff related to this parameter
|
||||
UASSERT(_ui->odom_registration->count() == 4);
|
||||
|
||||
@@ -3978,7 +3983,7 @@ bool PreferencesDialog::isGraphsShown() const
|
||||
}
|
||||
bool PreferencesDialog::isFrustumsShown() const
|
||||
{
|
||||
return _ui->checkBox_showFrustums->isChecked();
|
||||
return _ui->checkBox_showFrustums->isEnabled() && _ui->checkBox_showFrustums->isChecked();
|
||||
}
|
||||
bool PreferencesDialog::isLabelsShown() const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user