mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 17:40:23 +08:00
Added session selection id in ExportDialog
This commit is contained in:
@@ -663,17 +663,46 @@ void DatabaseViewer::exportDatabase()
|
|||||||
if(!dialog.outputPath().isEmpty())
|
if(!dialog.outputPath().isEmpty())
|
||||||
{
|
{
|
||||||
int framesIgnored = dialog.framesIgnored();
|
int framesIgnored = dialog.framesIgnored();
|
||||||
|
int sessionExported = dialog.sessionExported();
|
||||||
QString path = dialog.outputPath();
|
QString path = dialog.outputPath();
|
||||||
rtabmap::DataRecorder recorder;
|
rtabmap::DataRecorder recorder;
|
||||||
|
QList<int> ids;
|
||||||
|
if(sessionExported < 0)
|
||||||
|
{
|
||||||
|
ids = ids_;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for(int i=0; i<ids_.size(); ++i)
|
||||||
|
{
|
||||||
|
Transform odomPose;
|
||||||
|
int weight = -1;
|
||||||
|
int mapId = -1;
|
||||||
|
std::string label;
|
||||||
|
double stamp = 0;
|
||||||
|
std::vector<unsigned char> userData;
|
||||||
|
if(memory_->getNodeInfo(ids_[i], odomPose, mapId, weight, label, stamp, userData, true))
|
||||||
|
{
|
||||||
|
if(sessionExported == mapId)
|
||||||
|
{
|
||||||
|
ids.push_back(ids_[i]);
|
||||||
|
}
|
||||||
|
else if(mapId > sessionExported)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if(recorder.init(path, false))
|
if(recorder.init(path, false))
|
||||||
{
|
{
|
||||||
rtabmap::DetailedProgressDialog progressDialog(this);
|
rtabmap::DetailedProgressDialog progressDialog(this);
|
||||||
progressDialog.setMaximumSteps(ids_.size() / (1+framesIgnored) + 1);
|
progressDialog.setMaximumSteps(ids.size() / (1+framesIgnored) + 1);
|
||||||
progressDialog.show();
|
progressDialog.show();
|
||||||
|
|
||||||
for(int i=0; i<ids_.size(); i+=1+framesIgnored)
|
for(int i=0; i<ids.size(); i+=1+framesIgnored)
|
||||||
{
|
{
|
||||||
int id = ids_.at(i);
|
int id = ids.at(i);
|
||||||
|
|
||||||
Signature data = memory_->getSignatureData(id, true);
|
Signature data = memory_->getSignatureData(id, true);
|
||||||
rtabmap::SensorData sensorData = data.toSensorData();
|
rtabmap::SensorData sensorData = data.toSensorData();
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ ExportDialog::ExportDialog(QWidget * parent) :
|
|||||||
connect(_ui->toolButton_path, SIGNAL(clicked()), this, SLOT(getPath()));
|
connect(_ui->toolButton_path, SIGNAL(clicked()), this, SLOT(getPath()));
|
||||||
|
|
||||||
connect(_ui->spinBox_ignored, SIGNAL(valueChanged(int)), this, SIGNAL(configChanged()));
|
connect(_ui->spinBox_ignored, SIGNAL(valueChanged(int)), this, SIGNAL(configChanged()));
|
||||||
|
connect(_ui->spinBox_session, SIGNAL(valueChanged(int)), this, SIGNAL(configChanged()));
|
||||||
connect(_ui->checkBox_rgb, SIGNAL(stateChanged(int)), this, SIGNAL(configChanged()));
|
connect(_ui->checkBox_rgb, SIGNAL(stateChanged(int)), this, SIGNAL(configChanged()));
|
||||||
connect(_ui->checkBox_depth, SIGNAL(stateChanged(int)), this, SIGNAL(configChanged()));
|
connect(_ui->checkBox_depth, SIGNAL(stateChanged(int)), this, SIGNAL(configChanged()));
|
||||||
connect(_ui->checkBox_depth2d, SIGNAL(stateChanged(int)), this, SIGNAL(configChanged()));
|
connect(_ui->checkBox_depth2d, SIGNAL(stateChanged(int)), this, SIGNAL(configChanged()));
|
||||||
@@ -73,6 +74,11 @@ int ExportDialog::framesIgnored() const
|
|||||||
return _ui->spinBox_ignored->value();
|
return _ui->spinBox_ignored->value();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int ExportDialog::sessionExported() const
|
||||||
|
{
|
||||||
|
return _ui->spinBox_session->value();
|
||||||
|
}
|
||||||
|
|
||||||
bool ExportDialog::isRgbExported() const
|
bool ExportDialog::isRgbExported() const
|
||||||
{
|
{
|
||||||
return _ui->checkBox_rgb->isChecked();
|
return _ui->checkBox_rgb->isChecked();
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ public:
|
|||||||
|
|
||||||
QString outputPath() const;
|
QString outputPath() const;
|
||||||
int framesIgnored() const;
|
int framesIgnored() const;
|
||||||
|
int sessionExported() const;
|
||||||
bool isRgbExported() const;
|
bool isRgbExported() const;
|
||||||
bool isDepthExported() const;
|
bool isDepthExported() const;
|
||||||
bool isDepth2dExported() const;
|
bool isDepth2dExported() const;
|
||||||
|
|||||||
@@ -375,8 +375,6 @@ void ImageView::paintEvent(QPaintEvent *event)
|
|||||||
{
|
{
|
||||||
if(!_graphicsView->scene()->sceneRect().isNull())
|
if(!_graphicsView->scene()->sceneRect().isNull())
|
||||||
{
|
{
|
||||||
UWARN("rect= %d %d", event->rect().width(), event->rect().height());
|
|
||||||
|
|
||||||
//Scale
|
//Scale
|
||||||
float ratio, offsetX, offsetY;
|
float ratio, offsetX, offsetY;
|
||||||
this->computeScaleOffsets(event->rect(), ratio, offsetX, offsetY);
|
this->computeScaleOffsets(event->rect(), ratio, offsetX, offsetY);
|
||||||
|
|||||||
@@ -45,6 +45,46 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
|
<item>
|
||||||
|
<widget class="QSpinBox" name="spinBox_session">
|
||||||
|
<property name="suffix">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>-1</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>999</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>-1</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>Mapping session (-1 = all)</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_2">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="checkBox_rgb">
|
<widget class="QCheckBox" name="checkBox_rgb">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
|||||||
Reference in New Issue
Block a user