mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-01 17:10:26 +08:00
Refactoring: Renamed rtabmap::Image to rtabmap::SensorData
removed keypoints and descriptors stuff from CameraEvent and Image/SensorData removed keypoints3 from Image/SensorData git-svn-id: http://rtabmap.googlecode.com/svn/trunk/rtabmap@1653 f169173b-cf89-36c8-b27e-44dbe73f0c83
This commit is contained in:
@@ -32,7 +32,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include <rtabmap/utilite/UEventsHandler.h>
|
||||
#include <QtGui/QWidget>
|
||||
#include <rtabmap/core/Image.h>
|
||||
#include <rtabmap/core/SensorData.h>
|
||||
#include <rtabmap/utilite/UTimer.h>
|
||||
|
||||
namespace rtabmap {
|
||||
@@ -52,8 +52,8 @@ public:
|
||||
virtual ~DataRecorder();
|
||||
|
||||
public slots:
|
||||
void addData(const rtabmap::Image & image);
|
||||
void showImage(const rtabmap::Image & image);
|
||||
void addData(const rtabmap::SensorData & data);
|
||||
void showImage(const rtabmap::SensorData & data);
|
||||
protected:
|
||||
void handleEvent(UEvent * event);
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <QtGui/QMainWindow>
|
||||
#include <QtCore/QSet>
|
||||
#include "rtabmap/core/RtabmapEvent.h"
|
||||
#include "rtabmap/core/Image.h"
|
||||
#include "rtabmap/core/SensorData.h"
|
||||
#include "rtabmap/gui/PreferencesDialog.h"
|
||||
|
||||
#include <pcl/point_cloud.h>
|
||||
@@ -137,7 +137,7 @@ private slots:
|
||||
void selectScreenCaptureFormat(bool checked);
|
||||
void takeScreenshot();
|
||||
void updateElapsedTime();
|
||||
void processOdometry(const rtabmap::Image & data, int quality);
|
||||
void processOdometry(const rtabmap::SensorData & data, int quality);
|
||||
void applyAllPrefSettings();
|
||||
void applyPrefSettings(PreferencesDialog::PANEL_FLAGS flags);
|
||||
void applyPrefSettings(const rtabmap::ParametersMap & parameters);
|
||||
@@ -169,7 +169,7 @@ private slots:
|
||||
|
||||
signals:
|
||||
void statsReceived(const rtabmap::Statistics &);
|
||||
void odometryReceived(const rtabmap::Image &, int);
|
||||
void odometryReceived(const rtabmap::SensorData &, int);
|
||||
void thresholdsChanged(int, int);
|
||||
void stateChanged(MainWindow::State);
|
||||
void rtabmapEventInitReceived(int status, const QString & info);
|
||||
|
||||
@@ -30,7 +30,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include "rtabmap/gui/RtabmapGuiExp.h" // DLL export/import defines
|
||||
|
||||
#include "rtabmap/core/Image.h"
|
||||
#include "rtabmap/core/SensorData.h"
|
||||
#include "rtabmap/gui/CloudViewer.h"
|
||||
#include "rtabmap/utilite/UEventsHandler.h"
|
||||
#include "rtabmap/utilite/UTimer.h"
|
||||
@@ -55,7 +55,7 @@ private slots:
|
||||
|
||||
private:
|
||||
UMutex dataMutex_;
|
||||
std::list<rtabmap::Image> data_;
|
||||
std::list<rtabmap::SensorData> data_;
|
||||
int dataQuality_;
|
||||
Transform lastOdomPose_;
|
||||
UTimer timer_;
|
||||
|
||||
@@ -119,7 +119,7 @@ void CalibrationDialog::handleEvent(UEvent * event)
|
||||
if(e->getCode() == rtabmap::CameraEvent::kCodeImage ||
|
||||
e->getCode() == rtabmap::CameraEvent::kCodeImageDepth)
|
||||
{
|
||||
QMetaObject::invokeMethod(this, "processImage", Q_ARG(cv::Mat, e->image().image()));
|
||||
QMetaObject::invokeMethod(this, "processImage", Q_ARG(cv::Mat, e->data().image()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ DataRecorder::DataRecorder(QWidget * parent) :
|
||||
imageView_(new ImageView(this)),
|
||||
dataQueue_(0)
|
||||
{
|
||||
qRegisterMetaType<rtabmap::Image>("rtabmap::Image");
|
||||
qRegisterMetaType<rtabmap::SensorData>("rtabmap::SensorData");
|
||||
|
||||
QHBoxLayout * layout = new QHBoxLayout(this);
|
||||
layout->addWidget(imageView_);
|
||||
@@ -95,16 +95,16 @@ DataRecorder::~DataRecorder()
|
||||
this->close();
|
||||
}
|
||||
|
||||
void DataRecorder::addData(const rtabmap::Image & image)
|
||||
void DataRecorder::addData(const rtabmap::SensorData & data)
|
||||
{
|
||||
if(memory_)
|
||||
{
|
||||
//save to database
|
||||
UTimer time;
|
||||
memory_->update(image);
|
||||
memory_->update(data);
|
||||
memory_->cleanup();
|
||||
|
||||
if(image.id() % 30)
|
||||
if(data.id() % 30)
|
||||
{
|
||||
memory_->emptyTrash();
|
||||
}
|
||||
@@ -118,12 +118,12 @@ void DataRecorder::addData(const rtabmap::Image & image)
|
||||
--dataQueue_;
|
||||
}
|
||||
|
||||
void DataRecorder::showImage(const rtabmap::Image & image)
|
||||
void DataRecorder::showImage(const rtabmap::SensorData & data)
|
||||
{
|
||||
if(this->isVisible() && !image.empty())
|
||||
if(this->isVisible() && data.isValid())
|
||||
{
|
||||
imageView_->setImage(uCvMat2QImage(image.image()));
|
||||
imageView_->setImageDepth(uCvMat2QImage(image.depth()));
|
||||
imageView_->setImage(uCvMat2QImage(data.image()));
|
||||
imageView_->setImageDepth(uCvMat2QImage(data.depth()));
|
||||
imageView_->fitInView(imageView_->sceneRect(), Qt::KeepAspectRatio);
|
||||
}
|
||||
}
|
||||
@@ -136,15 +136,15 @@ void DataRecorder::handleEvent(UEvent * event)
|
||||
if(camEvent->getCode() == CameraEvent::kCodeImageDepth ||
|
||||
camEvent->getCode() == CameraEvent::kCodeImage)
|
||||
{
|
||||
if(!camEvent->image().empty())
|
||||
if(camEvent->data().isValid())
|
||||
{
|
||||
UINFO("Receiving rate = %f Hz", 1.0f/timer_.ticks());
|
||||
QMetaObject::invokeMethod(this, "addData", Q_ARG(rtabmap::Image, camEvent->image()));
|
||||
QMetaObject::invokeMethod(this, "addData", Q_ARG(rtabmap::SensorData, camEvent->data()));
|
||||
++dataQueue_;
|
||||
|
||||
if(dataQueue_ < 2 && this->isVisible())
|
||||
{
|
||||
QMetaObject::invokeMethod(this, "showImage", Q_ARG(rtabmap::Image, camEvent->image()));
|
||||
QMetaObject::invokeMethod(this, "showImage", Q_ARG(rtabmap::SensorData, camEvent->data()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "rtabmap/core/util3d.h"
|
||||
#include "rtabmap/core/Signature.h"
|
||||
#include "rtabmap/gui/DataRecorder.h"
|
||||
#include "rtabmap/core/Image.h"
|
||||
#include "rtabmap/core/SensorData.h"
|
||||
#include "ExportDialog.h"
|
||||
#include "DetailedProgressDialog.h"
|
||||
|
||||
@@ -273,7 +273,7 @@ void DatabaseViewer::exportDatabase()
|
||||
depth2d = rtabmap::util3d::uncompressData(compressedDepth2d);
|
||||
}
|
||||
|
||||
rtabmap::Image data(rgb, depth, depth2d, fx, fy, cx, cy, pose, localTransform, id);
|
||||
rtabmap::SensorData data(rgb, depth, depth2d, fx, fy, cx, cy, pose, localTransform, id);
|
||||
recorder.addData(data);
|
||||
|
||||
progressDialog.appendText(tr("Exported node %1").arg(id));
|
||||
@@ -1645,6 +1645,7 @@ bool DatabaseViewer::addConstraint(int from, int to, bool silent)
|
||||
UASSERT(!containsLink(linksRefined_, from, to));
|
||||
|
||||
Transform t;
|
||||
std::string rejectedMsg;
|
||||
if(ui_->checkBox_visual_recomputeFeatures->isChecked())
|
||||
{
|
||||
// create a fake memory to regenerate features
|
||||
@@ -1669,18 +1670,18 @@ bool DatabaseViewer::addConstraint(int from, int to, bool silent)
|
||||
memory_->getImageDepth(from, imageBytesA, depthBytesA, depth2dBytesA, fxA, fyA, cxA, cyA, localTransformA);
|
||||
cv::Mat imageA = rtabmap::util3d::uncompressImage(imageBytesA);
|
||||
cv::Mat depthA = rtabmap::util3d::uncompressImage(depthBytesA);
|
||||
Image imageFrom(imageA, depthA, fxA, fyA, cxA, cyA, Transform::getIdentity(), localTransformA, 1);
|
||||
SensorData dataFrom(imageA, depthA, fxA, fyA, cxA, cyA, Transform::getIdentity(), localTransformA, 1);
|
||||
|
||||
std::vector<unsigned char> imageBytesB, depthBytesB, depth2dBytesB;
|
||||
memory_->getImageDepth(to, imageBytesB, depthBytesB, depth2dBytesB, fxB, fyB, cxB, cyB, localTransformB);
|
||||
cv::Mat imageB = rtabmap::util3d::uncompressImage(imageBytesB);
|
||||
cv::Mat depthB = rtabmap::util3d::uncompressImage(depthBytesB);
|
||||
Image imageTo(imageB, depthB, fxB, fyB, cxB, cyB, Transform::getIdentity(), localTransformB, 2);
|
||||
SensorData dataTo(imageB, depthB, fxB, fyB, cxB, cyB, Transform::getIdentity(), localTransformB, 2);
|
||||
|
||||
tmpMemory.update(imageFrom);
|
||||
tmpMemory.update(imageTo);
|
||||
tmpMemory.update(dataFrom);
|
||||
tmpMemory.update(dataTo);
|
||||
|
||||
t = tmpMemory.computeVisualTransform(2, 1);
|
||||
t = tmpMemory.computeVisualTransform(2, 1, &rejectedMsg);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1690,7 +1691,7 @@ bool DatabaseViewer::addConstraint(int from, int to, bool silent)
|
||||
parameters.insert(ParametersPair(Parameters::kLccBowIterations(), uNumber2Str(ui_->spinBox_visual_iteration->value())));
|
||||
parameters.insert(ParametersPair(Parameters::kLccBowMinInliers(), uNumber2Str(ui_->spinBox_visual_minCorrespondences->value())));
|
||||
memory_->parseParameters(parameters);
|
||||
t = memory_->computeVisualTransform(to, from);
|
||||
t = memory_->computeVisualTransform(to, from, &rejectedMsg);
|
||||
}
|
||||
|
||||
if(t.isNull())
|
||||
@@ -1699,7 +1700,7 @@ bool DatabaseViewer::addConstraint(int from, int to, bool silent)
|
||||
{
|
||||
QMessageBox::warning(this,
|
||||
tr("Add link"),
|
||||
tr("Cannot find a transformation between nodes %1 and %2").arg(from).arg(to));
|
||||
tr("Cannot find a transformation between nodes %1 and %2: %3").arg(from).arg(to).arg(rejectedMsg.c_str()));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -48,6 +48,7 @@ LoopClosureViewer::LoopClosureViewer(QWidget * parent) :
|
||||
{
|
||||
ui_ = new Ui_loopClosureViewer();
|
||||
ui_->setupUi(this);
|
||||
ui_->cloudViewerTransform->setCameraLockZ(false);
|
||||
|
||||
connect(ui_->checkBox_rawCloud, SIGNAL(clicked()), this, SLOT(updateView()));
|
||||
}
|
||||
|
||||
@@ -341,8 +341,8 @@ MainWindow::MainWindow(PreferencesDialog * prefDialog, QWidget * parent) :
|
||||
qRegisterMetaType<rtabmap::Statistics>("rtabmap::Statistics");
|
||||
connect(this, SIGNAL(statsReceived(rtabmap::Statistics)), this, SLOT(processStats(rtabmap::Statistics)));
|
||||
|
||||
qRegisterMetaType<rtabmap::Image>("rtabmap::Image");
|
||||
connect(this, SIGNAL(odometryReceived(rtabmap::Image, int)), this, SLOT(processOdometry(rtabmap::Image, int)));
|
||||
qRegisterMetaType<rtabmap::SensorData>("rtabmap::SensorData");
|
||||
connect(this, SIGNAL(odometryReceived(rtabmap::SensorData, int)), this, SLOT(processOdometry(rtabmap::SensorData, int)));
|
||||
|
||||
connect(this, SIGNAL(noMoreImagesReceived()), this, SLOT(stopDetection()));
|
||||
|
||||
@@ -554,7 +554,7 @@ void MainWindow::handleEvent(UEvent* anEvent)
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::processOdometry(const rtabmap::Image & data, int quality)
|
||||
void MainWindow::processOdometry(const rtabmap::SensorData & data, int quality)
|
||||
{
|
||||
Transform pose = data.pose();
|
||||
if(pose.isNull())
|
||||
|
||||
@@ -70,7 +70,7 @@ OdometryViewer::OdometryViewer(int maxClouds, int decimation, float voxelSize, i
|
||||
|
||||
void OdometryViewer::processData()
|
||||
{
|
||||
rtabmap::Image data;
|
||||
rtabmap::SensorData data;
|
||||
int quality = -1;
|
||||
dataMutex_.lock();
|
||||
if(data_.size())
|
||||
|
||||
Reference in New Issue
Block a user