Explorar el Código

fix(brain,controller):change acc factor,change gps speed getting methord in brain.

tianxiaosen hace 3 años
padre
commit
ef02c692a0

+ 4 - 3
src/controller/controller_hapo/main.cpp

@@ -170,7 +170,7 @@ void executeDecition(const iv::brain::decition decition)
     default:
         break;
     }
-    gPlatformFeedback.set_throttle(decition.torque());
+    gPlatformFeedback.set_throttle(decition.torque()*12.5); //12.5 for yuhesen, 8km/h means 100%
     gPlatformFeedback.set_brake(decition.brake());
     gPlatformFeedback.set_steeringwheelangle(decition.wheelangle());
 
@@ -212,9 +212,10 @@ void ListenRemotectrl(const char * strdata,const unsigned int nSize,const unsign
     }
     else
     {
+        std::cout<<" remote acc: "<<xrc.acc()<<" wheel"<<xrc.wheel()<<" brake: "<<xrc.brake()<< std::endl;
         gbAutoDriving = false;
         gPlatformFeedback.set_typefeedback(iv::platformFeedback::ctrlType::platformFeedback_ctrlType_REMOTE);
-        xdecition.set_torque(xrc.acc());
+        xdecition.set_torque(xrc.acc()*0.08);
         xdecition.set_brake(xrc.brake());
         xdecition.set_wheelangle(xrc.wheel()*5.5f);
         if(xrc.shift() > 0) //D shift
@@ -298,7 +299,7 @@ void ExecSend()
     int a = ServiceControlStatus.command11.byte[5]&0x0f;
     if(a != 0x04)
     {
-        qDebug("not D.");
+//        qDebug("not D.");
     }
     xraw.set_bext(false);
     xraw.set_bremote(false);

+ 2 - 1
src/decition/common/perception_sf/impl_gps.cpp

@@ -322,7 +322,7 @@ void iv::perception::GPSSensor::UpdateGPSIMU(iv::gps::gpsimu xgpsimu)
     data->ins_pitch_angle = xgpsimu.pitch();
     data->ins_roll_angle = xgpsimu.roll();
 
-    data->speed = sqrt(pow(xgpsimu.ve(),2)+pow(xgpsimu.vn(),2)) * 3.6;
+    data->speed = xgpsimu.speed(); //sqrt(pow(xgpsimu.ve(),2)+pow(xgpsimu.vn(),2)) * 3.6;
 
     GaussProjCal(data->gps_lng, data->gps_lat, &data->gps_x, &data->gps_y);
 
@@ -331,6 +331,7 @@ void iv::perception::GPSSensor::UpdateGPSIMU(iv::gps::gpsimu xgpsimu)
     ServiceCarStatus.mfGPSAcc = xgpsimu.acc_calc();
 
     ServiceCarStatus.speed = data->speed;
+    if(ServiceCarStatus.speed < 0.015)ServiceCarStatus.speed = 0.0;
 //       qDebug("speed x is %g",ServiceCarStatus.speed);
     if(data->ins_status == 4)
         signal_gps_data->operator()(data);	//传输数据

+ 1 - 1
src/decition/decition_brain_sf_jsguide/decition/brain.cpp

@@ -512,7 +512,7 @@ void iv::decition::BrainDecition::run() {
         {
                 ServiceCarStatus.mbRunPause=true;
              //待命停车
-                if(ServiceCarStatus.mbOvertimeCnt<=1000)//待命计时
+                if(ServiceCarStatus.mbOvertimeCnt<=3000)//待命计时
                 {
                     ServiceCarStatus.mbOvertimeCnt++;
                 }