0.14.3: exposed all gui widgets to public API. CloudViewer: fixed camera orientation reset

This commit is contained in:
matlabbe
2017-10-20 12:09:34 +02:00
parent b3149a2b55
commit e40a7d6681
47 changed files with 863 additions and 943 deletions

View File

@@ -0,0 +1,55 @@
/*
Copyright (c) 2010-2016, 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.
*/
#ifndef RTABMAP_ABOUTDIALOG_H_
#define RTABMAP_ABOUTDIALOG_H_
#include "rtabmap/gui/RtabmapGuiExp.h" // DLL export/import defines
#include <QDialog>
#include <QtCore/QUrl>
class Ui_aboutDialog;
namespace rtabmap {
class RTABMAPGUI_EXP AboutDialog : public QDialog
{
Q_OBJECT
public:
AboutDialog(QWidget * parent = 0);
virtual ~AboutDialog();
private:
Ui_aboutDialog * _ui;
};
}
#endif /* ABOUTDIALOG_H_ */

View File

@@ -25,8 +25,8 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef CALIBRATIONDIALOG_H_
#define CALIBRATIONDIALOG_H_
#ifndef RTABMAP_CALIBRATIONDIALOG_H_
#define RTABMAP_CALIBRATIONDIALOG_H_
#include "rtabmap/gui/RtabmapGuiExp.h" // DLL export/import defines

View File

@@ -25,8 +25,8 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef CAMERAVIEWER_H_
#define CAMERAVIEWER_H_
#ifndef RTABMAP_CAMERAVIEWER_H_
#define RTABMAP_CAMERAVIEWER_H_
#include "rtabmap/gui/RtabmapGuiExp.h" // DLL export/import defines

View File

@@ -25,8 +25,8 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef CLOUDVIEWER_H_
#define CLOUDVIEWER_H_
#ifndef RTABMAP_CLOUDVIEWER_H_
#define RTABMAP_CLOUDVIEWER_H_
#include "rtabmap/gui/RtabmapGuiExp.h" // DLL export/import defines

View File

@@ -25,8 +25,8 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef CONSOLEWIDGET_H_
#define CONSOLEWIDGET_H_
#ifndef RTABMAP_CONSOLEWIDGET_H_
#define RTABMAP_CONSOLEWIDGET_H_
#include "rtabmap/gui/RtabmapGuiExp.h" // DLL export/import defines

View File

@@ -0,0 +1,68 @@
/*
Copyright (c) 2010-2016, 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.
*/
#ifndef RTABMAP_CREATESIMPLECALIBRATIONDIALOG_H_
#define RTABMAP_CREATESIMPLECALIBRATIONDIALOG_H_
#include "rtabmap/gui/RtabmapGuiExp.h" // DLL export/import defines
#include <QDialog>
#include <QSettings>
class Ui_createSimpleCalibrationDialog;
namespace rtabmap {
class RTABMAPGUI_EXP CreateSimpleCalibrationDialog : public QDialog
{
Q_OBJECT
public:
CreateSimpleCalibrationDialog(
const QString & savingFolder = ".",
const QString & cameraName = "",
QWidget * parent = 0);
virtual ~CreateSimpleCalibrationDialog();
void setCameraInfoDir(const QString & folder) {savingFolder_ = folder;}
const QString & cameraName() const {return cameraName_;}
private slots:
void updateStereoView();
void updateSaveStatus();
void saveCalibration();
private:
Ui_createSimpleCalibrationDialog * ui_;
QString savingFolder_;
QString cameraName_;
};
}
#endif /* CREATESIMPLECALIBRATIONDIALOG_H_ */

View File

@@ -25,8 +25,8 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DATARECORDER_H_
#define DATARECORDER_H_
#ifndef RTABMAP_DATARECORDER_H_
#define RTABMAP_DATARECORDER_H_
#include "rtabmap/gui/RtabmapGuiExp.h" // DLL export/import defines

View File

@@ -25,8 +25,8 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DATABASEVIEWER_H_
#define DATABASEVIEWER_H_
#ifndef RTABMAP_DATABASEVIEWER_H_
#define RTABMAP_DATABASEVIEWER_H_
#include "rtabmap/gui/RtabmapGuiExp.h" // DLL export/import defines

