Przeglądaj źródła

add hapo station

zhangjia 4 lat temu
rodzic
commit
878b42fa22

+ 20 - 12
autogen.sh

@@ -1,7 +1,7 @@
 
-#qtmake="/opt/Qt5.10.1/5.10.1/gcc_64/bin/qmake"
+qtmake="/opt/Qt5.10.1/5.10.1/gcc_64/bin/qmake"
 #qtmake=/usr/bin/qmake
-qtmake="/usr/lib/aarch64-linux-gnu/qt5/bin/qmake"
+#qtmake="/usr/lib/aarch64-linux-gnu/qt5/bin/qmake"
 if [ ! $qtmake ];then
 	echo -e "\e[33m qtmake not set, auto find it\e[0m"
 	qtmake=`find /opt -name "qmake" 2>/dev/null | grep 'gcc_64'`
@@ -84,15 +84,15 @@ rm Makefile
 rm .qmake.stash
 cd ../../../
 
-cd src/common/ndt_cpu/
-$qtmake ndt_cpu.pro
-make $MAKEOPT
-check_result $?
-make clean
-cp libndt_cpu.so ./../../../bin/
-rm Makefile
-rm .qmake.stash
-cd ../../../
+#cd src/common/ndt_cpu/
+#$qtmake ndt_cpu.pro
+#make $MAKEOPT
+#check_result $?
+#make clean
+#cp libndt_cpu.so ./../../../bin/
+#rm Makefile
+#rm .qmake.stash
+#cd ../../../
 
 cd src/common/ivfault/
 $qtmake ivfault.pro
@@ -134,7 +134,15 @@ rm Makefile
 rm .qmake.stash
 cd ../../../
 
-
+cd src/common/ivlog/
+$qtmake ivlog.pro
+make $MAKEOPT
+check_result $?
+make clean
+cp libivlog.so ./../../../bin/
+rm Makefile
+rm .qmake.stash
+cd ../../../
 
 controller_app_name=(
 	controller_ge3

+ 45 - 0
src/decition/decition_brain/decition/decide_gps_00.cpp

@@ -1870,7 +1870,52 @@ iv::decition::Decition iv::decition::DecideGps00::getDecideFromGPS(GPS_INS now_g
     return gps_decition;
 }
 
+iv::Station iv::decition::DecideGps00::getNearestStation(iv::GPS_INS now_gps_ins,std::vector<Station> station_n,std::vector<GPSData> gpsMap){
 
+    int now_index=0,front_index=0;
+    int station_size=station_n.size();
+
+    for(int i=0;i<station_size;i++)
+    {
+        int minDistance=10;
+        for (int j = 0; j < gpsMap.size(); j++)
+        {
+            double tmpdis = GetDistance(station_n[i].station_location, (*gpsMap[j]));
+            if (tmpdis < minDistance )
+            {
+                minDistance = tmpdis;
+                station_n[i].map_index=j;
+            }
+        }
+    }
+    int minDistance=10;
+    for (int j = 0; j < gpsMap.size(); j++)
+    {
+        double tmpdis = GetDistance(now_gps_ins, (*gpsMap[j]));
+        if (tmpdis < minDistance )
+        {
+            minDistance = tmpdis;
+            now_index=j;
+        }
+    }
+    int min_index=gpsMap.size()-1;
+    int station_index=0;
+    for(int i=0;i<station_size;i++)
+    {
+          if(station_n[i].map_index>now_index)
+          {
+                front_index=station_n[i].map_index;
+                if(front_index<min_index)
+                {
+                    min_index=front_index;
+                    station_index=i;
+                }
+          }
+    }
+
+    return station_n[station_index];
+
+}
 
 void iv::decition::DecideGps00::initMethods(){
 

+ 2 - 0
src/decition/decition_brain/decition/decide_gps_00.h

@@ -205,6 +205,8 @@ public:
     float computeTrafficSpeedLimt(float trafficDis);
     void adjuseGpsLidarPosition();
 
+    iv::Station getNearestStation(iv::GPS_INS now_gps_ins,std::vector<Station> station_n,std::vector<GPSData> gpsMap);
+
     GPS_INS aim_gps_ins;
     GPS_INS chaoche_start_gps;
     bool is_arrivaled=false;