Browse Source

add decition_brain_sf_changan_shenlan_rd.pro. for use extern dynamics.

yuchuli 4 months ago
parent
commit
a1dde09b75

+ 8 - 1
src/decition/decition_brain_sf_changan_shenlan/decition/adc_adapter/changan_shenlan_adapter.cpp

@@ -17,7 +17,9 @@ iv::decition::ChanganShenlanAdapter::~ChanganShenlanAdapter(){
 
 }
 
-
+#ifdef USE_EXTERND
+    double GetTorque(double accAim,double fNowSpeed, double fDesireSpeed);
+#endif
 
 iv::decition::Decition iv::decition::ChanganShenlanAdapter::getAdapterDeciton(GPS_INS now_gps_ins, std::vector<Point2D>  trace , float dSpeed, float obsDistance ,
                                                                               float  obsSpeed,float accAim,float accNow  ,bool changingDangWei,Decition *decition){
@@ -31,6 +33,7 @@ iv::decition::Decition iv::decition::ChanganShenlanAdapter::getAdapterDeciton(GP
     float controlBrake=0;
     float realSpeed = now_gps_ins.speed;
     float ttc = 0-(obsDistance/obsSpeed);
+
     if(ttc<0){
         ttc=15;
     }
@@ -70,6 +73,7 @@ iv::decition::Decition iv::decition::ChanganShenlanAdapter::getAdapterDeciton(GP
         }
         else
         {
+#ifndef USE_EXTERND
             double fVehWeight = 1800;
             double fg = 9.8;
             double fRollForce = 50;
@@ -85,6 +89,9 @@ iv::decition::Decition iv::decition::ChanganShenlanAdapter::getAdapterDeciton(GP
                 }
             }
             controlSpeed = fNeed/fRatio;
+#else
+            controlSpeed = GetTorque(accAim,realSpeed,dSpeed);
+#endif
         }
     }
 

+ 129 - 0
src/decition/decition_brain_sf_changan_shenlan/decition_brain_sf_changan_shenlan_rd.pro