View File

@@ -0,0 +1,86 @@
/*
Copyright (c) 2010-2016, 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.
*/
#ifndef RTABMAP_DEPTHCALIBRATIONDIALOG_H_
#define RTABMAP_DEPTHCALIBRATIONDIALOG_H_
#include "rtabmap/gui/RtabmapGuiExp.h" // DLL export/import defines
#include <QDialog>
#include <QMap>
#include <QtCore/QSettings>
#include <rtabmap/core/Signature.h>
#include <rtabmap/core/Parameters.h>
class Ui_DepthCalibrationDialog;
namespace clams {
class DiscreteDepthDistortionModel;
}
namespace rtabmap {
class ProgressDialog;
class RTABMAPGUI_EXP DepthCalibrationDialog : public QDialog
{
Q_OBJECT
public:
DepthCalibrationDialog(QWidget * parent = 0);
virtual ~DepthCalibrationDialog();
void saveSettings(QSettings & settings, const QString & group = "") const;
void loadSettings(QSettings & settings, const QString & group = "");
void calibrate(const std::map<int, Transform> & poses,
const QMap<int, Signature> & cachedSignatures,
const QString & workingDirectory,
const ParametersMap & parameters);
signals:
void configChanged();
public slots:
void restoreDefaults();
private slots:
void saveModel();
void cancel();
private:
Ui_DepthCalibrationDialog * _ui;
ProgressDialog * _progressDialog;
bool _canceled;
clams::DiscreteDepthDistortionModel * _model;
QString _workingDirectory;
cv::Size _imageSize;
};
} /* namespace rtabmap */
#endif /* GUILIB_SRC_DEPTHCALIBRATIONDIALOG_H_ */

View File

@@ -0,0 +1,90 @@
/*
Copyright (c) 2010-2016, 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.
*/
#ifndef RTABMAP_EDITDEPTHAREA_H
#define RTABMAP_EDITDEPTHAREA_H
#include "rtabmap/gui/RtabmapGuiExp.h" // DLL export/import defines
#include <QColor>
#include <QImage>
#include <QPoint>
#include <QWidget>
#include <opencv2/opencv.hpp>
class QMenu;
class QAction;
namespace rtabmap {
class RTABMAPGUI_EXP EditDepthArea : public QWidget
{
Q_OBJECT
public:
EditDepthArea(QWidget *parent = 0);
void setImage(const cv::Mat & depth, const cv::Mat & rgb = cv::Mat());
cv::Mat getModifiedImage() const;
bool isModified() const {return modified_;}
void setPenWidth(int newWidth);
int penWidth() const { return myPenWidth_; }
public slots:
void resetChanges();
protected:
virtual void mousePressEvent(QMouseEvent *event);
virtual void mouseMoveEvent(QMouseEvent *event);
virtual void mouseReleaseEvent(QMouseEvent *event);
virtual void paintEvent(QPaintEvent *event);
virtual void resizeEvent(QResizeEvent *event);
virtual void contextMenuEvent(QContextMenuEvent * e);
private:
void drawLineTo(const QPoint &endPoint);
void computeScaleOffsets(const QRect & targetRect, float & scale, float & offsetX, float & offsetY) const;
bool modified_;
bool scribbling_;
int myPenWidth_;
QImage imageRGB_;
QImage image_;
cv::Mat originalImage_;
QPoint lastPoint_;
QMenu * menu_;
QAction * showRGB_;
QAction * removeCluster_;
QAction * resetChanges_;
QAction * setPenWidth_;
};
}
#endif

View File

