瀏覽代碼

Merge branch 'master' of http://111.33.136.149:3000/adc_pilot/modularization

yuchuli 2 年之前
父節點
當前提交
fb5aae9572

+ 5 - 0
src/driver/driver_can_nvidia_agx/nvcan.cpp

@@ -74,6 +74,8 @@ void nvcan::run()
     fd_set rdfs;
     int s[MAXSOCK];
     int ret;
+
+    int canfd_on = 1;
     
     struct sockaddr_can addr;
     char ctrlmsg[CMSG_SPACE(sizeof(struct timeval) + 3*sizeof(struct timespec) + sizeof(__u32))];
@@ -108,6 +110,9 @@ void nvcan::run()
         }
         addr.can_ifindex = ifr.ifr_ifindex;
 
+        //CANFD Support
+        setsockopt(s[i], SOL_CAN_RAW, CAN_RAW_FD_FRAMES, &canfd_on, sizeof(canfd_on));
+
         if (bind(s[i], (struct sockaddr *)&addr, sizeof(addr)) < 0) {
             mfault->SetFaultState(2,3,"bind error.");
             emit SIG_CANOPENSTATE(false,-3,"bind error");

File diff suppressed because it is too large
+ 825 - 581
src/driver/driver_grpc_client/ivgrpc.pb.cc


File diff suppressed because it is too large
+ 491 - 1044
src/driver/driver_grpc_client/ivgrpc.pb.h


+ 73 - 0
src/test/testivfusion/.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
+

+ 58 - 0
src/test/testivfusion/main.cpp

@@ -0,0 +1,58 @@
+#include <QCoreApplication>
+
+#include <thread>
+#include <memory>
+
+#include "fusionobjectarray.pb.h"
+
+
+#include "modulecomm.h"
+
+void * gpa;
+
+void sharemsg()
+{
+    iv::fusion::fusionobjectarray xfusion;
+    iv::fusion::fusionobject * pobj = xfusion.add_obj();
+
+    int i,j;
+    for(i=0;i<200;i++)
+    {
+        for(j=0;j<100;j++)
+        {
+            double x,y;
+            x = i*0.2 ;
+            y = j*0.2 + 10.0;
+            iv::fusion::NomalXYZ * ppoint =  pobj->add_nomal_centroid();
+            ppoint->set_nomal_x(x);
+            ppoint->set_nomal_y(y);
+            ppoint->set_nomal_z(0);
+        }
+    }
+
+    int nbytesize = xfusion.ByteSize();
+    std::shared_ptr<char> pstr_prt = std::shared_ptr<char>(new char[nbytesize]);
+    if(xfusion.SerializeToArray(pstr_prt.get(),nbytesize))
+    {
+        iv::modulecomm::ModuleSendMsg(gpa,pstr_prt.get(),nbytesize);
+    }
+}
+
+void threadshare()
+{
+    gpa = iv::modulecomm::RegisterSend("li_ra_fusion",10000000,1);
+    while(1)
+    {
+        sharemsg();
+        std::this_thread::sleep_for(std::chrono::milliseconds(100));
+    }
+}
+
+int main(int argc, char *argv[])
+{
+    QCoreApplication a(argc, argv);
+
+    std::thread * pthread = new std::thread(threadshare);
+
+    return a.exec();
+}

+ 31 - 0
src/test/testivfusion/testivfusion.pro

@@ -0,0 +1,31 @@
+QT -= gui
+
+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
+
+# 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 += main.cpp \
+    ../../include/msgtype/fusionobjectarray.pb.cc \
+    ../../include/msgtype/fusionobject.pb.cc
+
+
+!include(../../../include/common.pri ) {
+    error( "Couldn't find the common.pri file!" )
+}
+
+!include(../../../include/ivprotobuf.pri ) {
+    error( "Couldn't find the ivprotobuf.pri file!" )
+}
+
+HEADERS += \
+    ../../include/msgtype/fusionobjectarray.pb.h

Some files were not shown because too many files changed in this diff