Эх сурвалжийг харах

add apolloproto1 apolloproto2 apolloproto3 for compile apollo proto to so file.

yuchuli 2 долоо хоног өмнө
parent
commit
2c0730f5f7

BIN
src/apollo/apollolib/apollolibso/libadchassis.so


BIN
src/apollo/apollolib/apollolibso/libapolloproto1.so


BIN
src/apollo/apollolib/apollolibso/libapolloproto2.so


BIN
src/apollo/apollolib/apollolibso/libapolloproto3.so


BIN
src/apollo/apollolib/apollolibso/libhcp2.so


BIN
src/apollo/apollolib/apollolibso/libnvcan.so


BIN
src/apollo/apollolib/apollolibso/libshenlanfd.so


+ 73 - 0
src/apollo/apollolib/apolloproto1/.gitignore

@@ -0,0 +1,73 @@
+# This file is used to ignore files which are generated
+# ----------------------------------------------------------------------------
+
+*~
+*.autosave
+*.a
+*.core
+*.moc
+*.o
+*.obj
+*.orig
+*.rej
+*.so
+*.so.*
+*_pch.h.cpp
+*_resource.rc
+*.qm
+.#*
+*.*#
+core
+!core/
+tags
+.DS_Store
+.directory
+*.debug
+Makefile*
+*.prl
+*.app
+moc_*.cpp
+ui_*.h
+qrc_*.cpp
+Thumbs.db
+*.res
+*.rc
+/.qmake.cache
+/.qmake.stash
+
+# qtcreator generated files
+*.pro.user*
+
+# xemacs temporary files
+*.flc
+
+# Vim temporary files
+.*.swp
+
+# Visual Studio generated files
+*.ib_pdb_index
+*.idb
+*.ilk
+*.pdb
+*.sln
+*.suo
+*.vcproj
+*vcproj.*.*.user
+*.ncb
+*.sdf
+*.opensdf
+*.vcxproj
+*vcxproj.*
+
+# MinGW generated files
+*.Debug
+*.Release
+
+# Python byte code
+*.pyc
+
+# Binaries
+# --------
+*.dll
+*.exe
+

+ 51 - 0
src/apollo/apollolib/apolloproto1/apolloproto1.pro