@@ -0,0 +1,73 @@
/*
Copyright (c) 2010-2016, 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.
*/
#ifndef RTABMAP_EXPORTBUNDLERDIALOG_H_
#define RTABMAP_EXPORTBUNDLERDIALOG_H_
#include "rtabmap/gui/RtabmapGuiExp.h" // DLL export/import defines
#include <QDialog>
#include <QSettings>
class Ui_ExportBundlerDialog;
namespace rtabmap {
class RTABMAPGUI_EXP ExportBundlerDialog : public QDialog
{
Q_OBJECT
public:
ExportBundlerDialog(QWidget * parent = 0);
virtual ~ExportBundlerDialog();
void saveSettings(QSettings & settings, const QString & group = "") const;
void loadSettings(QSettings & settings, const QString & group = "");
void setWorkingDirectory(const QString & path);
QString outputPath() const;
double maxLinearSpeed() const;
double maxAngularSpeed() const;
double laplacianThreshold() const;
signals:
void configChanged();
private slots:
void getPath();
void restoreDefaults();
private:
Ui_ExportBundlerDialog * _ui;
};
}
#endif /* EXPORTBUNDLERDIALOG_H_ */

View File

@@ -0,0 +1,141 @@
/*
Copyright (c) 2010-2016, 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.
*/
#ifndef RTABMAP_EXPORTCLOUDSDIALOG_H_
#define RTABMAP_EXPORTCLOUDSDIALOG_H_
#include "rtabmap/gui/RtabmapGuiExp.h" // DLL export/import defines
#include <QDialog>
#include <QMap>
#include <QtCore/QSettings>
#include <rtabmap/core/Signature.h>
#include <rtabmap/core/Parameters.h>
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
#include <pcl/PolygonMesh.h>
#include <pcl/TextureMesh.h>
#include <pcl/pcl_base.h>
class Ui_ExportCloudsDialog;
class QAbstractButton;
namespace rtabmap {
class ProgressDialog;
class GainCompensator;
class DBDriver;
class RTABMAPGUI_EXP ExportCloudsDialog : public QDialog
{
Q_OBJECT
public:
ExportCloudsDialog(QWidget *parent = 0);
virtual ~ExportCloudsDialog();
void saveSettings(QSettings & settings, const QString & group = "") const;
void loadSettings(QSettings & settings, const QString & group = "");
void setDBDriver(const DBDriver * dbDriver) {_dbDriver = dbDriver;}
void exportClouds(
const std::map<int, Transform> & poses,
const std::multimap<int, Link> & links,
const std::map<int, int> & mapIds,
const QMap<int, Signature> & cachedSignatures,
const std::map<int, std::pair<pcl::PointCloud<pcl::PointXYZRGB>::Ptr, pcl::IndicesPtr> > & cachedClouds,
const std::map<int, cv::Mat> & cachedScans,
const QString & workingDirectory,
const ParametersMap & parameters);
void viewClouds(
const std::map<int, Transform> & poses,
const std::multimap<int, Link> & links,
const std::map<int, int> & mapIds,
const QMap<int, Signature> & cachedSignatures,
const std::map<int, std::pair<pcl::PointCloud<pcl::PointXYZRGB>::Ptr, pcl::IndicesPtr> > & cachedClouds,
const std::map<int, cv::Mat> & cachedScans,
const QString & workingDirectory,
const ParametersMap & parameters);
static bool removeDirRecursively(const QString & dirName);
signals:
void configChanged();
public slots:
void restoreDefaults();
private slots:
void updateReconstructionFlavor();
void selectDistortionModel();
void updateMLSGrpVisibility();
void cancel();
private:
std::map<int, std::pair<pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr, pcl::IndicesPtr> > getClouds(
const std::map<int, Transform> & poses,
const QMap<int, Signature> & cachedSignatures,
const std::map<int, std::pair<pcl::PointCloud<pcl::PointXYZRGB>::Ptr, pcl::IndicesPtr> > & cachedClouds,
const std::map<int, cv::Mat> & cachedScans,
const ParametersMap & parameters,
bool & has2dScans) const;
bool getExportedClouds(
const std::map<int, Transform> & poses,
const std::multimap<int, Link> & links,
const std::map<int, int> & mapIds,
const QMap<int, Signature> & cachedSignatures,
const std::map<int, std::pair<pcl::PointCloud<pcl::PointXYZRGB>::Ptr, pcl::IndicesPtr> > & cachedClouds,
const std::map<int, cv::Mat> & cachedScans,
const QString & workingDirectory,
const ParametersMap & parameters,
std::map<int, pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr> & clouds,
std::map<int, pcl::PolygonMesh::Ptr> & meshes,
std::map<int, pcl::TextureMesh::Ptr> & textureMeshes,
std::vector<std::map<int, pcl::PointXY> > & textureVertexToPixels);
void saveClouds(const QString & workingDirectory, const std::map<int, Transform> & poses, const std::map<int, pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr> & clouds, bool binaryMode = true);
void saveMeshes(const QString & workingDirectory, const std::map<int, Transform> & poses, const std::map<int, pcl::PolygonMesh::Ptr> & meshes, bool binaryMode = true);
void saveTextureMeshes(const QString & workingDirectory, const std::map<int, Transform> & poses, std::map<int, pcl::TextureMesh::Ptr> & textureMeshes, const QMap<int, Signature> & cachedSignatures, const std::vector<std::map<int, pcl::PointXY> > & textureVertexToPixels);
void setSaveButton();
void setOkButton();
private:
Ui_ExportCloudsDialog * _ui;
ProgressDialog * _progressDialog;
QString _workingDirectory;
bool _canceled;
GainCompensator * _compensator;
const DBDriver * _dbDriver;
};
}
#endif /* EXPORTCLOUDSDIALOG_H_ */