@@ -0,0 +1,129 @@
+QT -= gui
+
+QT += network dbus xml widgets
+
+CONFIG += c++11  #console
+CONFIG -= app_bundle
+
+# The following define makes your compiler emit warnings if you use
+# any feature of Qt which as been marked deprecated (the exact warnings
+# depend on your compiler). Please consult the documentation of the
+# deprecated API in order to know how to port your code away from it.
+DEFINES += QT_DEPRECATED_WARNINGS
+
+QMAKE_LFLAGS += -no-pie
+
+DEFINES += USE_EXTERND
+
+# You can also make your code fail to compile if you use deprecated APIs.
+# In order to do so, uncomment the following line.
+# You can also select to disable deprecated APIs only up to a certain version of Qt.
+#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
+
+SOURCES += $$PWD/../common/main.cpp \
+    ../../include/msgtype/brainstate.pb.cc \
+    ../../include/msgtype/decition.pb.cc \
+    ../../include/msgtype/radarobjectarray.pb.cc \
+    ../../include/msgtype/radarobject.pb.cc \
+    ../../include/msgtype/gpsimu.pb.cc \
+    ../../include/msgtype/mapreq.pb.cc \
+    ../../include/msgtype/hmi.pb.cc \
+    ../../include/msgtype/chassis.pb.cc \
+    ../../include/msgtype/vbox.pb.cc \
+    ../../include/msgtype/radio_send.pb.cc \
+    ../../include/msgtype/formation_map.pb.cc \
+    ../../include/msgtype/fusionobjectarray.pb.cc \
+    ../../include/msgtype/fusionobject.pb.cc \
+    ../../include/msgtype/carstate.pb.cc \
+    ../../include/msgtype/v2r.pb.cc \
+    ../../include/msgtype/cameraobjectarray.pb.cc\
+    ../../include/msgtype/cameraobject.pb.cc\
+    ../../include/msgtype/groupmsg.pb.cc \
+    ../../include/msgtype/brainrunstate.pb.cc
+
+include($$PWD/../common/common/common.pri)
+include($$PWD/decition/decition.pri)
+include($$PWD/../common/perception_sf/perception_sf.pri)
+#include(platform/platform.pri)
+
+
+INCLUDEPATH += $$PWD/../common
+
+
+
+INCLUDEPATH += $$PWD/../../include/msgtype
+
+LIBS += -lprotobuf
+
+
+!include(../../../include/common.pri ) {
+    error( "Couldn't find the common.pri file!" )
+}
+
+#INCLUDEPATH += $$PWD/../../../include/
+#LIBS += -L$$PWD/../../../bin/ -lxmlparam -lmodulecomm -livlog
+# -livbacktrace
+
+
+
+#win32: INCLUDEPATH += C:/File/PCL_1.8/PCL_1.8.1/3rdParty/boost-1.65/include/boost-1_65
+
+win32: INCLUDEPATH += C:/File/boost/boost_1_67_0
+win32: LIBS += -LC:/File/boost/boost_1_67_0/vc2017/lib -lboost_system-vc141-mt-x64-1_67 -lboost_thread-vc141-mt-x64-1_67
+
+
+unix:LIBS += -lboost_thread -lboost_system -lboost_serialization
+unix:INCLUDEPATH += /usr/include/eigen3
+
+unix:!macx: INCLUDEPATH += $$PWD/.
+unix:!macx: DEPENDPATH += $$PWD/.
+
+HEADERS += \
+    ../../include/msgtype/brainstate.pb.h \
+    ../../include/msgtype/decition.pb.h \
+    ../../include/msgtype/radarobjectarray.pb.h \
+    ../../include/msgtype/radarobject.pb.h \
+    ../../include/msgtype/gpsimu.pb.h \
+    ../../include/msgtype/mapreq.pb.h \
+    ../../include/msgtype/hmi.pb.h \
+    ../../include/msgtype/vbox.pb.h \
+    ../common/common/roadmode_type.h \
+    ../../include/msgtype/chassis.pb.h \
+    ../../include/msgtype/radio_send.pb.h \
+    ../../include/msgtype/formation_map.pb.h \
+    ../../include/msgtype/fusionobjectarray.pb.h \
+    ../../include/msgtype/fusionobject.pb.h \
+    ../common/perception_sf/eyes.h \
+    ../common/perception_sf/perceptionoutput.h \
+    ../common/perception_sf/sensor.h \
+    ../common/perception_sf/sensor_camera.h \
+    ../common/perception_sf/sensor_gps.h \
+    ../common/perception_sf/sensor_lidar.h \
+    ../common/perception_sf/sensor_radar.h \
+    ../common/common/sysparam_type.h \
+    ../../include/msgtype/carstate.pb.h \
+    ../../include/msgtype/v2r.pb.h \
+    ../../include/msgtype/cameraobjectarray.pb.h\
+    ../../include/msgtype/cameraobject.pb.h\
+    ../../include/msgtype/groupmsg.pb.h \
+    ../../include/msgtype/brainrunstate.pb.h
+
+DEFINES += USEAUTOWAREMPC
+
+
+if(contains(DEFINES,USE_EXTERND)){
+LIBS += -lacctotorque
+}
+
+if(contains(DEFINES,USEAUTOWAREMPC)){
+
+INCLUDEPATH += $$PWD/../../common/include
+INCLUDEPATH += $$PWD/../mpccontroller
+
+LIBS += -linterpolation -losqp -lmpccontroller
+
+}
+
+
+
+

+ 12 - 0
src/plugin/acctotorque/Makefile

@@ -0,0 +1,12 @@
+all: acctotorque.o
+
+	g++ -fPIC -shared -o libacctotorque.so acctotorque.o
+
+acctotorque.o: acctotorque.cpp
+
+	g++ -o acctotorque.o -c acctotorque.cpp
+
+
+clean:
+
+	rm libacctotorque.so acctotorque.o

+ 4 - 0
src/plugin/acctotorque/Readme.md

@@ -0,0 +1,4 @@
+1.生成库
+make
+
+2.如果是调试模式,拷贝生成的库到bin目录,如果是部署模式,拷贝到app的lib目录。

+ 12 - 0
src/plugin/acctotorque/acctotorque.cpp

@@ -0,0 +1,12 @@
+
+#include <iostream>
+
+//accAim  期望加速度 m/s2
+//fNowSpeed   当前车速 km/h
+//fDesireSpeed  期望车速 km/h
+double GetTorque(double accAim,double fNowSpeed, double fDesireSpeed)
+{
+	double ftorque = 10.0;
+	std::cout<<" toque:"<<ftorque<<std::endl;
+	return ftorque;
+}