fixed exported calibration name (stereo)

This commit is contained in:
matlabbe
2015-04-06 15:54:19 -04:00
parent 9d58a6ec25
commit 71be7921aa
3 changed files with 6 additions and 9 deletions
Binary file not shown.
+5 -9
View File
@@ -41,8 +41,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <rtabmap/gui/UCv2Qt.h> #include <rtabmap/gui/UCv2Qt.h>
#include <rtabmap/utilite/ULogger.h> #include <rtabmap/utilite/ULogger.h>
#include <rtabmap/utilite/UDirectory.h>
#include <rtabmap/utilite/UFile.h>
namespace rtabmap { namespace rtabmap {
@@ -412,12 +410,10 @@ void CalibrationDialog::processImages(const cv::Mat & imageLeft, const cv::Mat &
if(!stereo_ && readyToCalibrate[0]) if(!stereo_ && readyToCalibrate[0])
{ {
ui_->pushButton_calibrate->setEnabled(true); ui_->pushButton_calibrate->setEnabled(true);
ui_->pushButton_save->setEnabled(true);
} }
else if(stereo_ && readyToCalibrate[0] && readyToCalibrate[1]) else if(stereo_ && readyToCalibrate[0] && readyToCalibrate[1])
{ {
ui_->pushButton_calibrate->setEnabled(true); ui_->pushButton_calibrate->setEnabled(true);
ui_->pushButton_save->setEnabled(true);
} }
if(calibrated_ && ui_->checkBox_rectified->isChecked()) if(calibrated_ && ui_->checkBox_rectified->isChecked())
@@ -746,14 +742,14 @@ bool CalibrationDialog::save()
UASSERT(stereoModel_.isValid()); UASSERT(stereoModel_.isValid());
QString cameraName = stereoModel_.name().c_str(); QString cameraName = stereoModel_.name().c_str();
QString filePath = QFileDialog::getSaveFileName(this, tr("Export"), savingDirectory_ + "/" + cameraName, "*.yaml"); QString filePath = QFileDialog::getSaveFileName(this, tr("Export"), savingDirectory_ + "/" + cameraName, "*.yaml");
std::string name = UFile::getName(filePath.toStdString()); QString name = QFileInfo(filePath).baseName();
std::string dir = UDirectory::getDir(filePath.toStdString()); QString dir = QFileInfo(filePath).absoluteDir().absolutePath();
if(!name.empty()) if(!name.isEmpty())
{ {
std::string base = (dir+UDirectory::separator()+name).c_str(); std::string base = (dir+QDir::separator()+name).toStdString();
std::string leftPath = base+"_left.yaml"; std::string leftPath = base+"_left.yaml";
std::string rightPath = base+"_right.yaml"; std::string rightPath = base+"_right.yaml";
if(stereoModel_.save(dir, name)) if(stereoModel_.save(dir.toStdString(), name.toStdString()))
{ {
QMessageBox::information(this, tr("Export"), tr("Calibration files saved to \"%1\" and \"%2\"."). QMessageBox::information(this, tr("Export"), tr("Calibration files saved to \"%1\" and \"%2\".").
arg(leftPath.c_str()).arg(rightPath.c_str())); arg(leftPath.c_str()).arg(rightPath.c_str()));
+1
View File
@@ -85,6 +85,7 @@ PreferencesDialog::PreferencesDialog(QWidget * parent) :
{ {
ULOGGER_DEBUG(""); ULOGGER_DEBUG("");
_calibrationDialog->setWindowFlags(Qt::Window); _calibrationDialog->setWindowFlags(Qt::Window);
_calibrationDialog->setWindowTitle(tr("Calibration"));
_ui = new Ui_preferencesDialog(); _ui = new Ui_preferencesDialog();
_ui->setupUi(this); _ui->setupUi(this);