2011-06-05 14:45:39 +00:00
|
|
|
/*
|
2014-08-11 17:00:55 +00:00
|
|
|
Copyright (c) 2010-2014, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
|
|
|
|
|
All rights reserved.
|
|
|
|
|
|
|
|
|
|
Redistribution and use in source and binary forms, with or without
|
|
|
|
|
modification, are permitted provided that the following conditions are met:
|
|
|
|
|
* Redistributions of source code must retain the above copyright
|
|
|
|
|
notice, this list of conditions and the following disclaimer.
|
|
|
|
|
* Redistributions in binary form must reproduce the above copyright
|
|
|
|
|
notice, this list of conditions and the following disclaimer in the
|
|
|
|
|
documentation and/or other materials provided with the distribution.
|
|
|
|
|
* Neither the name of the Universite de Sherbrooke nor the
|
|
|
|
|
names of its contributors may be used to endorse or promote products
|
|
|
|
|
derived from this software without specific prior written permission.
|
|
|
|
|
|
|
|
|
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
|
|
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
|
|
|
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
|
|
|
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
|
|
|
|
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
|
|
|
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
|
|
|
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
|
|
|
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
|
|
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
*/
|
2011-06-05 14:45:39 +00:00
|
|
|
|
|
|
|
|
#ifndef PREFERENCESDIALOG_H_
|
|
|
|
|
#define PREFERENCESDIALOG_H_
|
|
|
|
|
|
2013-12-11 00:12:44 +00:00
|
|
|
#include "rtabmap/gui/RtabmapGuiExp.h" // DLL export/import defines
|
2011-06-05 14:45:39 +00:00
|
|
|
|
|
|
|
|
#include <QtGui/QDialog>
|
|
|
|
|
#include <QtCore/QModelIndex>
|
2013-12-11 00:12:44 +00:00
|
|
|
#include <QtCore/QVector>
|
2012-12-11 18:05:05 +00:00
|
|
|
#include <set>
|
2011-06-05 14:45:39 +00:00
|
|
|
|
2013-12-11 00:12:44 +00:00
|
|
|
#include "rtabmap/core/Transform.h"
|
2011-06-05 14:45:39 +00:00
|
|
|
#include "rtabmap/core/Parameters.h"
|
|
|
|
|
|
|
|
|
|
class Ui_preferencesDialog;
|
|
|
|
|
class QAbstractItemModel;
|
|
|
|
|
class QAbstractButton;
|
|
|
|
|
class QStandardItemModel;
|
|
|
|
|
class QStandardItem;
|
|
|
|
|
class QFile;
|
|
|
|
|
class QGroupBox;
|
|
|
|
|
class QMainWindow;
|
|
|
|
|
class QLineEdit;
|
|
|
|
|
class QSlider;
|
2011-06-09 13:57:01 +00:00
|
|
|
class QProgressDialog;
|
2012-06-24 17:19:34 +00:00
|
|
|
class UPlotCurve;
|
2013-12-11 00:12:44 +00:00
|
|
|
class QStackedWidget;
|
|
|
|
|
class QCheckBox;
|
|
|
|
|
class QSpinBox;
|
|
|
|
|
class QDoubleSpinBox;
|
2011-06-05 14:45:39 +00:00
|
|
|
|
|
|
|
|
namespace rtabmap {
|
|
|
|
|
|
2013-12-11 00:12:44 +00:00
|
|
|
class OdometryThread;
|
2014-06-13 03:47:39 +00:00
|
|
|
class CameraThread;
|
2013-12-11 00:12:44 +00:00
|
|
|
class Signature;
|
|
|
|
|
class LoopClosureViewer;
|
|
|
|
|
|
|
|
|
|
class RTABMAPGUI_EXP PreferencesDialog : public QDialog
|
2011-06-05 14:45:39 +00:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
enum PanelFlag {
|
|
|
|
|
kPanelDummy = 0,
|
2013-12-11 00:12:44 +00:00
|
|
|
kPanelGeneral = 1,
|
|
|
|
|
kPanelCloudRendering = 2,
|
|
|
|
|
kPanelLogging = 4,
|
|
|
|
|
kPanelSource = 8,
|
|
|
|
|
kPanelAll = 15
|
2011-06-05 14:45:39 +00:00
|
|
|
};
|
|
|
|
|
// TODO, tried to change the name of PANEL_FLAGS to PanelFlags... but signals/slots errors appeared...
|
|
|
|
|
Q_DECLARE_FLAGS(PANEL_FLAGS, PanelFlag);
|
|
|
|
|
|
|
|
|
|
enum Src {
|
|
|
|
|
kSrcUndef,
|
|
|
|
|
kSrcUsbDevice,
|
|
|
|
|
kSrcImages,
|
2014-06-13 03:47:39 +00:00
|
|
|
kSrcVideo,
|
|
|
|
|
kSrcOpenNI_PCL,
|
|
|
|
|
kSrcFreenect,
|
|
|
|
|
kSrcOpenNI_CV,
|
2014-06-13 23:44:38 +00:00
|
|
|
kSrcOpenNI_CV_ASUS,
|
|
|
|
|
kSrcOpenNI2
|
2012-06-24 17:19:34 +00:00
|
|
|
};
|
|
|
|
|
|
2011-06-05 14:45:39 +00:00
|
|
|
public:
|
|
|
|
|
PreferencesDialog(QWidget * parent = 0);
|
|
|
|
|
virtual ~PreferencesDialog();
|
|
|
|
|
|
2013-12-11 00:12:44 +00:00
|
|
|
virtual QString getIniFilePath() const;
|
2011-06-09 12:51:13 +00:00
|
|
|
void init();
|
|
|
|
|
|
2011-06-05 14:45:39 +00:00
|
|
|
void saveWindowGeometry(const QString & windowName, const QWidget * window);
|
|
|
|
|
void loadWindowGeometry(const QString & windowName, QWidget * window);
|
|
|
|
|
void saveMainWindowState(const QMainWindow * mainWindow);
|
|
|
|
|
void loadMainWindowState(QMainWindow * mainWindow);
|
|
|
|
|
|
|
|
|
|
void saveCustomConfig(const QString & section, const QString & key, const QString & value);
|
|
|
|
|
QString loadCustomConfig(const QString & section, const QString & key);
|
|
|
|
|
|
|
|
|
|
rtabmap::ParametersMap getAllParameters();
|
|
|
|
|
|
|
|
|
|
//General panel
|
|
|
|
|
int getGeneralLoggerLevel() const;
|
|
|
|
|
int getGeneralLoggerEventLevel() const;
|
|
|
|
|
int getGeneralLoggerPauseLevel() const;
|
|
|
|
|
int getGeneralLoggerType() const;
|
|
|
|
|
bool getGeneralLoggerPrintTime() const;
|
|
|
|
|
bool isVerticalLayoutUsed() const;
|
|
|
|
|
bool isImageFlipped() const;
|
|
|
|
|
bool imageRejectedShown() const;
|
2011-06-10 14:04:06 +00:00
|
|
|
bool imageHighestHypShown() const;
|
2011-06-05 14:45:39 +00:00
|
|
|
bool beepOnPause() const;
|
|
|
|
|
int getKeypointsOpacity() const;
|
2014-06-06 18:06:49 +00:00
|
|
|
int getOdomQualityWarnThr() const;
|
2013-12-11 00:12:44 +00:00
|
|
|
|
2014-07-29 00:52:35 +00:00
|
|
|
bool isCloudMeshing() const;
|
|
|
|
|
bool isCloudsShown(int index) const; // 0=map, 1=odom
|
|
|
|
|
double getCloudVoxelSize(int index) const; // 0=map, 1=odom
|
|
|
|
|
int getCloudDecimation(int index) const; // 0=map, 1=odom
|
|
|
|
|
double getCloudMaxDepth(int index) const; // 0=map, 1=odom
|
2014-06-03 19:28:59 +00:00
|
|
|
double getCloudOpacity(int index) const; // 0=map, 1=odom
|
|
|
|
|
int getCloudPointSize(int index) const; // 0=map, 1=odom
|
2013-12-11 00:12:44 +00:00
|
|
|
|
2014-07-29 00:52:35 +00:00
|
|
|
bool isScansShown(int index) const; // 0=map, 1=odom
|
2014-06-03 19:28:59 +00:00
|
|
|
double getScanOpacity(int index) const; // 0=map, 1=odom
|
|
|
|
|
int getScanPointSize(int index) const; // 0=map, 1=odom
|
|
|
|
|
|
2014-07-29 00:52:35 +00:00
|
|
|
int getMeshNormalKSearch() const;
|
|
|
|
|
double getMeshGP3Radius() const;
|
|
|
|
|
bool getMeshSmoothing() const;
|
|
|
|
|
double getMeshSmoothingRadius() const;
|
2013-12-11 00:12:44 +00:00
|
|
|
|
2014-02-13 21:32:46 +00:00
|
|
|
bool isCloudFiltering() const;
|
|
|
|
|
double getCloudFilteringRadius() const;
|
|
|
|
|
double getCloudFilteringAngle() const;
|
|
|
|
|
|
2014-07-29 21:48:37 +00:00
|
|
|
bool getGridMapShown() const;
|
|
|
|
|
double getGridMapResolution() const;
|
|
|
|
|
bool getGridMapFillEmptySpace() const;
|
|
|
|
|
double getGridMapOpacity() const;
|
|
|
|
|
|
2013-12-11 00:12:44 +00:00
|
|
|
QString getWorkingDirectory() const;
|
2013-12-14 02:43:26 +00:00
|
|
|
QString getDatabasePath() const;
|
2011-06-05 14:45:39 +00:00
|
|
|
|
|
|
|
|
// source panel
|
2012-06-24 17:19:34 +00:00
|
|
|
double getGeneralInputRate() const;
|
|
|
|
|
bool isSourceImageUsed() const;
|
|
|
|
|
bool isSourceDatabaseUsed() const;
|
2013-12-11 00:12:44 +00:00
|
|
|
bool isSourceOpenniUsed() const;
|
2012-06-24 17:19:34 +00:00
|
|
|
int getSourceImageType() const;
|
|
|
|
|
QString getSourceImageTypeStr() const;
|
2011-06-05 14:45:39 +00:00
|
|
|
int getSourceWidth() const;
|
|
|
|
|
int getSourceHeight() const;
|
|
|
|
|
QString getSourceImagesPath() const; //Images group
|
|
|
|
|
QString getSourceImagesSuffix() const; //Images group
|
|
|
|
|
int getSourceImagesSuffixIndex() const; //Images group
|
|
|
|
|
int getSourceImagesStartPos() const; //Images group
|
|
|
|
|
bool getSourceImagesRefreshDir() const; //Images group
|
|
|
|
|
QString getSourceVideoPath() const; //Video group
|
|
|
|
|
int getSourceUsbDeviceId() const; //UsbDevice group
|
2012-06-24 17:19:34 +00:00
|
|
|
QString getSourceDatabasePath() const; //Database group
|
2013-12-11 00:12:44 +00:00
|
|
|
bool getSourceDatabaseOdometryIgnored() const; //Database group
|
2012-12-11 18:05:05 +00:00
|
|
|
int getSourceDatabaseStartPos() const; //Database group
|
2014-06-13 03:47:39 +00:00
|
|
|
Src getSourceRGBD() const; // Openni group
|
2013-12-11 00:12:44 +00:00
|
|
|
QString getSourceOpenniDevice() const; //Openni group
|
|
|
|
|
Transform getSourceOpenniLocalTransform() const; //Openni group
|
2014-07-26 04:36:00 +00:00
|
|
|
float getSourceOpenniFx() const; // Openni group
|
|
|
|
|
float getSourceOpenniFy() const; // Openni group
|
|
|
|
|
float getSourceOpenniCx() const; // Openni group
|
|
|
|
|
float getSourceOpenniCy() const; // Openni group
|
2012-12-11 18:05:05 +00:00
|
|
|
|
|
|
|
|
int getIgnoredDCComponents() const;
|
2011-06-05 14:45:39 +00:00
|
|
|
|
|
|
|
|
//
|
|
|
|
|
bool isImagesKept() const;
|
2012-03-03 01:46:30 +00:00
|
|
|
float getTimeLimit() const;
|
2013-12-11 00:12:44 +00:00
|
|
|
float getDetectionRate() const;
|
|
|
|
|
bool isSLAMMode() const;
|
2011-06-05 14:45:39 +00:00
|
|
|
|
|
|
|
|
//specific
|
2012-06-24 17:19:34 +00:00
|
|
|
bool isStatisticsPublished() const;
|
2011-06-05 14:45:39 +00:00
|
|
|
double getLoopThr() const;
|
|
|
|
|
double getVpThr() const;
|
2014-10-13 19:10:22 +00:00
|
|
|
int getOdomStrategy() const;
|
2011-06-05 14:45:39 +00:00
|
|
|
|
2012-06-24 17:19:34 +00:00
|
|
|
//
|
2013-12-11 00:12:44 +00:00
|
|
|
void setMonitoringState(bool monitoringState) {_monitoringState = monitoringState;}
|
2012-06-24 17:19:34 +00:00
|
|
|
|
2011-06-05 14:45:39 +00:00
|
|
|
signals:
|
|
|
|
|
void settingsChanged(PreferencesDialog::PANEL_FLAGS);
|
|
|
|
|
void settingsChanged(rtabmap::ParametersMap);
|
|
|
|
|
|
|
|
|
|
public slots:
|
2012-06-24 17:19:34 +00:00
|
|
|
void setInputRate(double value);
|
2013-12-11 00:12:44 +00:00
|
|
|
void setDetectionRate(double value);
|
2011-06-05 14:45:39 +00:00
|
|
|
void setHardThr(int value);
|
2012-03-03 01:46:30 +00:00
|
|
|
void setTimeLimit(float value);
|
2013-12-11 00:12:44 +00:00
|
|
|
void setSLAMMode(bool enabled);
|
2012-06-24 17:19:34 +00:00
|
|
|
void selectSourceImage(Src src = kSrcUndef);
|
|
|
|
|
void selectSourceDatabase(bool user = false);
|
2014-06-13 03:47:39 +00:00
|
|
|
void selectSourceRGBD(Src src = kSrcUndef);
|
2011-06-05 14:45:39 +00:00
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
void closeDialog ( QAbstractButton * button );
|
|
|
|
|
void resetApply ( QAbstractButton * button );
|
|
|
|
|
void resetSettings(int panelNumber);
|
|
|
|
|
void loadConfigFrom();
|
2014-01-22 19:49:28 +00:00
|
|
|
bool saveConfigTo();
|
|
|
|
|
void resetConfig();
|
2011-06-05 14:45:39 +00:00
|
|
|
void makeObsoleteGeneralPanel();
|
2013-12-11 00:12:44 +00:00
|
|
|
void makeObsoleteCloudRenderingPanel();
|
|
|
|
|
void makeObsoleteLoggingPanel();
|
2011-06-05 14:45:39 +00:00
|
|
|
void makeObsoleteSourcePanel();
|
|
|
|
|
void clicked(const QModelIndex &index);
|
|
|
|
|
void addParameter(int value);
|
2013-12-11 00:12:44 +00:00
|
|
|
void addParameter(bool value);
|
2011-06-05 14:45:39 +00:00
|
|
|
void addParameter(double value);
|
|
|
|
|
void addParameter(const QString & value);
|
2012-03-03 01:46:30 +00:00
|
|
|
void updatePredictionPlot();
|
2011-06-05 14:45:39 +00:00
|
|
|
void updateKpROI();
|
2013-12-11 00:12:44 +00:00
|
|
|
void changeDatabasePath();
|
2011-06-05 14:45:39 +00:00
|
|
|
void changeWorkingDirectory();
|
|
|
|
|
void changeDictionaryPath();
|
2011-06-09 13:57:01 +00:00
|
|
|
void readSettingsEnd();
|
2012-03-03 01:46:30 +00:00
|
|
|
void setupTreeView();
|
2012-06-24 17:19:34 +00:00
|
|
|
void updateBasicParameter();
|
2012-12-11 18:05:05 +00:00
|
|
|
void openDatabaseViewer();
|
2013-12-11 00:12:44 +00:00
|
|
|
void cleanOdometryTest();
|
2014-04-02 15:51:02 +00:00
|
|
|
void testOdometry();
|
2014-10-01 17:30:44 +00:00
|
|
|
void cleanRGBDCameraTest();
|
|
|
|
|
void testRGBDCamera();
|
2014-07-26 04:36:00 +00:00
|
|
|
void calibrate();
|
2014-07-30 17:42:58 +00:00
|
|
|
void resetCalibration();
|
2011-06-05 14:45:39 +00:00
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
virtual void showEvent ( QShowEvent * event );
|
2013-12-11 00:12:44 +00:00
|
|
|
virtual void closeEvent(QCloseEvent *event);
|
2011-06-05 14:45:39 +00:00
|
|
|
|
|
|
|
|
void setParameter(const std::string & key, const std::string & value);
|
|
|
|
|
|
|
|
|
|
virtual QString getParamMessage();
|
|
|
|
|
|
|
|
|
|
virtual void readSettings(const QString & filePath = QString());
|
|
|
|
|
virtual void readGuiSettings(const QString & filePath = QString());
|
|
|
|
|
virtual void readCameraSettings(const QString & filePath = QString());
|
2012-06-26 14:57:31 +00:00
|
|
|
virtual bool readCoreSettings(const QString & filePath = QString());
|
2011-06-05 14:45:39 +00:00
|
|
|
|
|
|
|
|
virtual void writeSettings(const QString & filePath = QString());
|
|
|
|
|
virtual void writeGuiSettings(const QString & filePath = QString());
|
|
|
|
|
virtual void writeCameraSettings(const QString & filePath = QString());
|
|
|
|
|
virtual void writeCoreSettings(const QString & filePath = QString());
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
bool validateForm();
|
|
|
|
|
void setupSignals();
|
|
|
|
|
void setupKpRoiPanel();
|
|
|
|
|
bool parseModel(QList<QGroupBox*> & boxes, QStandardItem * parentItem, int currentLevel, int & absoluteIndex);
|
2013-12-11 00:12:44 +00:00
|
|
|
void resetSettings(QGroupBox * groupBox);
|
2011-06-05 14:45:39 +00:00
|
|
|
void addParameter(const QObject * object, int value);
|
2013-12-11 00:12:44 +00:00
|
|
|
void addParameter(const QObject * object, bool value);
|
2011-06-05 14:45:39 +00:00
|
|
|
void addParameter(const QObject * object, double value);
|
|
|
|
|
void addParameter(const QObject * object, const QString & value);
|
2013-12-11 00:12:44 +00:00
|
|
|
void addParameters(const QObjectList & children);
|
|
|
|
|
void addParameters(const QStackedWidget * stackedWidget);
|
2011-06-05 14:45:39 +00:00
|
|
|
void addParameters(const QGroupBox * box);
|
|
|
|
|
QList<QGroupBox*> getGroupBoxes();
|
2011-06-09 13:57:01 +00:00
|
|
|
void readSettingsBegin();
|
2014-06-22 03:33:56 +00:00
|
|
|
void testOdometry(int type);
|
2011-06-05 14:45:39 +00:00
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
rtabmap::ParametersMap _parameters;
|
|
|
|
|
PANEL_FLAGS _obsoletePanels;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
Ui_preferencesDialog * _ui;
|
|
|
|
|
QStandardItemModel * _indexModel;
|
|
|
|
|
bool _initialized;
|
2013-12-11 00:12:44 +00:00
|
|
|
bool _monitoringState;
|
2011-06-05 14:45:39 +00:00
|
|
|
|
2011-06-09 13:57:01 +00:00
|
|
|
QProgressDialog * _progressDialog;
|
2013-12-11 00:12:44 +00:00
|
|
|
|
|
|
|
|
//Odometry test
|
2014-06-15 03:31:35 +00:00
|
|
|
CameraThread * _cameraThread;
|
2013-12-11 00:12:44 +00:00
|
|
|
OdometryThread * _odomThread;
|
|
|
|
|
|
|
|
|
|
QVector<QCheckBox*> _3dRenderingShowClouds;
|
|
|
|
|
QVector<QDoubleSpinBox*> _3dRenderingVoxelSize;
|
|
|
|
|
QVector<QSpinBox*> _3dRenderingDecimation;
|
|
|
|
|
QVector<QDoubleSpinBox*> _3dRenderingMaxDepth;
|
|
|
|
|
QVector<QDoubleSpinBox*> _3dRenderingOpacity;
|
|
|
|
|
QVector<QSpinBox*> _3dRenderingPtSize;
|
|
|
|
|
QVector<QCheckBox*> _3dRenderingShowScans;
|
|
|
|
|
QVector<QDoubleSpinBox*> _3dRenderingOpacityScan;
|
|
|
|
|
QVector<QSpinBox*> _3dRenderingPtSizeScan;
|
2011-06-05 14:45:39 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Q_DECLARE_OPERATORS_FOR_FLAGS(PreferencesDialog::PANEL_FLAGS)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif /* PREFERENCESDIALOG_H_ */
|