|
@@ -16,6 +16,7 @@
|
|
|
#include <decition/adc_planner/lane_change_planner.h>
|
|
|
#include <decition/adc_planner/frenet_planner.h>
|
|
|
#include <QTime>
|
|
|
+#include <iomanip>
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
@@ -1116,8 +1117,8 @@ iv::decition::Decition iv::decition::DecideGps00::getDecideFromGPS(GPS_INS now_g
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- givlog->debug("brain_decition","vehState: %d,controlAng: %f",
|
|
|
- vehState,controlAng);
|
|
|
+// givlog->debug("brain_decition","vehState: %d,controlAng: %f",
|
|
|
+// vehState,controlAng);
|
|
|
|
|
|
|
|
|
//准备驻车
|
|
@@ -1168,18 +1169,6 @@ iv::decition::Decition iv::decition::DecideGps00::getDecideFromGPS(GPS_INS now_g
|
|
|
readyZhucheMode = false;
|
|
|
cout<<"jinru ZHECHE STATE+++++++++++++++++++++++++++++++++"<<endl;
|
|
|
|
|
|
- //1125
|
|
|
- // gps_decition->brake=20;
|
|
|
- // gps_decition->accelerator = -3;
|
|
|
- // gps_decition->wheel_angle = 0-controlAng;
|
|
|
- // gps_decition->speed = 0;
|
|
|
- // gps_decition->torque=0;
|
|
|
- // return gps_decition;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -1326,8 +1315,8 @@ iv::decition::Decition iv::decition::DecideGps00::getDecideFromGPS(GPS_INS now_g
|
|
|
|
|
|
dSpeed = limitSpeed(controlAng, dSpeed);
|
|
|
dSecSpeed = dSpeed / 3.6;
|
|
|
- givlog->debug("brain_decition_speed","dspeed: %f",
|
|
|
- dSpeed);
|
|
|
+// givlog->debug("brain_decition_speed","dspeed: %f",
|
|
|
+// dSpeed);
|
|
|
|
|
|
|
|
|
if(vehState==changingRoad){
|
|
@@ -1884,7 +1873,6 @@ iv::decition::Decition iv::decition::DecideGps00::getDecideFromGPS(GPS_INS now_g
|
|
|
}else if(obsDistance>0 && obsDistance<15){
|
|
|
dSpeed=0;
|
|
|
}
|
|
|
- // obsDistance=-1; //1227
|
|
|
|
|
|
if(ServiceCarStatus.group_control){
|
|
|
dSpeed = ServiceCarStatus.group_comm_speed;
|
|
@@ -1893,21 +1881,24 @@ iv::decition::Decition iv::decition::DecideGps00::getDecideFromGPS(GPS_INS now_g
|
|
|
minDecelerate=min(-1.0f,minDecelerate);
|
|
|
}
|
|
|
|
|
|
- std::cout<<"dSpeed= "<<dSpeed<<std::endl;
|
|
|
-
|
|
|
- // givlog->debug("SPEED","dSpeed is %f",dSpeed);
|
|
|
-
|
|
|
- std::cout<<"obs_distance++++++++++++++++++++++++++++++++++="<<obsDistance<<std::endl;
|
|
|
-
|
|
|
gps_decition->wheel_angle = 0.0 - controlAng;
|
|
|
phaseSpeedDecition(gps_decition, secSpeed, obsDistance, obsSpeed,now_gps_ins);
|
|
|
|
|
|
|
|
|
+ givlog->debug("decition_brain","vehState: %d,PathPoint: %d,dSpeed: %f,obsDistance: %f,obsSpeed: %f,realspeed: %f,minDecelerate: %f,torque: %f,brake: %f,wheel_angle: %f",
|
|
|
+ vehState,PathPoint,dSpeed,obsDistance,obsSpeed,realspeed,minDecelerate,gps_decition->torque,gps_decition->brake,gps_decition->wheel_angle);
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ if(ServiceCarStatus.txt_log_on==true){
|
|
|
+ QDateTime dt = QDateTime::currentDateTime();
|
|
|
+ //将数据写入文件开始
|
|
|
+ ofstream outfile;
|
|
|
+ outfile.open("control_log.txt", ostream::app);
|
|
|
+ outfile<<dt.date().year()<<"-"<<dt.date().month()<<"-"<<dt.date().day()<<" "<<dt.time().hour()<<":"<<dt.time().minute()<<":"<<dt.time().second()<<"-"<<dt.time().msec()<<'\t'
|
|
|
+ <<vehState<<'\t'<<PathPoint<<'\t'<<setprecision(4)<<dSpeed<<'\t'<<obsDistance<<'\t'<<obsSpeed<<'\t'<<realspeed<<'\t'<<minDecelerate<<'\t'
|
|
|
+ <<gps_decition->torque<<'\t'<<gps_decition->brake<<'\t'<<gps_decition->wheel_angle<<endl;
|
|
|
+ outfile.close();
|
|
|
+ //将数据写入文件结束
|
|
|
+ }
|
|
|
|
|
|
|
|
|
lastAngle=gps_decition->wheel_angle;
|
|
@@ -3654,8 +3645,8 @@ void iv::decition::DecideGps00::transferGpsMode2( const std::vector<GPSData> gps
|
|
|
obsDistance=200;
|
|
|
}
|
|
|
dSpeed=min(dSpeed,5.0);
|
|
|
- givlog->debug("brain_decition","mode2: %d",
|
|
|
- gpsMapLine[PathPoint]->mode2);
|
|
|
+// givlog->debug("brain_decition","mode2: %d",
|
|
|
+// gpsMapLine[PathPoint]->mode2);
|
|
|
|
|
|
}
|
|
|
else if(gpsMapLine[PathPoint]->mode2==3001){
|