mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-03 01:50:24 +08:00
Increased version to 0.6.2
Memory management tested on RGBD SLAM Fixed some crashes New parameter RGBD/LocalLoopDetectionMaxDiffID New parameter LccIcp2/VoxelSize Updated parameter LccIcp/Type (added "No ICP" type) Updated parameter kLccBowMinInliers (inliers minimum reduced to 1) TORO optimization: The graph root is explicitly defined as the last node added (fixed a TORO crash when a root could not be found) TORO optimization: only one constraint between neighbors and loop closures TORO optimization: added initial tree guess Map correction/Map transform: now only used in localization mode (map correction is always identity on mapping mode) New statistics: local loop space diff, last loop closure parent and child ids Database: Fixed empty signatures with no poses loaded ICP: fixed transform multiplication order Dump memory: added 3D words DatabaseViewer: added Export option (added ExportDialog object) DataRecorder: Option recording in RAM or Hard drive GUI: added a dock widget (MapVisibilityWidget) to change visibility of nodes in the 3D map GUI: fixed progress bar step count when generating the map Menu option: generate TORO graph (full/current map, optimized/not optimized) Menu option: download map (full/current map, optimized/not optimized) Preferences: added Reset all settings button Preferences: A QGroupBox can be a boolean parameter git-svn-id: http://rtabmap.googlecode.com/svn/trunk/rtabmap@1066 f169173b-cf89-36c8-b27e-44dbe73f0c83
This commit is contained in:
@@ -35,6 +35,10 @@
|
||||
#include "rtabmap/gui/UCv2Qt.h"
|
||||
#include "rtabmap/core/util3d.h"
|
||||
#include "rtabmap/core/Signature.h"
|
||||
#include "rtabmap/gui/DataRecorder.h"
|
||||
#include "rtabmap/core/Image.h"
|
||||
#include "ExportDialog.h"
|
||||
#include "DetailedProgressDialog.h"
|
||||
|
||||
#include <pcl/io/pcd_io.h>
|
||||
#include <pcl/filters/voxel_grid.h>
|
||||
@@ -59,6 +63,7 @@ DatabaseViewer::DatabaseViewer(QWidget * parent) :
|
||||
|
||||
// connect actions with custom slots
|
||||
connect(ui_->actionOpen_database, SIGNAL(triggered()), this, SLOT(openDatabase()));
|
||||
connect(ui_->actionExport, SIGNAL(triggered()), this, SLOT(exportDatabase()));
|
||||
connect(ui_->actionGenerate_graph_dot, SIGNAL(triggered()), this, SLOT(generateGraph()));
|
||||
connect(ui_->actionGenerate_local_graph_dot, SIGNAL(triggered()), this, SLOT(generateLocalGraph()));
|
||||
connect(ui_->actionGenerate_3D_map_pcd, SIGNAL(triggered()), this, SLOT(generate3DMap()));
|
||||
@@ -130,6 +135,82 @@ bool DatabaseViewer::openDatabase(const QString & path)
|
||||
return false;
|
||||
}
|
||||
|
||||
void DatabaseViewer::exportDatabase()
|
||||
{
|
||||
if(!memory_ || ids_.size() == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
rtabmap::ExportDialog dialog;
|
||||
|
||||
if(dialog.exec())
|
||||
{
|
||||
if(!dialog.outputPath().isEmpty())
|
||||
{
|
||||
int framesIgnored = dialog.framesIgnored();
|
||||
QString path = dialog.outputPath();
|
||||
rtabmap::DataRecorder recorder;
|
||||
if(recorder.init(path, false))
|
||||
{
|
||||
rtabmap::DetailedProgressDialog progressDialog(this);
|
||||
progressDialog.setMaximumSteps(ids_.size() / (1+framesIgnored) + 1);
|
||||
progressDialog.show();
|
||||
|
||||
for(int i=0; i<ids_.size(); i+=1+framesIgnored)
|
||||
{
|
||||
int id = ids_.at(i);
|
||||
std::vector<unsigned char> compressedRgb, compressedDepth, compressedDepth2d;
|
||||
float tmpDepthConstant;
|
||||
rtabmap::Transform tmpLocalTransform, pose;
|
||||
|
||||
memory_->getImageDepth(id, compressedRgb, compressedDepth, compressedDepth2d, tmpDepthConstant, tmpLocalTransform);
|
||||
if(dialog.isOdomExported())
|
||||
{
|
||||
memory_->getPose(id, pose, true);
|
||||
}
|
||||
|
||||
cv::Mat rgb, depth, depth2d;
|
||||
float depthConstant = 0;
|
||||
rtabmap::Transform localTransform;
|
||||
|
||||
if(dialog.isRgbExported())
|
||||
{
|
||||
rgb = rtabmap::util3d::uncompressImage(compressedRgb);
|
||||
}
|
||||
if(dialog.isDepthExported())
|
||||
{
|
||||
depth = rtabmap::util3d::uncompressImage(compressedDepth);
|
||||
depthConstant = tmpDepthConstant;
|
||||
localTransform = tmpLocalTransform;
|
||||
}
|
||||
if(dialog.isDepth2dExported())
|
||||
{
|
||||
depth2d = rtabmap::util3d::uncompressData(compressedDepth2d);
|
||||
}
|
||||
|
||||
rtabmap::Image data(rgb, depth, depth2d, depthConstant, pose, localTransform, id);
|
||||
recorder.addData(data);
|
||||
|
||||
progressDialog.appendText(tr("Exported node %1").arg(id));
|
||||
progressDialog.incrementStep();
|
||||
QApplication::processEvents();
|
||||
}
|
||||
progressDialog.setValue(progressDialog.maximumSteps());
|
||||
progressDialog.appendText("Export finished!");
|
||||
}
|
||||
else
|
||||
{
|
||||
UERROR("DataRecorder init failed?!");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
QMessageBox::warning(this, tr("Cannot export database"), tr("An output path must be set!"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DatabaseViewer::updateIds()
|
||||
{
|
||||
if(!memory_)
|
||||
@@ -246,7 +327,7 @@ void DatabaseViewer::generate3DMap()
|
||||
{
|
||||
std::map<int, rtabmap::Transform> poses, optimizedPoses;
|
||||
std::multimap<int, std::pair<int, rtabmap::Transform> > edgeConstraints;
|
||||
memory_->getMetricConstraints(uKeys(ids), memory_->getSignature(id)->mapId(), poses, edgeConstraints, true);
|
||||
memory_->getMetricConstraints(uKeys(ids), poses, edgeConstraints, true);
|
||||
|
||||
UINFO("Poses=%d, constraints=%d", poses.size(), edgeConstraints.size());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user