Pārlūkot izejas kodu

add camera2vehicle coordinate adjust x y to xml

liyupeng 2 gadi atpakaļ
vecāks
revīzija
2b052dbe39

+ 6 - 1
src/decition/common/common/car_status.h

@@ -258,7 +258,12 @@ namespace iv {
         QTime mRSUWarnUpdateTimer;
         QTime mRSUWarnUpdateTimer;
         QTime mRSUTrafficUpdateTimer;
         QTime mRSUTrafficUpdateTimer;
         bool mLightStartSensorBtn=false;
         bool mLightStartSensorBtn=false;
-        bool laneline_drive=false;
+
+        // laneline decition parameters
+        bool laneline_drive=false;  
+        double camera_x_adjust; //camera2vehicle coordinate adjust at x-dim
+        double camera_y_adjust; //camera2vehicle coordinate adjust at y-dim
+
     };
     };
     typedef boost::serialization::singleton<iv::CarStatus> CarStatusSingleton;//非线程安全,注意多线程加锁,单例模式
     typedef boost::serialization::singleton<iv::CarStatus> CarStatusSingleton;//非线程安全,注意多线程加锁,单例模式
 }
 }

+ 2 - 2
src/decition/laneline_decition_brain_sf_changan_shenlan/decition/adc_tools/transfer.cpp

@@ -418,7 +418,7 @@ double iv::decition::GetL0InDegree(double dLIn)
 // 相机转车体
 // 相机转车体
 iv::Point2D iv::decition::camera2vehicle(iv::Point2D point){
 iv::Point2D iv::decition::camera2vehicle(iv::Point2D point){
     iv::Point2D new_point;
     iv::Point2D new_point;
-    new_point.x = point.x-0.4;
-    new_point.y = point.y+6.8;
+    new_point.x = point.x+ServiceCarStatus.msysparam.camera_x_adjust;
+    new_point.y = point.y+ServiceCarStatus.msysparam.camera_y_adjust;
     return new_point;
     return new_point;
 }
 }

+ 7 - 0
src/decition/laneline_decition_brain_sf_changan_shenlan/decition/brain.cpp

@@ -364,6 +364,7 @@ void iv::decition::BrainDecition::run() {
 
 
     mstrmemmap_index = xp.GetParam("msg_mapindex","map_index");
     mstrmemmap_index = xp.GetParam("msg_mapindex","map_index");
     
     
+    // laneline decition parameters
     std::string laneline_drive = xp.GetParam("laneline_drive","true");  //If drive by laneline
     std::string laneline_drive = xp.GetParam("laneline_drive","true");  //If drive by laneline
     if(laneline_drive == "true")
     if(laneline_drive == "true")
     {
     {
@@ -371,6 +372,12 @@ void iv::decition::BrainDecition::run() {
     }else{
     }else{
         ServiceCarStatus.laneline_drive = false;
         ServiceCarStatus.laneline_drive = false;
     }
     }
+    std::string camera_x_adjust = xp.GetParam("camera_x_adjust","0.0");
+    ServiceCarStatus.msysparam.camera_x_adjust = atof(camera_x_adjust.data());
+    std::string camera_y_adjust = xp.GetParam("camera_y_adjust","0.0");
+    ServiceCarStatus.msysparam.camera_y_adjust = atof(camera_y_adjust.data());
+
+
 
 
     givfault->SetFaultState(0,0,"OK.");
     givfault->SetFaultState(0,0,"OK.");