View File

@@ -0,0 +1,75 @@
/*
Copyright (c) 2010-2016, 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.
*/
#ifndef RTABMAP_EXPORTDIALOG_H_
#define RTABMAP_EXPORTDIALOG_H_
#include "rtabmap/gui/RtabmapGuiExp.h" // DLL export/import defines
#include <QDialog>
#include <QSettings>
class Ui_ExportDialog;
namespace rtabmap {
class RTABMAPGUI_EXP ExportDialog : public QDialog
{
Q_OBJECT
public:
ExportDialog(QWidget * parent = 0);
virtual ~ExportDialog();
void saveSettings(QSettings & settings, const QString & group) const;
void loadSettings(QSettings & settings, const QString & group);
QString outputPath() const;
int framesIgnored() const;
double targetFramerate() const;
int sessionExported() const;
bool isRgbExported() const;
bool isDepthExported() const;
bool isDepth2dExported() const;
bool isOdomExported() const;
bool isUserDataExported() const;
signals:
void configChanged();
private slots:
void getPath();
void restoreDefaults();
private:
Ui_ExportDialog * _ui;
};
}
#endif /* EXPORTDIALOG_H_ */

View File

@@ -25,8 +25,8 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef GRAPHVIEWER_H_
#define GRAPHVIEWER_H_
#ifndef RTABMAP_GRAPHVIEWER_H_
#define RTABMAP_GRAPHVIEWER_H_
#include "rtabmap/gui/RtabmapGuiExp.h" // DLL export/import defines

View File

@@ -25,8 +25,8 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef IMAGEVIEW_H_
#define IMAGEVIEW_H_
#ifndef RTABMAP_IMAGEVIEW_H_
#define RTABMAP_IMAGEVIEW_H_
#include "rtabmap/gui/RtabmapGuiExp.h" // DLL export/import defines
@@ -63,6 +63,7 @@ public:
int getAlpha() const {return _alpha;}
bool isGraphicsViewMode() const;
bool isGraphicsViewScaled() const;
const QColor & getDefaultBackgroundColor() const;
const QColor & getBackgroundColor() const;
float viewScale() const;
@@ -73,6 +74,7 @@ public:
void setLinesShown(bool shown);
void setGraphicsViewMode(bool on);
void setGraphicsViewScaled(bool scaled);
void setDefaultBackgroundColor(const QColor & color);
void setBackgroundColor(const QColor & color);
void setFeatures(const std::multimap<int, cv::KeyPoint> & refWords, const cv::Mat & depth = cv::Mat(), const QColor & color = Qt::yellow);
@@ -112,6 +114,7 @@ private:
private:
QString _savedFileName;
int _alpha;
QColor _defaultBgColor;
QMenu * _menu;
QAction * _showImage;

View File

