28 #ifndef RTABMAP_PREFERENCESDIALOG_H_
29 #define RTABMAP_PREFERENCESDIALOG_H_
31 #include "rtabmap/gui/rtabmap_gui_export.h"
34 #include <QtCore/QModelIndex>
35 #include <QtCore/QVector>
41 class Ui_preferencesDialog;
42 class QAbstractItemModel;
43 class QAbstractButton;
44 class QStandardItemModel;
51 class QProgressDialog;
61 class LoopClosureViewer;
65 class CalibrationDialog;
66 class CreateSimpleCalibrationDialog;
76 kPanelCloudRendering = 2,
79 kPanelCalibration = 16,
83 Q_DECLARE_FLAGS(PANEL_FLAGS, PanelFlag);
92 kSrcOpenNI_CV_ASUS = 3,
104 kSrcFlyCapture2 = 101,
105 kSrcStereoImages = 102,
106 kSrcStereoVideo = 103,
109 kSrcStereoTara = 106,
110 kSrcStereoRealSense2 = 107,
111 kSrcStereoMyntEye = 108,
112 kSrcStereoZedOC = 109,
113 kSrcStereoDepthAI = 110,
123 kSrcLidarVLP16 = 400,
130 virtual QString getIniFilePath()
const;
131 virtual QString getTmpIniFilePath()
const;
132 void init(
const QString & iniFilePath =
"");
133 void setCurrentPanelToSource();
134 virtual QString getDefaultWorkingDirectory()
const;
138 void saveWindowGeometry(
const QWidget * window);
139 void loadWindowGeometry(QWidget * window);
140 void saveMainWindowState(
const QMainWindow * mainWindow);
141 void loadMainWindowState(QMainWindow * mainWindow,
bool & maximized,
bool & statusBarShown);
142 void saveWidgetState(
const QWidget * widget);
143 void loadWidgetState(QWidget * widget);
145 void saveCustomConfig(
const QString & section,
const QString & key,
const QString & value);
146 QString loadCustomConfig(
const QString & section,
const QString & key);
149 std::string getParameter(
const std::string & key)
const;
150 void updateParameters(
const ParametersMap & parameters,
bool setOtherParametersToDefault =
false);
153 int getGeneralLoggerLevel()
const;
154 int getGeneralLoggerEventLevel()
const;
155 int getGeneralLoggerPauseLevel()
const;
156 int getGeneralLoggerType()
const;
157 bool getGeneralLoggerPrintTime()
const;
158 bool getGeneralLoggerPrintThreadId()
const;
159 std::vector<std::string> getGeneralLoggerThreads()
const;
160 bool isVerticalLayoutUsed()
const;
161 bool imageRejectedShown()
const;
162 bool imageHighestHypShown()
const;
163 bool beepOnPause()
const;
164 bool isTimeUsedInFigures()
const;
165 bool isCacheSavedInFigures()
const;
166 bool notifyWhenNewGlobalPathIsReceived()
const;
167 int getOdomQualityWarnThr()
const;
168 bool isOdomOnlyInliersShown()
const;
169 bool isPosteriorGraphView()
const;
170 bool isWordsCountGraphView()
const;
171 bool isLocalizationsCountGraphView()
const;
172 bool isRelocalizationColorOdomCacheGraphView()
const;
173 int getOdomRegistrationApproach()
const;
174 double getOdomF2MGravitySigma()
const;
175 bool isOdomDisabled()
const;
176 bool isOdomSensorAsGt()
const;
177 bool isGroundTruthAligned()
const;
179 bool isGraphsShown()
const;
180 bool isLabelsShown()
const;
181 bool isFramesShown()
const;
182 bool isLandmarksShown()
const;
183 double landmarkVisSize()
const;
184 bool isIMUGravityShown(
int index)
const;
185 double getIMUGravityLength(
int index)
const;
186 bool isIMUAccShown()
const;
187 bool isMarkerDetection()
const;
188 double getMarkerLength()
const;
189 double getVoxel()
const;
190 double getNoiseRadius()
const;
191 int getNoiseMinNeighbors()
const;
192 double getCeilingFilteringHeight()
const;
193 double getFloorFilteringHeight()
const;
194 int getNormalKSearch()
const;
195 double getNormalRadiusSearch()
const;
196 double getScanCeilingFilteringHeight()
const;
197 double getScanFloorFilteringHeight()
const;
198 int getScanNormalKSearch()
const;
199 double getScanNormalRadiusSearch()
const;
200 bool isCloudsShown(
int index)
const;
201 bool isOctomapUpdated()
const;
202 bool isOctomapShown()
const;
203 int getOctomapRenderingType()
const;
204 bool isOctomap2dGrid()
const;
205 int getOctomapTreeDepth()
const;
206 int getOctomapPointSize()
const;
207 int getCloudDecimation(
int index)
const;
208 double getCloudMaxDepth(
int index)
const;
209 double getCloudMinDepth(
int index)
const;
210 std::vector<float> getCloudRoiRatios(
int index)
const;
211 int getCloudColorScheme(
int index)
const;
212 double getCloudOpacity(
int index)
const;
213 int getCloudPointSize(
int index)
const;
215 bool isScansShown(
int index)
const;
216 int getDownsamplingStepScan(
int index)
const;
217 double getScanMaxRange(
int index)
const;
218 double getScanMinRange(
int index)
const;
219 double getCloudVoxelSizeScan(
int index)
const;
220 int getScanColorScheme(
int index)
const;
221 double getScanOpacity(
int index)
const;
222 int getScanPointSize(
int index)
const;
224 bool isFeaturesShown(
int index)
const;
225 bool isFrustumsShown(
int index)
const;
226 int getFeaturesPointSize(
int index)
const;
228 bool isCloudFiltering()
const;
229 bool isSubtractFiltering()
const;
230 double getCloudFilteringRadius()
const;
231 double getCloudFilteringAngle()
const;
232 int getSubtractFilteringMinPts()
const;
233 double getSubtractFilteringRadius()
const;
234 double getSubtractFilteringAngle()
const;
236 double getGridUIResolution()
const;
237 bool getGridMapShown()
const;
238 int getElevationMapShown()
const;
239 int getGridMapSensor()
const;
240 bool projMapFrame()
const;
241 double projMaxGroundAngle()
const;
242 double projMaxGroundHeight()
const;
243 int projMinClusterSize()
const;
244 double projMaxObstaclesHeight()
const;
245 bool projFlatObstaclesDetected()
const;
246 double getGridMapOpacity()
const;
248 bool isCloudMeshing()
const;
249 double getCloudMeshingAngle()
const;
250 bool isCloudMeshingQuad()
const;
251 bool isCloudMeshingTexture()
const;
252 int getCloudMeshingTriangleSize();
254 QString getWorkingDirectory()
const;
257 double getGeneralInputRate()
const;
258 bool isSourceMirroring()
const;
261 QString getSourceDriverStr()
const;
262 QString getSourceDevice()
const;
266 bool isSourceDatabaseStampsUsed()
const;
267 bool isSourceDatabaseStereoToDepth()
const;
268 bool isSourceRGBDColorOnly()
const;
269 int getIMUFilteringStrategy()
const;
270 bool getIMUFilteringBaseFrameConversion()
const;
271 bool isDepthFilteringAvailable()
const;
272 QString getSourceDistortionModel()
const;
273 bool isBilateralFiltering()
const;
274 double getBilateralSigmaS()
const;
275 double getBilateralSigmaR()
const;
276 int getSourceImageDecimation()
const;
277 int getSourceHistogramMethod()
const;
278 bool isSourceFeatureDetection()
const;
279 bool isSourceStereoDepthGenerated()
const;
280 bool isSourceStereoExposureCompensation()
const;
281 bool isSourceScanFromDepth()
const;
282 bool isSourceScanDeskewing()
const;
283 int getSourceScanDownsampleStep()
const;
284 double getSourceScanRangeMin()
const;
285 double getSourceScanRangeMax()
const;
286 double getSourceScanVoxelSize()
const;
287 int getSourceScanNormalsK()
const;
288 double getSourceScanNormalsRadius()
const;
289 double getSourceScanForceGroundNormalsUp()
const;
290 Transform getSourceLocalTransform()
const;
291 Transform getLaserLocalTransform()
const;
293 QString getIMUPath()
const;
294 int getIMURate()
const;
295 Camera * createCamera(
bool useRawImages =
false,
bool useColor =
true);
296 SensorCapture * createOdomSensor(
Transform & extrinsics,
double & timeOffset,
float & scaleFactor,
double & waitTime);
297 Lidar * createLidar();
299 int getIgnoredDCComponents()
const;
302 bool isImagesKept()
const;
303 bool isMissingCacheRepublished()
const;
304 bool isCloudsKept()
const;
305 float getTimeLimit()
const;
306 float getDetectionRate()
const;
307 bool isSLAMMode()
const;
308 bool isRGBDMode()
const;
309 int getKpMaxFeatures()
const;
310 bool isPriorIgnored()
const;
313 bool isStatisticsPublished()
const;
314 double getLoopThr()
const;
315 double getVpThr()
const;
316 double getSimThr()
const;
317 int getOdomStrategy()
const;
318 int getOdomBufferSize()
const;
319 QString getCameraInfoDir()
const;
325 void settingsChanged(PreferencesDialog::PANEL_FLAGS);
329 void setInputRate(
double value);
330 void setDetectionRate(
double value);
331 void setTimeLimit(
float value);
332 void setSLAMMode(
bool enabled);
333 void selectSourceDriver(Src src,
int variant = 0);
335 void calibrateSimple();
336 void calibrateOdomSensorExtrinsics();
340 void closeDialog ( QAbstractButton * button );
341 void resetApply ( QAbstractButton * button );
342 void resetSettings(
int panelNumber);
343 void loadConfigFrom();
347 void makeObsoleteGeneralPanel();
348 void makeObsoleteCloudRenderingPanel();
349 void makeObsoleteLoggingPanel();
350 void makeObsoleteSourcePanel();
351 void makeObsoleteCalibrationPanel();
352 void clicked(
const QModelIndex & current,
const QModelIndex & previous);
353 void addParameter(
int value);
354 void addParameter(
bool value);
355 void addParameter(
double value);
356 void addParameter(
const QString & value);
357 void updatePredictionPlot();
359 void updateStereoDisparityVisibility();
360 void updateFeatureMatchingVisibility();
361 void updateGlobalDescriptorVisibility();
362 void updateOdometryStackedIndex(
int index);
363 void useOdomFeatures();
364 void changeWorkingDirectory();
365 void changeDictionaryPath();
366 void changeOdometryORBSLAMVocabulary();
367 void changeOdometryOKVISConfigPath();
368 void changeOdometryVINSConfigPath();
369 void changeOdometryOpenVINSLeftMask();
370 void changeOdometryOpenVINSRightMask();
371 void changeIcpPMConfigPath();
372 void changeSuperPointModelPath();
373 void changePyMatcherPath();
374 void changePyMatcherModel();
375 void changePyDescriptorPath();
376 void changePyDetectorPath();
377 void readSettingsEnd();
378 void setupTreeView();
379 void updateBasicParameter();
380 void openDatabaseViewer();
381 void visualizeDistortionModel();
382 void selectSourceDatabase();
383 void selectCalibrationPath();
384 void selectOdomSensorCalibrationPath();
385 void selectSourceImagesStamps();
386 void selectSourceRGBDImagesPathRGB();
387 void selectSourceRGBDImagesPathDepth();
388 void selectSourceImagesPathScans();
389 void selectSourceImagesPathIMU();
390 void selectSourceImagesPathOdom();
391 void selectSourceImagesPathGt();
392 void selectSourceStereoImagesPathLeft();
393 void selectSourceStereoImagesPathRight();
394 void selectSourceImagesPath();
395 void selectSourceVideoPath();
396 void selectSourceStereoVideoPath();
397 void selectSourceStereoVideoPath2();
398 void selectSourceDistortionModel();
399 void selectSourceOniPath();
400 void selectSourceOni2Path();
401 void selectSourceMKVPath();
402 void selectSourceSvoPath();
403 void selectSourceRealsense2JsonPath();
404 void selectSourceDepthaiBlobPath();
405 void selectVlp16PcapPath();
406 void updateSourceGrpVisibility();
411 virtual void showEvent ( QShowEvent * event );
412 virtual void closeEvent(QCloseEvent *event);
414 virtual QString getParamMessage();
416 virtual void readGuiSettings(
const QString & filePath = QString());
417 virtual void readCameraSettings(
const QString & filePath = QString());
418 virtual bool readCoreSettings(
const QString & filePath = QString());
420 virtual void writeGuiSettings(
const QString & filePath = QString())
const;
421 virtual void writeCameraSettings(
const QString & filePath = QString())
const;
422 virtual void writeCoreSettings(
const QString & filePath = QString())
const;
424 void setParameter(
const std::string & key,
const std::string & value);
427 void readSettings(
const QString & filePath = QString());
428 void writeSettings(
const QString & filePath = QString());
431 void setupKpRoiPanel();
432 bool parseModel(QList<QGroupBox*> & boxes, QStandardItem * parentItem,
int currentLevel,
int & absoluteIndex);
433 void resetSettings(QGroupBox * groupBox);
434 void loadPreset(
const std::string & presetHexHeader);
435 void addParameter(
const QObject *
object,
int value);
436 void addParameter(
const QObject *
object,
bool value);
437 void addParameter(
const QObject *
object,
double value);
438 void addParameter(
const QObject *
object,
const QString & value);
439 void addParameters(
const QObjectList & children);
440 void addParameters(
const QStackedWidget * stackedWidget,
int panel = -1);
441 void addParameters(
const QGroupBox * box);
442 QList<QGroupBox*> getGroupBoxes();
443 void readSettingsBegin();
444 Camera * createCamera(Src driver,
const QString &
device,
const QString & calibrationPath,
bool useRawImages,
bool useColor,
bool odomOnly,
bool odomSensorExtrinsicsCalib);
452 Ui_preferencesDialog *
_ui;
486 Q_DECLARE_OPERATORS_FOR_FLAGS(PreferencesDialog::PANEL_FLAGS)