|
@@ -27,6 +27,14 @@ static double mflon0;
|
|
|
static double mflat0;
|
|
|
static bool mbLoadXODR = false;
|
|
|
|
|
|
+extern double gfcustom_cam_x;
|
|
|
+extern double gfcustom_cam_y;
|
|
|
+extern double gfcustom_cam_z;
|
|
|
+extern double gfcustom_view_x;
|
|
|
+extern double gfcustom_view_y;
|
|
|
+extern double gfcustom_view_z;
|
|
|
+extern double gfcustom_yawrotate;
|
|
|
+
|
|
|
#include <cmath>
|
|
|
|
|
|
struct Quaternion {
|
|
@@ -159,6 +167,18 @@ void viewerPsycho (pcl::visualization::PCLVisualizer& viewer)
|
|
|
double fcam_y = gCurPose.y + gfZcos * sin(gCurPose.yaw+M_PI);
|
|
|
viewer.setCameraPosition(fcam_x,fcam_y,gfZsin,gCurPose.x,gCurPose.y,gCurPose.z,sin(yaw_calc),cos(yaw_calc),0);
|
|
|
}
|
|
|
+ if(gnViewMode == 2)
|
|
|
+ {
|
|
|
+ double fcam_x,fcam_y,fcam_z;
|
|
|
+ fcam_z = gfcustom_cam_z;
|
|
|
+ fcam_x = gCurPose.x + gfcustom_cam_x * cos(gCurPose.yaw) - gfcustom_cam_y * sin(gCurPose.yaw);
|
|
|
+ fcam_y = gCurPose.y + gfcustom_cam_x * sin(gCurPose.yaw) + gfcustom_cam_y * cos(gCurPose.yaw);
|
|
|
+ yaw_calc = yaw_calc + gfcustom_yawrotate;
|
|
|
+ double fview_x = gCurPose.x + gfcustom_view_x * cos(gCurPose.yaw) - gfcustom_view_y * sin(gCurPose.yaw);
|
|
|
+ double fview_y = gCurPose.y + gfcustom_view_x * sin(gCurPose.yaw) + gfcustom_view_y * sin(gCurPose.yaw);
|
|
|
+ double fview_z = gfcustom_view_z + gCurPose.z;
|
|
|
+ viewer.setCameraPosition(fcam_x,fcam_y,fcam_z,fview_x,fview_y,fview_z,sin(yaw_calc),cos(yaw_calc),0);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
std::stringstream ss;
|
|
@@ -189,6 +209,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
|
|
|
|
|
ui->comboBox->addItem("Look Down");
|
|
|
ui->comboBox->addItem("Tracking");
|
|
|
+ ui->comboBox->addItem("Custom");
|
|
|
|
|
|
ui->checkBox->setChecked(true);
|
|
|
|
|
@@ -414,6 +435,13 @@ void MainWindow::UpdateGPSIMU(const char * strdata,const unsigned int nSize,cons
|
|
|
}
|
|
|
|
|
|
|
|
|
+ //IF Have NDT Position,Use NDT Position.
|
|
|
+ int64_t nmsnow = std::chrono::system_clock::now().time_since_epoch().count()/1000000;
|
|
|
+ if(abs(nmsnow - mnLastNDTUpdate)<3000)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
if(mbLoadXODR)
|
|
|
{
|
|
@@ -441,6 +469,7 @@ void MainWindow::UpdateNDTPos(const char * strdata,const unsigned int nSize,cons
|
|
|
(void)dt;
|
|
|
(void)strmemname;
|
|
|
|
|
|
+
|
|
|
iv::lidar::ndtpos xndtpos;
|
|
|
if(xndtpos.ParseFromArray(strdata,nSize))
|
|
|
{
|
|
@@ -449,6 +478,8 @@ void MainWindow::UpdateNDTPos(const char * strdata,const unsigned int nSize,cons
|
|
|
mbndtposupdate = true;
|
|
|
mmutexndtpos.unlock();
|
|
|
emit ndtposupdate();
|
|
|
+
|
|
|
+ mnLastNDTUpdate = std::chrono::system_clock::now().time_since_epoch().count()/1000000;
|
|
|
}
|
|
|
else
|
|
|
{
|