@@ -0,0 +1,51 @@
+CONFIG -= qt
+
+TEMPLATE = lib
+DEFINES += APOLLOPROTO1_LIBRARY
+
+CONFIG += c++11
+
+CONFIG += plugin
+
+# The following define makes your compiler emit warnings if you use
+# any Qt feature that has 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
+
+# You can also make your code fail to compile if it uses 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 += \
+    /apollo_workspace/bazel-bin/external/apollo_src/modules/common_msgs/basic_msgs/*.cc  \
+    /apollo_workspace/bazel-bin/external/apollo_src/modules/common_msgs/audio_msgs/*.cc  \
+    /apollo_workspace/bazel-bin/external/apollo_src/modules/common_msgs/chassis_msgs/*.cc  \
+    /apollo_workspace/bazel-bin/external/apollo_src/modules/common_msgs/config_msgs/*.cc   \
+    /apollo_workspace/bazel-bin/external/apollo_src/modules/common_msgs/control_msgs/*.cc  \
+    /apollo_workspace/bazel-bin/external/apollo_src/modules/common_msgs/dreamview_msgs/*.cc \
+    /apollo_workspace/bazel-bin/external/apollo_src/modules/common_msgs/drivers_msgs/*.cc  \
+    /apollo_workspace/bazel-bin/external/apollo_src/modules/common_msgs/guardian_msgs/*.cc \
+    /apollo_workspace/bazel-bin/external/apollo_src/modules/common_msgs/localization_msgs/*.cc  \
+    /apollo_workspace/bazel-bin/external/apollo_src/modules/common_msgs/map_msgs/*.cc  \
+    /apollo_workspace/bazel-bin/external/apollo_src/modules/common_msgs/monitor_msgs/*.cc  \
+    /apollo_workspace/bazel-bin/external/apollo_src/modules/common_msgs/perception_msgs/*.cc  \
+    /apollo_workspace/bazel-bin/external/apollo_src/modules/common_msgs/prediction_msgs/*.cc   \
+    /apollo_workspace/bazel-bin/external/apollo_src/modules/common_msgs/storytelling_msgs/*.cc   \
+    /apollo_workspace/bazel-bin/external/apollo_src/modules/common_msgs/task_manager_msgs/*.cc   \
+    /apollo_workspace/bazel-bin/external/apollo_src/modules/common_msgs/transform_msgs/*.cc   \
+    /apollo_workspace/bazel-bin/external/apollo_src/modules/common_msgs/v2x_msgs/*.cc
+
+
+# Default rules for deployment.
+unix {
+    target.path = /usr/lib
+}
+!isEmpty(target.path): INSTALLS += target
+
+INCLUDEPATH += /opt/apollo/neo/include
+INCLUDEPATH += /apollo_workspace/bazel-bin/external/apollo_src
+INCLUDEPATH += /apollo_workspace
+
+LIBS += -L/opt/apollo/neo/lib/3rd-protobuf -lprotobuf

+ 73 - 0
src/apollo/apollolib/apolloproto2/.gitignore

@@ -0,0 +1,73 @@
+# This file is used to ignore files which are generated
+# ----------------------------------------------------------------------------
+
+*~
+*.autosave
+*.a
+*.core
+*.moc
+*.o
+*.obj
+*.orig
+*.rej
+*.so
+*.so.*
+*_pch.h.cpp
+*_resource.rc
+*.qm
+.#*
+*.*#
+core
+!core/
+tags
+.DS_Store
+.directory
+*.debug
+Makefile*
+*.prl
+*.app
+moc_*.cpp
+ui_*.h
+qrc_*.cpp
+Thumbs.db
+*.res
+*.rc
+/.qmake.cache
+/.qmake.stash
+
+# qtcreator generated files
+*.pro.user*
+
+# xemacs temporary files
+*.flc
+
+# Vim temporary files
+.*.swp
+
+# Visual Studio generated files
+*.ib_pdb_index
+*.idb
+*.ilk
+*.pdb
+*.sln
+*.suo
+*.vcproj
+*vcproj.*.*.user
+*.ncb
+*.sdf
+*.opensdf
+*.vcxproj
+*vcxproj.*
+
+# MinGW generated files
+*.Debug
+*.Release
+
+# Python byte code
+*.pyc
+
+# Binaries
+# --------
+*.dll
+*.exe
+

+ 38 - 0
src/apollo/apollolib/apolloproto2/apolloproto2.pro

@@ -0,0 +1,38 @@
+CONFIG -= qt
+
+TEMPLATE = lib
+DEFINES += APOLLOPROTO2_LIBRARY
+
+CONFIG += c++11
+
+CONFIG += plugin
+
+# The following define makes your compiler emit warnings if you use
+# any Qt feature that has 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
+
+# You can also make your code fail to compile if it uses 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 += \
+    /apollo_workspace/bazel-bin/external/apollo_src/modules/common_msgs/planning_msgs/*.cc   \
+    /apollo_workspace/bazel-bin/external/apollo_src/modules/common_msgs/sensor_msgs/*.cc   \
+    /apollo_workspace/bazel-bin/external/apollo_src/modules/common_msgs/routing_msgs/*.cc  \
+    /apollo_workspace/bazel-bin/external/apollo_src/modules/common_msgs/simulation_msgs/*.cc 
+
+
+# Default rules for deployment.
+unix {
+    target.path = /usr/lib
+}
+!isEmpty(target.path): INSTALLS += target
+
+INCLUDEPATH += /opt/apollo/neo/include
+INCLUDEPATH += /apollo_workspace/bazel-bin/external/apollo_src
+INCLUDEPATH += /apollo_workspace
+
+LIBS += -L/opt/apollo/neo/lib/3rd-protobuf -lprotobuf

+ 73 - 0
src/apollo/apollolib/apolloproto3/.gitignore

@@ -0,0 +1,73 @@
+# This file is used to ignore files which are generated
+# ----------------------------------------------------------------------------
+
+*~
+*.autosave
+*.a
+*.core
+*.moc
+*.o
+*.obj
+*.orig
+*.rej
+*.so
+*.so.*
+*_pch.h.cpp
+*_resource.rc
+*.qm
+.#*
+*.*#
+core
+!core/
+tags
+.DS_Store
+.directory
+*.debug
+Makefile*
+*.prl
+*.app
+moc_*.cpp
+ui_*.h
+qrc_*.cpp
+Thumbs.db
+*.res
+*.rc
+/.qmake.cache
+/.qmake.stash
+
+# qtcreator generated files
+*.pro.user*
+
+# xemacs temporary files
+*.flc
+
+# Vim temporary files
+.*.swp
+
+# Visual Studio generated files
+*.ib_pdb_index
+*.idb
+*.ilk
+*.pdb
+*.sln
+*.suo
+*.vcproj
+*vcproj.*.*.user
+*.ncb
+*.sdf
+*.opensdf
+*.vcxproj
+*vcxproj.*
+
+# MinGW generated files
+*.Debug
+*.Release
+
+# Python byte code
+*.pyc
+
+# Binaries
+# --------
+*.dll
+*.exe
+

+ 34 - 0
src/apollo/apollolib/apolloproto3/apolloproto3.pro

@@ -0,0 +1,34 @@
+CONFIG -= qt
+
+TEMPLATE = lib
+DEFINES += APOLLOPROTO2_LIBRARY
+
+CONFIG += c++11
+
+CONFIG += plugin
+
+# The following define makes your compiler emit warnings if you use
+# any Qt feature that has 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
+
+# You can also make your code fail to compile if it uses 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 += \
+    /apollo_workspace/bazel-bin/external/apollo_src/modules/common_msgs/external_command_msgs/*.cc  
+
+# Default rules for deployment.
+unix {
+    target.path = /usr/lib
+}
+!isEmpty(target.path): INSTALLS += target
+
+INCLUDEPATH += /opt/apollo/neo/include
+INCLUDEPATH += /apollo_workspace/bazel-bin/external/apollo_src
+INCLUDEPATH += /apollo_workspace
+
+LIBS += -L/opt/apollo/neo/lib/3rd-protobuf -lprotobuf

+ 8 - 2
src/apollo/apollolib/shenlanfd/shenlanfd.pro

@@ -21,11 +21,17 @@ DEFINES += QT_DEPRECATED_WARNINGS
 SOURCES += \
     shenlanfd.cpp
 
-HEADERS += \
-    shenlanfd.h
+
 
 # Default rules for deployment.
 unix {
     target.path = /usr/lib
 }
 !isEmpty(target.path): INSTALLS += target
+
+
+INCLUDEPATH += /opt/apollo/neo/include
+INCLUDEPATH += /apollo_workspace/bazel-bin/external/apollo_src
+INCLUDEPATH += /apollo_workspace
+
+LIBS += -L/opt/apollo/neo/lib/3rd-protobuf -lprotobuf

+ 5 - 13
src/apollo/code/apollocontroller_shenlanfd/apollocontroller_shenlanfd.pro

@@ -23,19 +23,8 @@ SOURCES += \
         main.cpp \
         canraw.pb.cc  \
         canmsg.pb.cc  \
-        adchassis.pb.cc  \
-        /apollo_workspace/bazel-bin/external/apollo_src/modules/common_msgs/basic_msgs/header.pb.cc   \
-        /apollo_workspace/bazel-bin/external/apollo_src/modules/common_msgs/basic_msgs/error_code.pb.cc \
-        /apollo_workspace/bazel-bin/external/apollo_src/modules/common_msgs/control_msgs/control_cmd.pb.cc \
-        /apollo_workspace/bazel-bin/external/apollo_src/modules/common_msgs/basic_msgs/drive_state.pb.cc \
-        /apollo_workspace/bazel-bin/external/apollo_src/modules/common_msgs/basic_msgs/pnc_point.pb.cc \
-        /apollo_workspace/bazel-bin/external/apollo_src/modules/common_msgs/basic_msgs/vehicle_signal.pb.cc \
-        /apollo_workspace/bazel-bin/external/apollo_src/modules/common_msgs/control_msgs/input_debug.pb.cc \
-        /apollo_workspace/bazel-bin/external/apollo_src/modules/common_msgs/control_msgs/pad_msg.pb.cc  \
-        /apollo_workspace/bazel-bin/external/apollo_src/modules/common_msgs/chassis_msgs/chassis.pb.cc   \
-        /apollo_workspace/bazel-bin/external/apollo_src/modules/common_msgs/basic_msgs/geometry.pb.cc   \
-        /apollo_workspace/bazel-bin/external/apollo_src/modules/common_msgs/basic_msgs/vehicle_id.pb.cc   
-
+        adchassis.pb.cc 
+        
 # Default rules for deployment.
 qnx: target.path = /tmp/$${TARGET}/bin
 else: unix:!android: target.path = /opt/$${TARGET}/bin
@@ -81,5 +70,8 @@ LIBS += -L/opt/apollo/neo/lib/3rd-protobuf -lprotobuf
 
 
 LIBS += /opt/apollo/neo/lib/catarc/libshenlanfd.so
+LIBS += /opt/apollo/neo/lib/catarc/libapolloproto1.so
+LIBS += /opt/apollo/neo/lib/catarc/libapolloproto2.so
+LIBS += /opt/apollo/neo/lib/catarc/libapolloproto3.so
 #LIBS += -L$$PWD -lshenlanfd
 

+ 20 - 5
src/apollo/code/apollocontroller_shenlanfd/main.cpp

@@ -13,6 +13,7 @@
 #include "canmsg.pb.h"
 #include "modules/common_msgs/control_msgs/control_cmd.pb.h"
 #include "modules/common_msgs/chassis_msgs/chassis.pb.h"
+#include "modules/common_msgs/planning_msgs/planning.pb.h"
 
 #include "gflags/gflags.h"
 
@@ -36,7 +37,8 @@ static std::shared_ptr<apollo::cyber::Reader<iv::chassis>>
         chassis_reader_;
 static std::shared_ptr<apollo::cyber::Reader<apollo::control::ControlCommand>>
         controller_reader_;
-std::shared_ptr<apollo::cyber::Writer<apollo::canbus::Chassis>> apollochassis_writer_;
+static std::shared_ptr<apollo::cyber::Writer<apollo::canbus::Chassis>> apollochassis_writer_;
+static std::shared_ptr<apollo::cyber::Reader<apollo::planning::ADCTrajectory>> planning_reader_;
 
 static void ExecSend()
 {
@@ -61,7 +63,7 @@ static void ExecSend()
     xmsg.set_index(gnIndex);
 
     unsigned char byte_24E[64];
-    gpShenlanfd->Get24E(byte_24E);
+    gpShenlanfd->Get1C4(byte_24E);
     xraw.set_id(0x24E);
     xraw.set_data(byte_24E,64);
     xraw.set_bext(false);
@@ -74,9 +76,10 @@ static void ExecSend()
     }
     xmsg.set_channel(0);
     xmsg.set_index(gnIndex);
+    
 
     unsigned char byte_25E[32];
-    gpShenlanfd->Get25E(byte_25E);
+    gpShenlanfd->Get1C4(byte_25E);
     xraw.set_id(0x25E);
     xraw.set_data(byte_25E,32);
     xraw.set_bext(false);
@@ -119,6 +122,11 @@ void RecvCANMsg(const std::shared_ptr<iv::can::canmsg> &xmsg)
     
 }
 
+void RecvPlanning(const std::shared_ptr<apollo::planning::ADCTrajectory> & xplanning)
+{
+
+}
+
 void RecvChassis(const std::shared_ptr<iv::chassis> &xchassis)
 {
     
@@ -235,6 +243,13 @@ int main(int argc, char *argv[])
         }
     );
 
+    planning_reader_ = pilot_node->CreateReader<apollo::planning::ADCTrajectory>(
+        "/apollo/planning",
+        [](const std::shared_ptr<apollo::planning::ADCTrajectory> & xplanning){
+            RecvPlanning(xplanning);
+        }
+    );
+
 
 
     gpShenlanfd = new Shenlanfd();
@@ -244,12 +259,12 @@ int main(int argc, char *argv[])
 
     apollo::cyber::WaitForShutdown();
 
-    delete gpShenlanfd;
     gbthreadrun = false;
     gpthreadsend->join();
 //    ptestthread->join();
-    
+    delete gpShenlanfd;
     std::cout<<" Shut Down."<<std::endl;
 
+
     return 0;
 }