@@ -25,8 +25,8 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef KEYPOINTITEM_H_
#define KEYPOINTITEM_H_
#ifndef RTABMAP_KEYPOINTITEM_H_
#define RTABMAP_KEYPOINTITEM_H_
#include "rtabmap/gui/RtabmapGuiExp.h" // DLL export/import defines

View File

@@ -25,8 +25,8 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef LOOPCLOSUREVIEWER_H_
#define LOOPCLOSUREVIEWER_H_
#ifndef RTABMAP_LOOPCLOSUREVIEWER_H_
#define RTABMAP_LOOPCLOSUREVIEWER_H_
#include "rtabmap/gui/RtabmapGuiExp.h" // DLL export/import defines

View File

@@ -25,8 +25,8 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef MAINWINDOW_H_
#define MAINWINDOW_H_
#ifndef RTABMAP_MAINWINDOW_H_
#define RTABMAP_MAINWINDOW_H_
#include "rtabmap/gui/RtabmapGuiExp.h" // DLL export/import defines
@@ -96,7 +96,7 @@ public:
* @param prefDialog If NULL, a default dialog is created. This
* dialog is automatically destroyed with the MainWindow.
*/
MainWindow(PreferencesDialog * prefDialog = 0, QWidget * parent = 0);
MainWindow(PreferencesDialog * prefDialog = 0, QWidget * parent = 0, bool showSplashScreen = true);
virtual ~MainWindow();
QString getWorkingDirectory() const;
@@ -106,8 +106,10 @@ public:
bool isProcessingStatistics() const {return _processingStatistics;}
bool isProcessingOdometry() const {return _processingOdometry;}
bool isDatabaseUpdated() const { return _databaseUpdated; }
public slots:
void processStats(const rtabmap::Statistics & stat);
virtual void processStats(const rtabmap::Statistics & stat);
void updateCacheFromDatabase(const QString & path);
void openDatabase(const QString & path);
void updateParameters(const rtabmap::ParametersMap & parameters);
@@ -121,19 +123,31 @@ protected:
virtual void keyPressEvent(QKeyEvent *event);
virtual bool eventFilter(QObject *obj, QEvent *event);
private slots:
void changeState(MainWindow::State state);
protected slots:
virtual void changeState(MainWindow::State state);
virtual void newDatabase();
virtual void openDatabase();
virtual bool closeDatabase();
virtual void startDetection();
virtual void pauseDetection();
virtual void stopDetection();
virtual void saveConfigGUI();
virtual void downloadAllClouds();
virtual void downloadPoseGraph();
virtual void clearTheCache();
virtual void openHelp();
virtual void openPreferences();
virtual void openPreferencesSource();
virtual void setDefaultViews();
virtual void resetOdometry();
virtual void triggerNewMap();
virtual void deleteMemory();
protected slots:
void beep();
void cancelProgress();
void configGUIModified();
void saveConfigGUI();
void newDatabase();
void openDatabase();
bool closeDatabase();
void editDatabase();
void startDetection();
void pauseDetection();
void stopDetection();
void notifyNoMoreImages();
void printLoopClosureIds();
void generateGraphDOT();
@@ -146,7 +160,6 @@ private slots:
void exportOctomap();
void postProcessing();
void depthCalibration();
void deleteMemory();
void openWorkingDirectory();
void updateEditMenu();
void selectStream();
@@ -169,14 +182,7 @@ private slots:
void cancelGoal();
void label();
void updateCacheFromDatabase();
void downloadAllClouds();
void downloadPoseGraph();
void anchorCloudsToGroundTruth();
void clearTheCache();
void openHelp();
void openPreferences();
void openPreferencesSource();
void setDefaultViews();
void selectScreenCaptureFormat(bool checked);
void takeScreenshot();
void updateElapsedTime();
@@ -207,8 +213,6 @@ private slots:
void exportClouds();
void exportBundlerFormat();
void viewClouds();
void resetOdometry();
void triggerNewMap();
void dataRecorder();
void dataRecorderDestroyed();
void updateNodeVisibility(int, bool);
@@ -256,6 +260,33 @@ private:
void exportPoses(int format);
QString captureScreen(bool cacheInRAM = false);
protected:
Ui_mainWindow * ui() { return _ui; }
const State & state() const { return _state; }
const QMap<int, Signature> & cachedSignatures() const { return _cachedSignatures;}
const std::map<int, Transform> & currentPosesMap() const { return _currentPosesMap; } // <nodeId, pose>
const std::map<int, Transform> & currentGTPosesMap() const { return _currentGTPosesMap; } // <nodeId, pose>
const std::multimap<int, Link> & currentLinksMap() const { return _currentLinksMap; } // <nodeFromId, link>
const std::map<int, int> & currentMapIds() const { return _currentMapIds; } // <nodeId, mapId>
const std::map<int, std::string> & currentLabels() const { return _currentLabels; } // <nodeId, label>
const std::map<int, std::pair<pcl::PointCloud<pcl::PointXYZRGB>::Ptr, pcl::IndicesPtr> > & cachedClouds() const { return _cachedClouds; }
const std::map<int, cv::Mat> & createdScans() const { return _createdScans; }
const std::map<int, pcl::PointCloud<pcl::PointXYZRGB>::Ptr> & createdFeatures() const { return _createdFeatures; }
const rtabmap::OccupancyGrid * occupancyGrid() const { return _occupancyGrid; }
const rtabmap::OctoMap * octomap() const { return _octomap; }
rtabmap::ProgressDialog * progressDialog() { return _progressDialog; }
rtabmap::CloudViewer * cloudViewer() const { return _cloudViewer; }
rtabmap::LoopClosureViewer * loopClosureViewer() const { return _loopClosureViewer; }
void setCloudViewer(rtabmap::CloudViewer * cloudViewer);
void setLoopClosureViewer(rtabmap::LoopClosureViewer * loopClosureViewer);
void setNewDatabasePathOutput(const QString & newDatabasePathOutput) {_newDatabasePathOutput = newDatabasePathOutput;}
const QString & newDatabasePathOutput() const { return _newDatabasePathOutput; }
private:
Ui_mainWindow * _ui;
@@ -320,7 +351,7 @@ private:
PdfPlotCurve * _likelihoodCurve;
PdfPlotCurve * _rawLikelihoodCurve;
ProgressDialog * _initProgressDialog;
ProgressDialog * _progressDialog;
CloudViewer * _cloudViewer;
LoopClosureViewer * _loopClosureViewer;
@@ -341,4 +372,4 @@ private:
}
#endif /* MainWindow_H_ */
#endif /* RTABMAP_MainWindow_H_ */

