Browse Source

change decison_brain. cheange boche.

yuchuli 1 year ago
parent
commit
63a31637a8

+ 165 - 0
deploy/LGPL/LGPL-3

@@ -0,0 +1,165 @@
+                   GNU LESSER GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+  This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+  0. Additional Definitions.
+
+  As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+  "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+  An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+  A "Combined Work" is a work produced by combining or linking an
+Application with the Library.  The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+  The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+  The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+  1. Exception to Section 3 of the GNU GPL.
+
+  You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+  2. Conveying Modified Versions.
+
+  If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+   a) under this License, provided that you make a good faith effort to
+   ensure that, in the event an Application does not supply the
+   function or data, the facility still operates, and performs
+   whatever part of its purpose remains meaningful, or
+
+   b) under the GNU GPL, with none of the additional permissions of
+   this License applicable to that copy.
+
+  3. Object Code Incorporating Material from Library Header Files.
+
+  The object code form of an Application may incorporate material from
+a header file that is part of the Library.  You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+   a) Give prominent notice with each copy of the object code that the
+   Library is used in it and that the Library and its use are
+   covered by this License.
+
+   b) Accompany the object code with a copy of the GNU GPL and this license
+   document.
+
+  4. Combined Works.
+
+  You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+   a) Give prominent notice with each copy of the Combined Work that
+   the Library is used in it and that the Library and its use are
+   covered by this License.
+
+   b) Accompany the Combined Work with a copy of the GNU GPL and this license
+   document.
+
+   c) For a Combined Work that displays copyright notices during
+   execution, include the copyright notice for the Library among
+   these notices, as well as a reference directing the user to the
+   copies of the GNU GPL and this license document.
+
+   d) Do one of the following:
+
+       0) Convey the Minimal Corresponding Source under the terms of this
+       License, and the Corresponding Application Code in a form
+       suitable for, and under terms that permit, the user to
+       recombine or relink the Application with a modified version of
+       the Linked Version to produce a modified Combined Work, in the
+       manner specified by section 6 of the GNU GPL for conveying
+       Corresponding Source.
+
+       1) Use a suitable shared library mechanism for linking with the
+       Library.  A suitable mechanism is one that (a) uses at run time
+       a copy of the Library already present on the user's computer
+       system, and (b) will operate properly with a modified version
+       of the Library that is interface-compatible with the Linked
+       Version.
+
+   e) Provide Installation Information, but only if you would otherwise
+   be required to provide such information under section 6 of the
+   GNU GPL, and only to the extent that such information is
+   necessary to install and execute a modified version of the
+   Combined Work produced by recombining or relinking the
+   Application with a modified version of the Linked Version. (If
+   you use option 4d0, the Installation Information must accompany
+   the Minimal Corresponding Source and Corresponding Application
+   Code. If you use option 4d1, you must provide the Installation
+   Information in the manner specified by section 6 of the GNU GPL
+   for conveying Corresponding Source.)
+
+  5. Combined Libraries.
+
+  You may place library facilities that are a work based on the
+Library side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+   a) Accompany the combined library with a copy of the same work based
+   on the Library, uncombined with any other library facilities,
+   conveyed under the terms of this License.
+
+   b) Give prominent notice with the combined library that part of it
+   is a work based on the Library, and explaining where to find the
+   accompanying uncombined form of the same work.
+
+  6. Revised Versions of the GNU Lesser General Public License.
+
+  The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+  Each version is given a distinguishing version number. If the
+Library as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+  If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.

+ 2 - 0
deploy/LGPL/Readme.txt

@@ -0,0 +1,2 @@
+1.本软件使用Qt开发,遵守LGPL v3协议。
+2.本软件用到了QtCore,QtNetWork,QtWidget等Qt库。

+ 109 - 0
src1/decision/common/adc_decision_function/ivpark_simple.cpp

