|
@@ -9,7 +9,9 @@
|
|
|
#include <iostream>
|
|
|
#include "xmlparam.h"
|
|
|
#include "qcoreapplication.h"
|
|
|
+#include <QTime>
|
|
|
|
|
|
+QTime gps_update_times,gps_last_to_current;
|
|
|
|
|
|
extern std::string gstrmemdecition;
|
|
|
extern std::string gstrmembrainstate;
|
|
@@ -496,9 +498,17 @@ void iv::decition::BrainDecition::run() {
|
|
|
|
|
|
obs_camera_ = NULL;
|
|
|
|
|
|
+ int gps_update_period=0,gps_last_to_current_times=0;
|
|
|
|
|
|
-
|
|
|
+ gps_update_times.start();
|
|
|
eyes->getSensorObstacle(obs_radar_, obs_camera_,gps_data_, obs_lidar_grid_); //从传感器线程临界区交换数据
|
|
|
+ if(gps_data_!=NULL)
|
|
|
+ {
|
|
|
+ gps_update_period=gps_update_times.elapsed();
|
|
|
+ gps_last_to_current.start();
|
|
|
+ }
|
|
|
+ gps_last_to_current_times=gps_last_to_current.elapsed();
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -523,26 +533,6 @@ void iv::decition::BrainDecition::run() {
|
|
|
iv::ObsRadar obs_radar_tmp(new std::vector<iv::ObstacleBasic>);
|
|
|
iv::decition::Decition decition_final(new iv::decition::DecitionBasic);
|
|
|
|
|
|
- // if ((ServiceCarStatus.status[0] == true && ServiceCarStatus.status[1] == false && ServiceCarStatus.status[2] == false && ServiceCarStatus.status[3] == false && ServiceCarStatus.status[4] == true) ||
|
|
|
- // (ServiceCarStatus.status[0] == true && ServiceCarStatus.status[1] == false && ServiceCarStatus.status[2] == false && ServiceCarStatus.status[3] == true && ServiceCarStatus.status[4] == true) ||
|
|
|
- // (ServiceCarStatus.status[0] == true && ServiceCarStatus.status[1] == true && ServiceCarStatus.status[2] == true && ServiceCarStatus.status[3] == true && ServiceCarStatus.status[4] == true))
|
|
|
- // {
|
|
|
- // //停车
|
|
|
- // ServiceCarStatus.carState = 0;
|
|
|
- // }
|
|
|
- // else if ((ServiceCarStatus.status[0] == false && ServiceCarStatus.status[1] == false && ServiceCarStatus.status[2] == false && ServiceCarStatus.status[3] == false && ServiceCarStatus.status[4] == true) ||
|
|
|
- // (ServiceCarStatus.status[0] == false && ServiceCarStatus.status[1] == true && ServiceCarStatus.status[2] == false && ServiceCarStatus.status[3] == true && ServiceCarStatus.status[4] == true))
|
|
|
- // {
|
|
|
- // //正常循迹
|
|
|
- // ServiceCarStatus.carState = 1;
|
|
|
- // }
|
|
|
- // else if ((ServiceCarStatus.status[0] == false && ServiceCarStatus.status[1] == false && ServiceCarStatus.status[2] == false && ServiceCarStatus.status[3] == true && ServiceCarStatus.status[4] == true) ||
|
|
|
- // (ServiceCarStatus.status[0] == false && ServiceCarStatus.status[1] == true && ServiceCarStatus.status[2] == true && ServiceCarStatus.status[3] == true && ServiceCarStatus.status[4] == true))
|
|
|
- // {
|
|
|
- // //前往站点
|
|
|
- // ServiceCarStatus.carState = 2;
|
|
|
- // }
|
|
|
-
|
|
|
if (obs_lidar_) { //激光雷达有障碍物
|
|
|
// std::cout<<"obs lidar size = "<<obs_lidar_->size()<<std::endl;
|
|
|
//std::cout << "大脑处理激光雷达:" << obs_lidar_->at(0).nomal_x << " " << obs_lidar_->at(0).nomal_y << " " << obs_lidar_->at(0).nomal_z << std::endl;
|
|
@@ -578,30 +568,12 @@ void iv::decition::BrainDecition::run() {
|
|
|
}
|
|
|
//useMobileEye chuku end;
|
|
|
|
|
|
- if (gps_data_ &&!handPark && !ServiceCarStatus.m_bOutGarage){// && obs_lidar_grid_) { //处理GPS数据
|
|
|
- //todo gps_data_为当前读到的gps位置信息
|
|
|
- //decition_gps = iv::decition::Decition(new iv::decition::DecitionBasic);
|
|
|
- //ODS("接收GPS数据:%f\t\t%f\n", gps_data_->gps_x, gps_data_->gps_y);
|
|
|
- // decition_gps = decitionMaker->getDecideForGPS(*gps_data_,navigation_data);
|
|
|
+ givlog->debug("GPS","gps_data_ is: %d,gps_update_period is: %d,gps_last_to_current_times is: %d",gps_data_,gps_update_period,gps_last_to_current_times);
|
|
|
|
|
|
- //ODS("\n接收到的实时GPS数据:%f\t%f\t%f\n", gps_data_->gps_x, gps_data_->gps_y, gps_data_->ins_heading_angle);
|
|
|
+ if (gps_data_ &&!handPark && !ServiceCarStatus.m_bOutGarage){// && obs_lidar_grid_) { //处理GPS数据
|
|
|
|
|
|
- //以下为正常用
|
|
|
- // if (gps_data_->valid == RTK_IMU_OK)
|
|
|
- // {
|
|
|
double start = GetTickCount();
|
|
|
|
|
|
- // decitionGps00->aim_gps_ins.gps_lat = carcall->lat;
|
|
|
- // decitionGps00->aim_gps_ins.gps_lng = carcall->lon;
|
|
|
- /*iv::ObsRadar obs_radar_tmp(new std::vector<iv::ObstacleBasic>);
|
|
|
- if(obs_radar_){
|
|
|
- obs_radar_tmp = NULL;
|
|
|
- obs_radar_tmp.swap(obs_radar_);
|
|
|
- }*/
|
|
|
- //decition_gps = decitionGpsUnit->getDecideFromGPS(*gps_data_, navigation_data, *obs_radar_tmp, obs_lidar_grid_);
|
|
|
- // decition_gps = decitionGpsUnit->getDecideFromGPS(*gps_data_, navigation_data, obs_lidar_grid_); // 新的
|
|
|
-
|
|
|
-
|
|
|
if ( ServiceCarStatus.epsMode==0 && ServiceCarStatus.receiveEps) {
|
|
|
ServiceCarStatus.mbRunPause=true;
|
|
|
|
|
@@ -1361,7 +1333,7 @@ void iv::decition::BrainDecition::Updatev2x(const char *pdata, const int ndatasi
|
|
|
v2x_message.stationid(i),ServiceCarStatus.stationCmd.stationGps[i].gps_lat,
|
|
|
ServiceCarStatus.stationCmd.stationGps[i].gps_lng);
|
|
|
}
|
|
|
- //ServiceCarStatus.mbRunPause=false;
|
|
|
+ ServiceCarStatus.mbRunPause=false;
|
|
|
}
|
|
|
|
|
|
}
|