View File

@@ -0,0 +1,69 @@
/*
Copyright (c) 2010-2016, 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.
*/
#ifndef RTABMAP_MAPVISIBILITYWIDGET_H_
#define RTABMAP_MAPVISIBILITYWIDGET_H_
#include "rtabmap/gui/RtabmapGuiExp.h" // DLL export/import defines
#include <QWidget>
#include <rtabmap/core/Transform.h>
#include <map>
namespace rtabmap {
class RTABMAPGUI_EXP MapVisibilityWidget : public QWidget {
Q_OBJECT;
public:
MapVisibilityWidget(QWidget * parent = 0);
virtual ~MapVisibilityWidget();
void setMap(const std::map<int, Transform> & poses, const std::map<int, bool> & mask);
std::map<int, Transform> getVisiblePoses() const;
void clear();
protected:
virtual void showEvent(QShowEvent * event);
private slots:
void signalVisibility();
void selectAll(bool);
private:
void updateCheckBoxes();
signals:
void visibilityChanged(int id, bool visible);
private:
std::map<int, Transform> _poses;
std::map<int, bool> _mask;
};
} /* namespace rtabmap */
#endif /* MAPVISIBILITYWIDGET_H_ */

View File

@@ -25,8 +25,8 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef ODOMETRYVIEWER_H_
#define ODOMETRYVIEWER_H_
#ifndef RTABMAP_ODOMETRYVIEWER_H_
#define RTABMAP_ODOMETRYVIEWER_H_
#include "rtabmap/gui/RtabmapGuiExp.h" // DLL export/import defines

View File