@@ -0,0 +1,109 @@
+#include "ivpark_simple.h"
+
+#include "gps_type.h"
+#include "adc_tools/compute_00.h"
+
+using namespace  iv;
+
+ivpark_simple::ivpark_simple()
+{
+
+}
+
+bool ivpark_simple::IsBocheEnable(double fLon, double fLat, double fHeading)
+{
+    GPS_INS nowgps,aimgps;
+    std::vector<std::vector<GPS_INS>> xvectordTPoint;
+    std::vector<double> xvectorRearDis;
+    std::vector<double> xvectorAngle;
+    std::vector<int> xvectortype;
+    std::vector<iv::simpleparkspace> xvectorsimpleparkspace = GetParkSpace();
+    xvectordTPoint.clear();
+    xvectorRearDis.clear();
+    xvectorAngle.clear();
+    unsigned int i;
+    unsigned int nsize = static_cast<unsigned int >(xvectorsimpleparkspace.size());
+    nowgps.gps_lat = fLat;
+    nowgps.gps_lng = fLon;
+    nowgps.ins_heading_angle = fHeading;
+    for(i=0;i<nsize;i++)
+    {
+        iv::simpleparkspace xpark = xvectorsimpleparkspace[i];
+        iv::GPS_INS aimgps;
+        aimgps.gps_lat = xpark.mfLat;
+        aimgps.gps_lng = xpark.mfLon;
+        aimgps.ins_heading_angle = xpark.mfHeading;
+        std::vector<GPS_INS> TPoints;
+        double fRearDis,fAngle;
+        if(xpark.mnParkType == 1)  //side park
+        {
+            if(iv::decition::Compute00().bocheDirectCompute(nowgps,aimgps,TPoints,fAngle,fRearDis) == 1)
+            {
+                xvectordTPoint.push_back(TPoints);
+                xvectorAngle.push_back(fAngle);
+                xvectorRearDis.push_back(fRearDis);
+                xvectortype.push_back(1);
+            }
+        }
+        if(xpark.mnParkType == 0)
+        {
+
+        }
+    }
+
+    nsize = static_cast<unsigned int >(xvectordTPoint.size());
+
+    if(nsize<1)
+    {
+        return false;
+    }
+
+    unsigned int nsel = 0;
+    //Select rear dis >1.0 and small
+    for(i =1;i<nsize;i++)
+    {
+        if((xvectorRearDis[i] < xvectorRearDis[nsel])&&(xvectorRearDis[i]>1.0))
+        {
+            nsel = i;
+        }
+        else
+        {
+            if(xvectorRearDis[i]<1.0)
+            {
+                if(xvectorRearDis[nsel]>5.0)
+                {
+                    nsel = i;
+                }
+            }
+            else
+            {
+                if((xvectorRearDis[i]<3.0)&&(xvectorRearDis[nsel]<0.5))
+                {
+                    nsel = i;
+                }
+            }
+        }
+    }
+
+    if(xvectortype[nsel] == 0)
+    {
+        iv::decition::Compute00().nearTpoint = xvectordTPoint[nsel].at(0);
+        iv::decition::Compute00().farTpoint = xvectordTPoint[nsel].at(1);
+        iv::decition::Compute00().bocheAngle = xvectorAngle[nsel];
+        iv::decition::Compute00().nParkType = 0;
+    }
+
+    if(xvectortype[nsel] == 1)
+    {
+        iv::decition::Compute00().dTpoint0 = xvectordTPoint[nsel].at(0);
+        iv::decition::Compute00().dTpoint1 = xvectordTPoint[nsel].at(0);
+        iv::decition::Compute00().dTpoint2 = xvectordTPoint[nsel].at(0);
+        iv::decition::Compute00().dTpoint3 = xvectordTPoint[nsel].at(0);
+        iv::decition::Compute00().bocheAngle = xvectorAngle[nsel];
+        iv::decition::Compute00().nParkType = 1;
+    }
+
+
+
+    return true;
+}

+ 16 - 0
src1/decision/common/adc_decision_function/ivpark_simple.h

@@ -0,0 +1,16 @@
+#ifndef IVPARK_SIMPLE_H
+#define IVPARK_SIMPLE_H
+
+#include "ivif_park.h"
+
+class ivpark_simple : public ivif_park
+{
+public:
+    ivpark_simple();
+
+public:
+    virtual bool IsBocheEnable(double fLon, double fLat, double fHeading);
+
+};
+
+#endif // IVPARK_SIMPLE_H

