mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 01:20:25 +08:00
Added CameraInfo class (added Camera tab in Statistics panel). Scans/userData are not saved anymore when Mem/BinDataKept=false. StereoACameraImages: Fixed error when scan path is not set. Refactoring of OdometryOpticalFlow class to provide variance when 3D->2D estimation is used.
This commit is contained in:
@@ -36,6 +36,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "rtabmap/core/RtabmapEvent.h"
|
||||
#include "rtabmap/core/SensorData.h"
|
||||
#include "rtabmap/core/OdometryEvent.h"
|
||||
#include "rtabmap/core/CameraInfo.h"
|
||||
#include "rtabmap/gui/PreferencesDialog.h"
|
||||
|
||||
#include <pcl/point_cloud.h>
|
||||
@@ -165,6 +166,7 @@ private slots:
|
||||
void selectScreenCaptureFormat(bool checked);
|
||||
void takeScreenshot();
|
||||
void updateElapsedTime();
|
||||
void processCameraInfo(const rtabmap::CameraInfo & info);
|
||||
void processOdometry(const rtabmap::OdometryEvent & odom);
|
||||
void applyPrefSettings(PreferencesDialog::PANEL_FLAGS flags);
|
||||
void applyPrefSettings(const rtabmap::ParametersMap & parameters);
|
||||
@@ -201,6 +203,7 @@ private slots:
|
||||
|
||||
signals:
|
||||
void statsReceived(const rtabmap::Statistics &);
|
||||
void cameraInfoReceived(const rtabmap::CameraInfo &);
|
||||
void odometryReceived(const rtabmap::OdometryEvent &);
|
||||
void thresholdsChanged(int, int);
|
||||
void stateChanged(MainWindow::State);
|
||||
|
||||
@@ -448,6 +448,9 @@ MainWindow::MainWindow(PreferencesDialog * prefDialog, QWidget * parent) :
|
||||
qRegisterMetaType<rtabmap::Statistics>("rtabmap::Statistics");
|
||||
connect(this, SIGNAL(statsReceived(rtabmap::Statistics)), this, SLOT(processStats(rtabmap::Statistics)));
|
||||
|
||||
qRegisterMetaType<rtabmap::CameraInfo>("rtabmap::CameraInfo");
|
||||
connect(this, SIGNAL(cameraInfoReceived(rtabmap::CameraInfo)), this, SLOT(processCameraInfo(rtabmap::CameraInfo)));
|
||||
|
||||
qRegisterMetaType<rtabmap::OdometryEvent>("rtabmap::OdometryEvent");
|
||||
connect(this, SIGNAL(odometryReceived(rtabmap::OdometryEvent)), this, SLOT(processOdometry(rtabmap::OdometryEvent)));
|
||||
|
||||
@@ -688,6 +691,10 @@ void MainWindow::handleEvent(UEvent* anEvent)
|
||||
}
|
||||
emit noMoreImagesReceived();
|
||||
}
|
||||
else
|
||||
{
|
||||
emit cameraInfoReceived(cameraEvent->info());
|
||||
}
|
||||
}
|
||||
else if(anEvent->getClassName().compare("OdometryEvent") == 0)
|
||||
{
|
||||
@@ -729,6 +736,13 @@ void MainWindow::handleEvent(UEvent* anEvent)
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::processCameraInfo(const rtabmap::CameraInfo & info)
|
||||
{
|
||||
_ui->statsToolBox->updateStat("Camera/Time capturing/ms", (float)info.id_, (float)info.timeCapture_*1000.0);
|
||||
_ui->statsToolBox->updateStat("Camera/Time disparity/ms", (float)info.id_, (float)info.timeDisparity_*1000.0);
|
||||
_ui->statsToolBox->updateStat("Camera/Time mirroring/ms", (float)info.id_, (float)info.timeMirroring_*1000.0);
|
||||
}
|
||||
|
||||
void MainWindow::processOdometry(const rtabmap::OdometryEvent & odom)
|
||||
{
|
||||
_processingOdometry = true;
|
||||
@@ -2999,6 +3013,7 @@ void MainWindow::startDetection()
|
||||
|
||||
UEventsManager::addHandler(_odomThread);
|
||||
UEventsManager::createPipe(_camera, _odomThread, "CameraEvent");
|
||||
UEventsManager::createPipe(_camera, this, "CameraEvent");
|
||||
_odomThread->start();
|
||||
}
|
||||
}
|
||||
@@ -3059,6 +3074,7 @@ void MainWindow::startDetection()
|
||||
if(_odomThread)
|
||||
{
|
||||
UEventsManager::createPipe(_dbReader, _odomThread, "CameraEvent");
|
||||
UEventsManager::createPipe(_dbReader, this, "CameraEvent");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3725,7 +3725,7 @@ Camera * PreferencesDialog::createCamera(bool useRawImages)
|
||||
else if(driver == kSrcStereoImages)
|
||||
{
|
||||
camera = new CameraStereoImages(
|
||||
_ui->lineEdit_cameraStereoImages_path_scans->text().append(QDir::separator()).toStdString(),
|
||||
_ui->lineEdit_cameraStereoImages_path_scans->text().isEmpty()?"":_ui->lineEdit_cameraStereoImages_path_scans->text().append(QDir::separator()).toStdString(),
|
||||
this->getStereoLaserLocalTransform(),
|
||||
_ui->spinBox_cameraStereoImages_max_scan_pts->value(),
|
||||
_ui->lineEdit_cameraStereoImages_path_left->text().append(QDir::separator()).toStdString(),
|
||||
|
||||
Reference in New Issue
Block a user