@@ -0,0 +1,90 @@
/*
Copyright (c) 2010-2016, 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.
*/
//
// Original version from Find-Object: https://github.com/introlab/find-object
//
#ifndef RTABMAP_PARAMETERSTOOLBOX_H_
#define RTABMAP_PARAMETERSTOOLBOX_H_
#include "rtabmap/gui/RtabmapGuiExp.h" // DLL export/import defines
#include <rtabmap/core/Parameters.h>
#include <QWidget>
#include <QSet>
class QVBoxLayout;
class QStackedWidget;
class QComboBox;
namespace rtabmap {
class RTABMAPGUI_EXP ParametersToolBox: public QWidget
{
Q_OBJECT
public:
ParametersToolBox(QWidget *parent = 0);
virtual ~ParametersToolBox();
void setupUi(const ParametersMap & parameters);
QWidget * getParameterWidget(const QString & key);
void updateParameter(const std::string & key, const std::string & value);
const ParametersMap & getParameters() const {return parameters_;}
private:
void addParameter(QVBoxLayout * layout, const std::string & key, const std::string & value);
void addParameter(QVBoxLayout * layout, const QString & key, const QString & value);
void addParameter(QVBoxLayout * layout, const QString & key, const int & value);
void addParameter(QVBoxLayout * layout, const QString & key, const double & value);
void addParameter(QVBoxLayout * layout, const QString & key, const bool & value);
void addParameter(QVBoxLayout * layout, const QString & name, QWidget * widget);
Q_SIGNALS:
void parametersChanged(const QStringList & name);
private Q_SLOTS:
void changeParameter();
void changeParameter(const QString & value);
void changeParameter(const int & value);
void resetCurrentPage();
void resetAllPages();
private:
QStringList resetPage(int index);
void updateParametersVisibility();
private:
QComboBox * comboBox_;
QStackedWidget * stackedWidget_;
ParametersMap parameters_;
};
} // namespace find_object
#endif /* PARAMETERSTOOLBOX_H_ */

View File

@@ -25,8 +25,8 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef PDFPLOT_H_
#define PDFPLOT_H_
#ifndef RTABMAP_PDFPLOT_H_
#define RTABMAP_PDFPLOT_H_
#include "rtabmap/gui/RtabmapGuiExp.h" // DLL export/import defines

View File

@@ -0,0 +1,96 @@
/*
Copyright (c) 2010-2016, 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.
*/
#ifndef RTABMAP_POSTPROCESSINGDIALOG_H_
#define RTABMAP_POSTPROCESSINGDIALOG_H_
#include "rtabmap/gui/RtabmapGuiExp.h" // DLL export/import defines
#include <QDialog>
#include <QtCore/QSettings>
#include <rtabmap/core/Optimizer.h>
class Ui_PostProcessingDialog;
class QAbstractButton;
namespace rtabmap {
class RTABMAPGUI_EXP PostProcessingDialog : public QDialog
{
Q_OBJECT
public:
PostProcessingDialog(QWidget * parent = 0);
virtual ~PostProcessingDialog();
void saveSettings(QSettings & settings, const QString & group = "") const;
void loadSettings(QSettings & settings, const QString & group = "");
//getters
bool isDetectMoreLoopClosures() const;
double clusterRadius() const;
double clusterAngle() const;
int iterations() const;
bool isRefineNeighborLinks() const;
bool isRefineLoopClosureLinks() const;
bool isSBA() const;
int sbaIterations() const;
double sbaVariance() const;
Optimizer::Type sbaType() const;
//setters
void setDetectMoreLoopClosures(bool on);
void setClusterRadius(double radius);
void setClusterAngle(double angle);
void setIterations(int iterations);
void setRefineNeighborLinks(bool on);
void setRefineLoopClosureLinks(bool on);
void setSBA(bool on);
void setSBAIterations(int iterations);
void setSBAVariance(double variance);
void setSBAType(Optimizer::Type type);
signals:
void configChanged();
public slots:
void restoreDefaults();
private slots:
void updateVisibility();
void updateButtonBox();
private:
Ui_PostProcessingDialog * _ui;
};
}
#endif /* POSTPROCESSINGDIALOG_H_ */

View File