+ 253 - 0
src1/decision/common/adc_tools/compute_00.cpp

@@ -56,6 +56,7 @@ iv::GPS_INS  iv::decition::Compute00::dTpoint1;
 iv::GPS_INS  iv::decition::Compute00::dTpoint2;
 iv::GPS_INS  iv::decition::Compute00::dTpoint3;
 double  iv::decition::Compute00::dBocheAngle;
+int  iv::decition::Compute00::nParkType;
 
 
 std::vector<int> lastEsrIdVector;
@@ -1378,6 +1379,183 @@ double iv::decition::Compute00::getDecideAngleByLanePID(double realSpeed) {
     return ang;
 }
 
+int iv::decition::Compute00::bocheCompute(GPS_INS nowGps,GPS_INS aimGps,std::vector<GPS_INS> & xvectorPoint,double & dBocheAngle,double & fDirectRearDis,double l)
+{
+    GaussProjCal(aimGps.gps_lng, aimGps.gps_lat, &aimGps.gps_x, &aimGps.gps_y);
+    Point2D pt = Coordinate_Transfer(nowGps.gps_x, nowGps.gps_y, aimGps);
+
+    double x_1 = pt.x;
+    double y_1 = pt.y;
+    double angle_1 = getQieXianAngle(nowGps,aimGps);
+    double x_2 = 0.0, y_2 = 0.0;
+    double steering_angle;
+    double r =6;
+    double x_o, y_o, x_o_1, y_o_1, x_o_2, y_o_2, x_3, y_3;
+    double x_t_n, y_t_n, x_t_f, y_t_f;//近切点和远切点
+    double x_t_1, y_t_1, x_t_2, y_t_2;//圆形1的切点
+    double x_t_3, y_t_3, x_t_4, y_t_4;//圆形2的切点
+    double g_1 = tan(angle_1);
+    double car_pos[3] = { x_1,y_1,g_1 };
+    double parking_pos[2] = { x_2,y_2 };
+    double g_3;
+    double t[4][2];
+    double p[4];
+    double  s1, s2; //切点与车起始位置的距离
+    double  min;
+    int  min_i;
+
+    //g_3 = 0 - 0.5775;
+    g_3 = pingfenxian_xielv(x_1, y_1, x_2, y_2, angle_1);
+    //交点
+    x_3 = 0.0;//(y_1 - y_2 + g_2*x_2 - g_1*x_1) / (g_2 - g_1);
+    y_3 = y_1 - g_1 * x_1;
+    //圆心1
+    x_o_1 = r;
+    y_o_1 = g_3 * r + y_3;
+    //圆形1的切点1
+    x_t_1 = 0.0;
+    y_t_1 = g_3 * r + y_3;
+    //圆形1的切点2
+    if (g_1 == 0)
+    {
+        x_t_2 = r;
+        y_t_2 = y_1 - g_1 * x_1;
+    }
+    else
+    {
+        y_t_2 = (y_1 + g_1 * x_o_1 + y_o_1 * g_1*g_1 - g_1 * x_1) / (1 + g_1 * g_1);
+        x_t_2 = (y_t_2 + g_1 * x_1 - y_1) / g_1;
+
+    }
+    //圆心2
+    x_o_2 = 0 - r;
+    y_o_2 = y_3 - g_3 * r;
+    //圆形2的切点1
+    x_t_3 = 0;
+    y_t_3 = y_3 - g_3 * r;
+    //圆形2的切点2
+    if (g_1 == 0)
+    {
+        x_t_4 = 0 - r;
+        y_t_4 = y_1 - g_1 * x_1;
+    }
+    else
+    {
+        y_t_4 = (y_1 + g_1 * x_o_2 + y_o_2 * g_1*g_1 - g_1 * x_1) / (1 + g_1 * g_1);
+        x_t_4 = (y_t_4 + g_1 * x_1 - y_1) / g_1;
+
+    }
+    t[0][0] = x_t_1;
+    t[0][1] = y_t_1;
+    t[1][0] = x_t_2;
+    t[1][1] = y_t_2;
+    t[2][0] = x_t_3;
+    t[2][1] = y_t_3;
+    t[3][0] = x_t_4;
+    t[3][1] = y_t_4;
+    for (int i = 0; i < 4; i++)
+    {
+
+        p[i] = (t[i][0] - parking_pos[0])*(t[i][0] - parking_pos[0]) + (t[i][1] - parking_pos[1])*(t[i][1] - parking_pos[1]);
+
+    }
+    min = p[0];
+    min_i = 0;
+    for (int i = 1; i < 4; i++)
+    {
+
+        if (p[i] < min)
+        {
+            min = p[i]; min_i = i;
+        }
+    }
+    if (min_i < 2)
+    {
+        x_o = x_o_1;
+        y_o = y_o_1;
+        s1 = (x_t_1 - x_1)*(x_t_1 - x_1) + (y_t_1 - y_1)*(y_t_1 - y_1);
+        s2 = (x_t_2 - x_1)*(x_t_2 - x_1) + (y_t_2 - y_1)*(y_t_2 - y_1);
+        if (s1 < s2)
+        {
+            x_t_n = x_t_1;
+            y_t_n = y_t_1;
+            x_t_f = x_t_2;
+            y_t_f = y_t_2;
+        }
+        else
+        {
+            x_t_n = x_t_2;
+            y_t_n = y_t_2;
+            x_t_f = x_t_1;
+            y_t_f = y_t_1;
+
+        }
+    }
+    else
+    {
+        x_o = x_o_2;
+        y_o = y_o_2;
+        s1 = (x_t_3 - x_1)*(x_t_3 - x_1) + (y_t_3 - y_1)*(y_t_3 - y_1);
+        s2 = (x_t_4 - x_1)*(x_t_4 - x_1) + (y_t_4 - y_1)*(y_t_4 - y_1);
+
+        if (s1 < s2)
+        {
+
+            x_t_n = x_t_3;
+            y_t_n = y_t_3;
+            x_t_f = x_t_4;
+            y_t_f = y_t_4;
+        }
+        else
+        {
+            x_t_n = x_t_4;
+            y_t_n = y_t_4;
+            x_t_f = x_t_3;
+            y_t_f = y_t_3;
+        }
+
+
+
+
+    }
+    steering_angle = atan2(l, r);
+
+    if (x_t_n < 0)
+    {
+        steering_angle = 0 - steering_angle;
+    }
+
+    nearTpoint=Coordinate_UnTransfer(x_t_n, y_t_n, aimGps);
+    farTpoint = Coordinate_UnTransfer(x_t_f, y_t_f, aimGps);
+    bocheAngle = steering_angle*180/PI;
+
+
+
+
+    //    if (x_1 < 0 && y_1 > 0 && x_1 < x_t_n &&y_t_f > 0.1) {
+    //        return 1;
+    //    }
+    Point2D ptN = Coordinate_Transfer(nearTpoint.gps_x, nearTpoint.gps_y, nowGps);
+    double disA = GetDistance(aimGps,nowGps);
+    if(y_t_n>0 && ptN.y<0 && y_t_f>0.1 && disA<40){
+
+
+        dBocheAngle = bocheAngle;
+        fDirectRearDis = sqrt(pow(pt.x - x_t_n,2)+ pow(pt.y - y_t_n,2));
+        xvectorPoint.push_back(nearTpoint);
+        xvectorPoint.push_back(farTpoint);
+        cout << "近切点:x_t_n=" << x_t_n << endl;
+        cout << "近切点:y_t_n=" << y_t_n << endl;
+        cout << "远切点:x_t_f=" << x_t_f << endl;
+        cout << "远切点:y_t_f=" << y_t_f << endl;
+        cout << "航向角:" << steering_angle << endl;
+
+
+        return 1;
+    }
+
+    return 0;
+}
 
 
 double iv::decition::Compute00::bocheCompute(GPS_INS nowGps, GPS_INS aimGps) {
@@ -1649,6 +1827,81 @@ double iv::decition::Compute00::getQieXianAngle(GPS_INS nowGps, GPS_INS aimGps)
   */
 
 
+int iv::decition::Compute00::bocheDirectCompute(GPS_INS nowGps,GPS_INS aimGps,std::vector<GPS_INS> & xvectorPoint,double & dBocheAngle,double & fDirectRearDis,double l)
+{
+    double x_0 = 0, y_0 = 0.5;
+    double x_1, y_1;//车起点坐标
+    double ange1;//车航向角弧度
+    double x_2, y_2;//另一条与车直线在angle2和R_M 固定情况下过坐标点,第二个近切点
+    double real_rad;;//另一条直线的航向角弧度
+    double angle_3;//垂直平分线弧度
+    double x_3, y_3;//垂直平分线交点
+    double x_4, y_4;//另一条直线的远切点坐标,第二个远切点,已知
+    double x_o_1, y_o_1;//圆形1坐标
+    double x_o_2, y_o_2;//圆形2坐标
+    double x_t_n, y_t_n, x_t_f, y_t_f;//近切点和远切点
+    double min_rad;
+    double R_M; //后轴中点的转弯半径
+    double steering_angle;
+
+    xvectorPoint.clear();
+
+
+    GaussProjCal(aimGps.gps_lng, aimGps.gps_lat, &aimGps.gps_x, &aimGps.gps_y);
+    Point2D pt = Coordinate_Transfer(nowGps.gps_x, nowGps.gps_y, aimGps);
+    x_1=pt.x;
+    y_1=pt.y;
+    ange1=getQieXianAngle(nowGps,aimGps);
+
+    min_rad_zhuanxiang(&R_M , &min_rad);
+    qiedian_n(x_1,y_1,R_M,min_rad,&x_2 , &y_2, &real_rad);//计算另一条与车直线在angle2和R_M 固定情况下近切点:x_2, y_2
+    liangzhixian_jiaodian( x_1, y_1,  x_2, y_2,ange1,real_rad,&x_3 , &y_3);
+    chuizhipingfenxian_xielv( x_1, y_1, ange1, real_rad, min_rad,&angle_3);
+    yuanxin( x_2, y_2, x_3, y_3, real_rad, angle_3, R_M,&x_o_1,&y_o_1,&x_o_2,&y_o_2);
+    yuanxin_qiedian( ange1, x_o_1, y_o_1,  x_o_2, y_o_2,
+                     x_1, y_1, x_2, y_2, x_3, y_3, real_rad, angle_3, R_M,&x_t_n,&y_t_n,&x_t_f, &y_t_f);
+    steering_angle = atan2(l, R_M);
+    x_4 = 0.5;
+    y_4 = 0;
+    //for (int i = 0; i < 4; i++)
+    //{
+    //for (int j = 0; j < 2; j++)
+    //{
+    //	cout << t[i][j] << endl;
+    //}
+    //}
+    //cout << "min_rad:" << min_rad<< endl;
+    //cout << "jiaodian:x=" << x_3 << endl;
+    //cout << "jiaodian:y=" << y_3 << endl;
+    // cout << "R-M:" << R_M << endl;
+
+
+
+
+    dTpoint0=Coordinate_UnTransfer(x_t_n, y_t_n, aimGps);
+    dTpoint1 = Coordinate_UnTransfer(x_t_f, y_t_f, aimGps);
+    dTpoint2 = Coordinate_UnTransfer(x_2, y_2, aimGps);
+    dTpoint3 = Coordinate_UnTransfer(x_0, y_0, aimGps);
+    dBocheAngle = steering_angle*180/PI;
+
+    double disA = GetDistance(aimGps,nowGps);
+
+    if(pt.y>y_t_n && x_t_f<x_2 && y_t_f>y_2&&disA<40){
+        cout << "x_0:" << x_0 << endl;
+        cout << "y_0:" << y_0 << endl;
+        cout << "x_2:" << x_2 << endl;
+        cout << "y_2:" << y_2 << endl;
+        cout << "近切点:x_t_n="<< x_t_n << endl;
+        cout << "近切点:y_t_n=" << y_t_n << endl;
+        cout << "远切点:x_t_f=" << x_t_f << endl;
+        cout << "远切点:y_t_f=" << y_t_f << endl;
+        xvectorPoint.push_back(dTpoint0);xvectorPoint.push_back(dTpoint1);xvectorPoint.push_back(dTpoint2);xvectorPoint.push_back(dTpoint3);
+        fDirectRearDis = sqrt(pow(pt.x - x_t_n,2) + pow(pt.y - y_t_n,2));
+        return 1;
+    }
+    return 0;
+}
+
 int iv::decition::Compute00::bocheDirectCompute(GPS_INS nowGps, GPS_INS aimGps)
 {
 

+ 8 - 0
src1/decision/common/adc_tools/compute_00.h

@@ -32,6 +32,7 @@ namespace iv {
 
             static iv::GPS_INS nearTpoint, farTpoint,dTpoint0,dTpoint1,dTpoint2,dTpoint3;
             static double bocheAngle,dBocheAngle;
+            static int nParkType;
 
             static	int getNearestPointIndex(GPS_INS rp, const std::vector<GPSData> gpsMap, int lastIndex, double mindis, double maxAngle);
             static	int getFirstNearestPointIndex(GPS_INS rp, std::vector<GPSData> gpsMap, int lastIndex, double mindis, double maxAngle);
@@ -64,12 +65,19 @@ namespace iv {
 
             static double bocheCompute(GPS_INS nowGps, GPS_INS aimGps);
 
+            //xvectorPoint save qiedianpoint;   dBocheAngle wheel angle;    fDirectRearDis first rear dis.
+            static int bocheCompute(GPS_INS nowGps,GPS_INS aimGps,std::vector<GPS_INS> & xvectorPoint,double & dBocheAngle,double & fDirectRearDis,double l = 2.95);
+
+
             static	double pingfenxian_xielv(double x_1, double y_1, double x_2, double y_2, double angle_1);
 
             static double getQieXianAngle(GPS_INS nowGps, GPS_INS aimGps);
 
             static int bocheDirectCompute(GPS_INS nowGps, GPS_INS aimGps);
 
+            //xvectorPoint save qiedianpoint;   dBocheAngle wheel angle;    fDirectRearDis first rear dis.
+            static int bocheDirectCompute(GPS_INS nowGps,GPS_INS aimGps,std::vector<GPS_INS> & xvectorPoint,double & dBocheAngle,double & fDirectRearDis,double l = 2.95);
+
             static double min_rad_zhuanxiang(double *R_M, double *min_rad);
             static double qiedian_n(double x_1,double y_1,double R_M,double min_rad,
                                     double *x_2, double *y_2, double *real_rad);

+ 7 - 1
src1/decision/decision_brain/decision_brain.pro

@@ -11,7 +11,7 @@ DEFINES += QT_DEPRECATED_WARNINGS
 
 #DEFINES += USE_PLUS_MODULECOMM
 
-LIBS += -L$$PWD -lfastcdr -lfastrtps
+#LIBS += -L$$PWD -lfastcdr -lfastrtps
 
 # You can also make your code fail to compile if it uses deprecated APIs.
 # In order to do so, uncomment the following line.
@@ -69,6 +69,10 @@ else: unix:!android: target.path = /opt/$${TARGET}/bin
 
 }
 
+!include(../common/adc_decision_function/adc_decision_function.pri ) {
+    error( "Couldn't find the adc_decision_function.pri file!" )
+}
+
 INCLUDEPATH += $$PWD/../../../include
 
 INCLUDEPATH += $$PWD/../interface
@@ -118,3 +122,5 @@ INCLUDEPATH += $$PWD/../common
 INCLUDEPATH += $$PWD/../common/common
 INCLUDEPATH += $$PWD/../../types
 INCLUDEPATH += $$PWD/../../math
+
+INCLUDEPATH += $$PWD/../common/adc_toos

+ 4 - 4
src1/decision/interface/ivdecision.cpp

@@ -86,11 +86,11 @@ void ivdecision::modulerun()
 
 void ivdecision::sharemsg(brain::decition &xdecition, brain::brainstate &xbs)
 {
-    int nsize = xdecition.ByteSize();
+    unsigned int nsize = static_cast<unsigned int>(xdecition.ByteSize());
     char * str = new char[nsize];
     std::shared_ptr<char> pstr;
     pstr.reset(str);
-    if(xdecition.SerializeToArray(str,nsize))
+    if(xdecition.SerializeToArray(str,static_cast<int>(nsize) ))
     {
 //        if(ServiceCarStatus.mbRunPause == false)
 //        {
@@ -103,11 +103,11 @@ void ivdecision::sharemsg(brain::decition &xdecition, brain::brainstate &xbs)
         std::cout<<"iv::decition::BrainDecition::ShareDecition serialize error."<<std::endl;
     }
 
-    nsize = xbs.ByteSize();
+    nsize = static_cast<unsigned int>(xbs.ByteSize());
     str = new char[nsize];
  //   std::shared_ptr<char> pstr;
     pstr.reset(str);
-    if(xbs.SerializeToArray(str,nsize))
+    if(xbs.SerializeToArray(str,static_cast<int>(nsize)))
     {
         iv::modulecomm::ModuleSendMsg(mpaVechicleState,str,nsize);
     }

+ 4 - 2
src1/decision/interface/ivdecision.pri

@@ -18,7 +18,8 @@ HEADERS += \
     $$PWD/../../../src/include/msgtype/vbox.pb.h \
     $$PWD/../../interface/ivmodule.h \
     $$PWD/../../math/gnss_coordinate_convert.h \
-    $$PWD/ivdecision.h
+    $$PWD/ivdecision.h \
+    $$PWD/ivif_park.h
 
 SOURCES += \
     $$PWD/../../../src/include/msgtype/brainstate.pb.cc \
@@ -40,7 +41,8 @@ SOURCES += \
     $$PWD/../../../src/include/msgtype/vbox.pb.cc \
     $$PWD/../../interface/ivmodule.cpp \
     $$PWD/../../math/gnss_coordinate_convert.cpp \
-    $$PWD/ivdecision.cpp
+    $$PWD/ivdecision.cpp \
+    $$PWD/ivif_park.cpp
 
 INCLUDEPATH += $$PWD/../interface
 INCLUDEPATH += $$PWD/../../interface

+ 29 - 0
src1/decision/interface/ivif_park.cpp

@@ -0,0 +1,29 @@
+#include "ivif_park.h"
+
+ivif_park::ivif_park()
+{
+
+}
+
+ivif_park::~ivif_park()
+{
+
+}
+
+bool ivif_park::IsBocheEnable(double fLon, double fLat, double fHeading)
+{
+    (void)fLon;
+    (void)fLat;
+    (void)fHeading;
+    return false;
+}
+
+void ivif_park::SetParkSpace(std::vector<iv::simpleparkspace> & xvectorsimpleparkspace)
+{
+    mvectorsimpleparkspace = xvectorsimpleparkspace;
+}
+
+std::vector<iv::simpleparkspace> ivif_park::GetParkSpace()
+{
+    return  mvectorsimpleparkspace;
+}

+ 37 - 0
src1/decision/interface/ivif_park.h

@@ -0,0 +1,37 @@
+#ifndef IVIF_PARK_H
+#define IVIF_PARK_H
+
+#include <vector>
+
+namespace iv
+{
+struct simpleparkspace
+{
+public:
+    double mfLon;
+    double mfLat;
+    double mfHeading;
+    int mnParkType;  //1 side park   0 chuizhi park
+};
+}
+
+class ivif_park
+{
+public:
+    ivif_park();
+    virtual ~ivif_park();
+
+public:
+    virtual bool IsBocheEnable(double fLon, double fLat, double fHeading);
+
+private:
+    std::vector<iv::simpleparkspace> mvectorsimpleparkspace;
+
+public:
+    void SetParkSpace(std::vector<iv::simpleparkspace> & xvectorsimpleparkspace);
+    std::vector<iv::simpleparkspace> GetParkSpace();
+
+
+};
+
+#endif // IVIF_PARK_H