mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 09:30:25 +08:00
DatabaseViewer: Saving/loading settings, added 3D view, added Grid from 3d projection parameter
This commit is contained in:
@@ -39,6 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QSet>
|
||||
#include <QtCore/qnamespace.h>
|
||||
#include <QtCore/QSettings>
|
||||
|
||||
#include <opencv2/opencv.hpp>
|
||||
|
||||
@@ -63,6 +64,9 @@ public:
|
||||
CloudViewer(QWidget * parent = 0);
|
||||
virtual ~CloudViewer();
|
||||
|
||||
void saveSettings(QSettings & settings, const QString & group = "") const;
|
||||
void loadSettings(QSettings & settings, const QString & group = "");
|
||||
|
||||
bool updateCloudPose(
|
||||
const std::string & id,
|
||||
const Transform & pose); //including mesh
|
||||
|
||||
@@ -53,6 +53,7 @@ namespace rtabmap
|
||||
class Memory;
|
||||
class ImageView;
|
||||
class Signature;
|
||||
class CloudViewer;
|
||||
|
||||
class RTABMAPGUI_EXP DatabaseViewer : public QMainWindow
|
||||
{
|
||||
@@ -62,13 +63,18 @@ public:
|
||||
DatabaseViewer(QWidget * parent = 0);
|
||||
virtual ~DatabaseViewer();
|
||||
bool openDatabase(const QString & path);
|
||||
bool isSavedMaximized() const {return savedMaximized_;}
|
||||
|
||||
protected:
|
||||
virtual void showEvent(QShowEvent* anEvent);
|
||||
virtual void moveEvent(QMoveEvent* anEvent);
|
||||
virtual void resizeEvent(QResizeEvent* anEvent);
|
||||
virtual void closeEvent(QCloseEvent* event);
|
||||
virtual bool eventFilter(QObject *obj, QEvent *event);
|
||||
|
||||
private slots:
|
||||
void writeSettings();
|
||||
void configModified();
|
||||
void openDatabase();
|
||||
void generateGraph();
|
||||
void exportDatabase();
|
||||
@@ -89,6 +95,7 @@ private slots:
|
||||
void sliderNeighborValueChanged(int);
|
||||
void sliderLoopValueChanged(int);
|
||||
void sliderIterationsValueChanged(int);
|
||||
void updateGrid();
|
||||
void updateGraphView();
|
||||
void refineConstraint();
|
||||
void refineConstraintVisually();
|
||||
@@ -98,6 +105,9 @@ private slots:
|
||||
void updateConstraintView();
|
||||
|
||||
private:
|
||||
QString getIniFilePath() const;
|
||||
void readSettings();
|
||||
|
||||
void updateIds();
|
||||
void update(int value,
|
||||
QLabel * labelIndex,
|
||||
@@ -107,6 +117,7 @@ private:
|
||||
QLabel * label,
|
||||
QLabel * stamp,
|
||||
rtabmap::ImageView * view,
|
||||
rtabmap::CloudViewer * view3D,
|
||||
QLabel * labelId,
|
||||
bool updateConstraintView = true);
|
||||
void updateStereo(const Signature * data);
|
||||
@@ -145,7 +156,10 @@ private:
|
||||
std::multimap<int, rtabmap::Link> linksRefined_;
|
||||
std::multimap<int, rtabmap::Link> linksAdded_;
|
||||
std::multimap<int, rtabmap::Link> linksRemoved_;
|
||||
std::map<int, pcl::PointCloud<pcl::PointXYZ>::Ptr > scans_;
|
||||
std::map<int, std::pair<cv::Mat, cv::Mat> > localMaps_; // <ground, obstacles>
|
||||
|
||||
bool savedMaximized_;
|
||||
bool firstCall_;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <QtGui/QGraphicsView>
|
||||
#include <QtCore/QRectF>
|
||||
#include <QtCore/QMultiMap>
|
||||
#include <QtCore/QSettings>
|
||||
#include <opencv2/features2d/features2d.hpp>
|
||||
#include <map>
|
||||
|
||||
@@ -51,6 +52,9 @@ public:
|
||||
ImageView(QWidget * parent = 0);
|
||||
virtual ~ImageView();
|
||||
|
||||
void saveSettings(QSettings & settings, const QString & group = "") const;
|
||||
void loadSettings(QSettings & settings, const QString & group = "");
|
||||
|
||||
void resetZoom();
|
||||
|
||||
bool isImageShown() const;
|
||||
|
||||
@@ -298,6 +298,8 @@ private:
|
||||
|
||||
QVector<int> _refIds;
|
||||
QVector<int> _loopClosureIds;
|
||||
|
||||
bool _firstCall;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user