@@ -25,8 +25,8 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef PREFERENCESDIALOG_H_
#define PREFERENCESDIALOG_H_
#ifndef RTABMAP_PREFERENCESDIALOG_H_
#define RTABMAP_PREFERENCESDIALOG_H_
#include "rtabmap/gui/RtabmapGuiExp.h" // DLL export/import defines

View File

@@ -25,8 +25,8 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef PROGRESSDIALOG_H_
#define PROGRESSDIALOG_H_
#ifndef RTABMAP_PROGRESSDIALOG_H_
#define RTABMAP_PROGRESSDIALOG_H_
#include "rtabmap/gui/RtabmapGuiExp.h" // DLL export/import defines

View File

@@ -0,0 +1,103 @@
/*
Copyright (c) 2010-2017, 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.
*/
#ifndef RTABMAP_RECOVERYSTATE_H_
#define RTABMAP_RECOVERYSTATE_H_
#include "rtabmap/gui/ProgressDialog.h"
#include "rtabmap/core/ProgressState.h"
#include "rtabmap/utilite/UStl.h"
#include "rtabmap/utilite/UConversion.h"
#include <QApplication>
namespace rtabmap {
class RecoveryState : public QObject, public ProgressState
{
Q_OBJECT
public:
RecoveryState(ProgressDialog * dialog): dialog_(dialog)
{
connect(dialog_, SIGNAL(canceled()), this, SLOT(cancel()));
}
virtual ~RecoveryState() {}
virtual bool callback(const std::string & msg) const
{
if(!msg.empty())
{
QString msgQt = msg.c_str();
if(msgQt.contains("Processed"))
{
dialog_->incrementStep();
dialog_->appendText(msg.c_str());
}
else if(msgQt.contains("Found"))
{
std::list<std::string> strSplit = uSplitNumChar(msg);
if(strSplit.size() == 3)
{
int nodes = uStr2Int(*(++strSplit.begin()));
if(nodes > 0)
{
dialog_->setMaximumSteps(nodes);
}
}
dialog_->appendText(msg.c_str());
}
else if(msgQt.contains("Skipping") ||
msgQt.contains("Failed processing"))
{
dialog_->appendText(msg.c_str(), Qt::darkYellow);
}
else
{
dialog_->appendText(msg.c_str());
}
}
QApplication::processEvents();
if(!isCanceled())
{
return ProgressState::callback(msg);
}
return false;
}
public slots:
void cancel()
{
setCanceled(true);
}
private:
ProgressDialog * dialog_;
};
}
#endif /* RECOVERYSTATE_H_ */

View File

@@ -25,8 +25,8 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef STATSTOOLBOX_H_
#define STATSTOOLBOX_H_
#ifndef RTABMAP_STATSTOOLBOX_H_
#define RTABMAP_STATSTOOLBOX_H_
#include "rtabmap/gui/RtabmapGuiExp.h" // DLL export/import defines

View File

@@ -0,0 +1,80 @@
/*
Copyright (c) 2010-2016, 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.
*/
#ifndef RTABMAP_TEXTURINGSTATE_H_
#define RTABMAP_TEXTURINGSTATE_H_
#include "rtabmap/gui/ProgressDialog.h"
#include "rtabmap/core/ProgressState.h"
#include <QApplication>
namespace rtabmap {
class TexturingState : public QObject, public ProgressState
{
Q_OBJECT
public:
TexturingState(ProgressDialog * dialog, bool incrementOnMsgReceived): dialog_(dialog)
{
_increment = incrementOnMsgReceived;
connect(dialog_, SIGNAL(canceled()), this, SLOT(cancel()));
}
virtual ~TexturingState() {}
virtual bool callback(const std::string & msg) const
{
if(!msg.empty())
{
dialog_->appendText(msg.c_str());
if(_increment)
{
dialog_->incrementStep();
}
}
QApplication::processEvents();
if(!isCanceled())
{
return ProgressState::callback(msg);
}
return false;
}
public slots:
void cancel()
{
setCanceled(true);
}
private:
ProgressDialog * dialog_;
bool _increment;
};
}
#endif /* GUILIB_SRC_TEXTURINGSTATE_H_ */