mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-03 01:50:24 +08:00
Added constraints editing to DatabaseViewer to add/reject loop closures, refine loop closures with ICP, detect more loop closures using the optimized map
Added Feature2D::parseParameters() git-svn-id: http://rtabmap.googlecode.com/svn/trunk/rtabmap@1632 f169173b-cf89-36c8-b27e-44dbe73f0c83
This commit is contained in:
@@ -44,7 +44,6 @@ namespace rtabmap
|
||||
{
|
||||
class Memory;
|
||||
class ImageView;
|
||||
}
|
||||
|
||||
class RTABMAPGUI_EXP DatabaseViewer : public QMainWindow
|
||||
{
|
||||
@@ -55,6 +54,9 @@ public:
|
||||
virtual ~DatabaseViewer();
|
||||
bool openDatabase(const QString & path);
|
||||
|
||||
protected:
|
||||
virtual void resizeEvent(QResizeEvent* anEvent);
|
||||
|
||||
private slots:
|
||||
void openDatabase();
|
||||
void generateGraph();
|
||||
@@ -64,6 +66,9 @@ private slots:
|
||||
void generateTOROGraph();
|
||||
void view3DMap();
|
||||
void generate3DMap();
|
||||
void detectMoreLoopClosures();
|
||||
void refineAllNeighborLinks();
|
||||
void refineAllLoopClosureLinks();
|
||||
void sliderAValueChanged(int);
|
||||
void sliderBValueChanged(int);
|
||||
void sliderAMoved(int);
|
||||
@@ -72,6 +77,10 @@ private slots:
|
||||
void sliderLoopValueChanged(int);
|
||||
void sliderIterationsValueChanged(int);
|
||||
void updateGraphView();
|
||||
void refineConstraint();
|
||||
void addConstraint();
|
||||
void resetConstraint();
|
||||
void rejectConstraint();
|
||||
|
||||
private:
|
||||
void updateIds();
|
||||
@@ -81,7 +90,29 @@ private:
|
||||
QLabel * labelChildren,
|
||||
rtabmap::ImageView * view,
|
||||
QLabel * labelId);
|
||||
void updateWordsMatching();
|
||||
void updateConstraintView(const rtabmap::Link & link);
|
||||
void updateConstraintButtons();
|
||||
std::multimap<int, Link>::iterator findLink(
|
||||
std::multimap<int, Link> & links,
|
||||
int from,
|
||||
int to);
|
||||
Link findActiveLink(int from, int to);
|
||||
bool containsLink(
|
||||
std::multimap<int, Link> & links,
|
||||
int from,
|
||||
int to);
|
||||
std::multimap<int, rtabmap::Link> updateLinksWithModifications(
|
||||
const std::multimap<int, rtabmap::Link> & edgeConstraints);
|
||||
void updateLoopClosuresSlider(int from = 0, int to = 0);
|
||||
void refineConstraint(int from, int to);
|
||||
bool addConstraint(int from, int to, bool silent);
|
||||
std::map<int, int> generateGraph(int fromNode, int margin);
|
||||
std::map<int, Transform> optimizeGraph(
|
||||
const std::map<int, int> & ids,
|
||||
const std::map<int, Transform> & poses,
|
||||
const std::multimap<int, Link> & links,
|
||||
std::list<std::map<int, rtabmap::Transform> > * graphes = 0);
|
||||
|
||||
private:
|
||||
Ui_DatabaseViewer * ui_;
|
||||
@@ -94,7 +125,12 @@ private:
|
||||
std::list<std::map<int, rtabmap::Transform> > graphes_;
|
||||
std::map<int, rtabmap::Transform> poses_;
|
||||
std::multimap<int, rtabmap::Link> links_;
|
||||
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_;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif /* DATABASEVIEWER_H_ */
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
#include <QtGui/QGraphicsView>
|
||||
#include <QtCore/QRectF>
|
||||
#include <QtCore/QMultiMap>
|
||||
#include <opencv2/features2d/features2d.hpp>
|
||||
#include <map>
|
||||
|
||||
@@ -57,7 +58,12 @@ public:
|
||||
void setFeatures(const std::multimap<int, cv::KeyPoint> & refWords);
|
||||
void setImage(const QImage & image);
|
||||
void setImageDepth(const QImage & image);
|
||||
void setFeatureColor(int id, const QColor & color);
|
||||
void setFeaturesColor(const QColor & color);
|
||||
|
||||
const QMultiMap<int, rtabmap::KeypointItem *> & getFeatures() const {return _features;}
|
||||
|
||||
void clearLines();
|
||||
void clear();
|
||||
|
||||
protected:
|
||||
@@ -82,7 +88,7 @@ private:
|
||||
QAction * _showLines;
|
||||
QAction * _saveImage;
|
||||
|
||||
QList<rtabmap::KeypointItem *> _features;
|
||||
QMultiMap<int, rtabmap::KeypointItem *> _features;
|
||||
QGraphicsPixmapItem * _image;
|
||||
QGraphicsPixmapItem * _imageDepth;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user