|
@@ -7,6 +7,7 @@
|
|
#include "showxodrinvtk.h"
|
|
#include "showxodrinvtk.h"
|
|
|
|
|
|
#include <QMessageBox>
|
|
#include <QMessageBox>
|
|
|
|
+#include <QFile>
|
|
|
|
|
|
static pose gCurPose;
|
|
static pose gCurPose;
|
|
|
|
|
|
@@ -201,6 +202,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
|
|
|
|
|
setWindowTitle("NDT Matching View & Relocation Enable");
|
|
setWindowTitle("NDT Matching View & Relocation Enable");
|
|
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
MainWindow::~MainWindow()
|
|
MainWindow::~MainWindow()
|
|
@@ -427,3 +429,45 @@ void MainWindow::UpdatePCDMap(const char *strdata, const unsigned int nSize, con
|
|
std::cout<<"UpdatePCDMap Fail."<<std::endl;
|
|
std::cout<<"UpdatePCDMap Fail."<<std::endl;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+bool MainWindow::ReadNDTOrigin(std::string strpcdpath,double & flon, double & flat,double & fheading)
|
|
|
|
+{
|
|
|
|
+ QString str1 = QString::fromStdString(strpcdpath);
|
|
|
|
+ QString str2;
|
|
|
|
+ if(str1.length()<5)return false;
|
|
|
|
+ str2 = str1.left(str1.length() -4);
|
|
|
|
+ str2.append(".txt");
|
|
|
|
+// qDebug(str2.toLatin1().data());
|
|
|
|
+
|
|
|
|
+ QFile xFile;;
|
|
|
|
+
|
|
|
|
+ xFile.setFileName(str2);
|
|
|
|
+ if(!xFile.open(QIODevice::ReadOnly))
|
|
|
|
+ {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ QByteArray ba;
|
|
|
|
+ ba = xFile.readLine();
|
|
|
|
+ xFile.close();
|
|
|
|
+ QString str;
|
|
|
|
+ str = ba;
|
|
|
|
+ QStringList strlist;
|
|
|
|
+ strlist = str.split("\t");
|
|
|
|
+ if(strlist.size() == 6)
|
|
|
|
+ {
|
|
|
|
+ QString xstr[6];
|
|
|
|
+ int i;
|
|
|
|
+ for(i=0;i<6;i++)xstr[i] = strlist.at(i);
|
|
|
|
+ flon = xstr[0].toDouble();
|
|
|
|
+ flat = xstr[1].toDouble();
|
|
|
|
+// pnori->height = xstr[2].toDouble();
|
|
|
|
+ fheading = xstr[3].toDouble();
|
|
|
|
+// pnori->pitch = xstr[4].toDouble();
|
|
|
|
+// pnori->roll = xstr[5].toDouble();
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return false;
|
|
|
|
+}
|
|
|
|
+
|