|
@@ -19,6 +19,11 @@ extern iv::ndtorigin gndtorigin;
|
|
|
|
|
|
extern bool gbManualSave;
|
|
extern bool gbManualSave;
|
|
|
|
|
|
|
|
+extern iv::ndttracepoint grtktracepoint;
|
|
|
|
+extern std::mutex gmutexrtk;
|
|
|
|
+extern iv::ndttracepoint grtklasttracepoint;
|
|
|
|
+extern bool gbHaveRTK;
|
|
|
|
+
|
|
#include <Eigen/Geometry>
|
|
#include <Eigen/Geometry>
|
|
|
|
|
|
#include <tf/tf.h>
|
|
#include <tf/tf.h>
|
|
@@ -278,6 +283,17 @@ void MainWindow::on_pushButton_Load_clicked()
|
|
QString str = QFileDialog::getOpenFileName(this,tr("Open file"),"",tr("Record File(*.ivd)"));
|
|
QString str = QFileDialog::getOpenFileName(this,tr("Open file"),"",tr("Record File(*.ivd)"));
|
|
if(str.isEmpty())return;
|
|
if(str.isEmpty())return;
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ grtktracepoint.x = 0;
|
|
|
|
+ grtktracepoint.y = 0;
|
|
|
|
+ grtktracepoint.z = 0;
|
|
|
|
+ grtktracepoint.yaw = 0;
|
|
|
|
+ grtktracepoint.pitch = 0;
|
|
|
|
+ grtktracepoint.roll = 0;
|
|
|
|
+ grtklasttracepoint = grtktracepoint;
|
|
|
|
+ gbHaveRTK = false;
|
|
|
|
+
|
|
mvectorcalib.clear();
|
|
mvectorcalib.clear();
|
|
mvectorgps.clear();
|
|
mvectorgps.clear();
|
|
mvectorrawgps.clear();
|
|
mvectorrawgps.clear();
|
|
@@ -393,9 +409,19 @@ void MainWindow::onTimer()
|
|
iv::ndttracepoint xtrrtk;
|
|
iv::ndttracepoint xtrrtk;
|
|
while(mvectorrawgps.size()>0)
|
|
while(mvectorrawgps.size()>0)
|
|
{
|
|
{
|
|
|
|
+ int64_t timediff = mvectorrawgps[0].recvtime - xlidartime;
|
|
// std::cout<<" time diff: "<<(mvectorrawgps[0].recvtime - xlidartime)<<std::endl;
|
|
// std::cout<<" time diff: "<<(mvectorrawgps[0].recvtime - xlidartime)<<std::endl;
|
|
// std::cout<<" ldiar time: "<<xlidartime<<std::endl;
|
|
// std::cout<<" ldiar time: "<<xlidartime<<std::endl;
|
|
- if((mvectorrawgps[0].recvtime<xlidartime) &&(mvectorrawgps[0].recvtime>=(xlidartime-30)))
|
|
|
|
|
|
+ if((mvectorrawgps[0].recvtime<xlidartime) &&(mvectorrawgps[0].recvtime>=(xlidartime-15)))
|
|
|
|
+ {
|
|
|
|
+ iv::ndttracepoint xtr;
|
|
|
|
+ xtr = mvectorrawgps[0].xtrace;
|
|
|
|
+ mvectorgps.push_back(xtr);
|
|
|
|
+ bHaveRTKPoint = true;
|
|
|
|
+ xtrrtk = xtr;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ if((timediff>=0) &&(timediff < 15))
|
|
{
|
|
{
|
|
iv::ndttracepoint xtr;
|
|
iv::ndttracepoint xtr;
|
|
xtr = mvectorrawgps[0].xtrace;
|
|
xtr = mvectorrawgps[0].xtrace;
|
|
@@ -405,6 +431,7 @@ void MainWindow::onTimer()
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
mvectorrawgps.erase(mvectorrawgps.begin());
|
|
mvectorrawgps.erase(mvectorrawgps.begin());
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
if(mbFileDiffOpen)
|
|
if(mbFileDiffOpen)
|
|
@@ -501,6 +528,7 @@ void MainWindow::onTimer()
|
|
{
|
|
{
|
|
if(xgpsimu.rtk_state() == 6)
|
|
if(xgpsimu.rtk_state() == 6)
|
|
{
|
|
{
|
|
|
|
+ gbHaveRTK = true;
|
|
double fheading = xgpsimu.heading();
|
|
double fheading = xgpsimu.heading();
|
|
fheading = fheading - 0;
|
|
fheading = fheading - 0;
|
|
if(fheading < 0)fheading = fheading + 360;
|
|
if(fheading < 0)fheading = fheading + 360;
|
|
@@ -523,6 +551,7 @@ void MainWindow::onTimer()
|
|
trarm.yaw = 0;
|
|
trarm.yaw = 0;
|
|
trarm.pitch = 0;
|
|
trarm.pitch = 0;
|
|
trarm.roll = 0;
|
|
trarm.roll = 0;
|
|
|
|
+ std::cout<<" arm x: "<<arm_x<<" arm y: "<<arm_y<<std::endl;
|
|
gndtorigin = PoseToGPS(gndtorigin,trarm);
|
|
gndtorigin = PoseToGPS(gndtorigin,trarm);
|
|
|
|
|
|
mpLE_OriginLat->setText(QString::number(gndtorigin.lat,'f',7));
|
|
mpLE_OriginLat->setText(QString::number(gndtorigin.lat,'f',7));
|
|
@@ -539,6 +568,16 @@ void MainWindow::onTimer()
|
|
if(mbIVDSetOrigin)
|
|
if(mbIVDSetOrigin)
|
|
{
|
|
{
|
|
iv::ndttracepoint xtr = CalcPose(gndtorigin,xgpsimu);
|
|
iv::ndttracepoint xtr = CalcPose(gndtorigin,xgpsimu);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ gmutexrtk.lock();
|
|
|
|
+ grtktracepoint.x = xtr.x;
|
|
|
|
+ grtktracepoint.y = xtr.y;
|
|
|
|
+ grtktracepoint.z = xtr.z;
|
|
|
|
+ grtktracepoint.yaw = xtr.yaw;
|
|
|
|
+ gmutexrtk.unlock();
|
|
|
|
+
|
|
|
|
+
|
|
double x,y;
|
|
double x,y;
|
|
x = arm_x * cos(xtr.yaw) - arm_y * sin(xtr.yaw);
|
|
x = arm_x * cos(xtr.yaw) - arm_y * sin(xtr.yaw);
|
|
y = arm_x * sin(xtr.yaw) + arm_y * cos(xtr.yaw);
|
|
y = arm_x * sin(xtr.yaw) + arm_y * cos(xtr.yaw);
|