Browse Source

add src1/driver/driver_lidar_rs32, but not complete.

yuchuli 3 years ago
parent
commit
06157b8503

+ 4 - 19
src1/driver/driver_lidar_rs16/driver_lidar_rs16.pro

@@ -17,10 +17,6 @@ DEFINES += QT_DEPRECATED_WARNINGS
 #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
 
 SOURCES += \
-        ../../interface/ivmodule.cpp \
-        ../interface/ivdriver.cpp \
-        ../interface/ivdriver_lidar.cpp \
-        ../interface/lidarmain.cpp \
         ivdriver_lidar_rs16.cpp \
         main.cpp
 
@@ -30,10 +26,6 @@ else: unix:!android: target.path = /opt/$${TARGET}/bin
 !isEmpty(target.path): INSTALLS += target
 
 HEADERS += \
-    ../../interface/ivmodule.h \
-    ../interface/ivdriver.h \
-    ../interface/ivdriver_lidar.h \
-    ../interface/lidarmain.h \
     ivdriver_lidar_rs16.h
 
 !include(../../../include/ivpcl.pri ) {
@@ -44,18 +36,11 @@ HEADERS += \
     error( "Couldn't find the ivyaml-cpp.pri file!" )
 }
 
+!include(../interface/ivlidar.pri ) {
+    error( "Couldn't find the ivlidar.pri file!" )
+}
 
-INCLUDEPATH += $$PWD/../interface
-INCLUDEPATH += $$PWD/../../interface
-
+#DEFINES += MODULECOMM_DEFAULT_USE_FASTRTPS
 
-INCLUDEPATH += $$PWD/../../common/modulecomm
 
-INCLUDEPATH += $$PWD/../../common/modulecomm_shm
-INCLUDEPATH += $$PWD/../../common/modulecomm_fastrtps
-INCLUDEPATH += $$PWD/../../common/modulecomm_inter
 
-LIBS += -L$$PWD/../../common/build-modulecomm-Debug -lmodulecomm
-LIBS += -L$$PWD/../../common/build-modulecomm_fastrtps-Debug -lmodulecomm_fastrtps
-LIBS += -L$$PWD/../../common/build-modulecomm_shm-Debug -lmodulecomm_shm
-LIBS += -L$$PWD/../../common/build-modulecomm_inter-Debug -lmodulecomm_inter

+ 16 - 0
src1/driver/driver_lidar_rs16/main.cpp

@@ -4,10 +4,26 @@
 
 #include "ivdriver_lidar_rs16.h"
 
+extern char gstr_memname[256];
+extern char gstr_rollang[256];
+extern char gstr_inclinationang_yaxis[256];  //from y axis
+extern char gstr_inclinationang_xaxis[256];  //from x axis
+extern char gstr_hostip[256];
+extern char gstr_port[256];
+extern char gstr_yaml[256];
+
 int main(int argc, char *argv[])
 {
     QCoreApplication a(argc, argv);
 
+    snprintf(gstr_memname,255,"lidar_pc");
+    snprintf(gstr_rollang,255,"-9.0");
+    snprintf(gstr_inclinationang_xaxis,255,"0.0");
+    snprintf(gstr_inclinationang_yaxis,255,"0");
+    snprintf(gstr_hostip,255,"0.0.0.0");
+    snprintf(gstr_port,255,"6699");//默认端口号
+    snprintf(gstr_yaml,255,"");
+
     iv::ivdriver_lidar * pivm = new iv::ivdriver_lidar_rs16();
     int nrtn = lidarmain(pivm,argc,argv,&a,"driver_lidar_rs16");
 

+ 73 - 0
src1/driver/driver_lidar_rs32/.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
+

+ 41 - 0
src1/driver/driver_lidar_rs32/driver_lidar_rs32.pro

@@ -0,0 +1,41 @@
+QT -= gui
+
+QT += network
+
+CONFIG += c++11 console
+CONFIG -= app_bundle
+
+# 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 += \
+        ivdriver_lidar_rs32.cpp \
+        main.cpp
+
+# Default rules for deployment.
+qnx: target.path = /tmp/$${TARGET}/bin
+else: unix:!android: target.path = /opt/$${TARGET}/bin
+!isEmpty(target.path): INSTALLS += target
+
+!include(../../../include/ivpcl.pri ) {
+    error( "Couldn't find the ivpcl.pri file!" )
+}
+
+!include(../../../include/ivyaml-cpp.pri ) {
+    error( "Couldn't find the ivyaml-cpp.pri file!" )
+}
+
+!include(../interface/ivlidar.pri ) {
+    error( "Couldn't find the ivlidar.pri file!" )
+}
+
+HEADERS += \
+    ivdriver_lidar_rs32.h

+ 17 - 0
src1/driver/driver_lidar_rs32/ivdriver_lidar_rs32.cpp

@@ -0,0 +1,17 @@
+#include "ivdriver_lidar_rs32.h"
+
+
+namespace iv {
+
+
+ivdriver_lidar_rs32::ivdriver_lidar_rs32()
+{
+
+}
+
+int ivdriver_lidar_rs32::processudpData(QByteArray ba, pcl::PointCloud<pcl::PointXYZI>::Ptr point_cloud)
+{
+
+}
+
+}

+ 17 - 0
src1/driver/driver_lidar_rs32/ivdriver_lidar_rs32.h

@@ -0,0 +1,17 @@
+#ifndef IVDRIVER_LIDAR_RS32_H
+#define IVDRIVER_LIDAR_RS32_H
+
+#include "ivdriver_lidar.h"
+
+namespace iv {
+
+
+class ivdriver_lidar_rs32 : public ivdriver_lidar
+{
+public:
+    ivdriver_lidar_rs32();
+    virtual int processudpData(QByteArray ba,pcl::PointCloud<pcl::PointXYZI>::Ptr point_cloud);
+};
+
+}
+#endif // IVDRIVER_LIDAR_RS32_H

+ 36 - 0
src1/driver/driver_lidar_rs32/main.cpp

@@ -0,0 +1,36 @@
+#include <QCoreApplication>
+
+#include "lidarmain.h"
+
+#include "ivdriver_lidar_rs32.h"
+
+extern char gstr_memname[256];
+extern char gstr_rollang[256];
+extern char gstr_inclinationang_yaxis[256];  //from y axis
+extern char gstr_inclinationang_xaxis[256];  //from x axis
+extern char gstr_hostip[256];
+extern char gstr_port[256];
+extern char gstr_yaml[256];
+
+int main(int argc, char *argv[])
+{
+    QCoreApplication a(argc, argv);
+
+    snprintf(gstr_memname,255,"lidar_pc");
+    snprintf(gstr_rollang,255,"-9.0");
+    snprintf(gstr_inclinationang_xaxis,255,"0.0");
+    snprintf(gstr_inclinationang_yaxis,255,"0");
+    snprintf(gstr_hostip,255,"0.0.0.0");
+    snprintf(gstr_port,255,"6699");//默认端口号
+    snprintf(gstr_yaml,255,"");
+
+    iv::ivdriver_lidar * pivm = new iv::ivdriver_lidar_rs32();
+    int nrtn = lidarmain(pivm,argc,argv,&a,"driver_lidar_rs32");
+
+    if(nrtn == 0)
+    {
+        return 0;
+    }
+    return a.exec();
+}
+

+ 26 - 0
src1/driver/interface/ivlidar.pri

@@ -0,0 +1,26 @@
+HEADERS += \
+    $$PWD/../../interface/ivmodule.h \
+    $$PWD/ivdriver.h \
+    $$PWD/ivdriver_lidar.h \
+    $$PWD/lidarmain.h
+
+SOURCES += \
+    $$PWD/../../interface/ivmodule.cpp \
+    $$PWD/ivdriver.cpp \
+    $$PWD/ivdriver_lidar.cpp \
+    $$PWD/lidarmain.cpp
+
+INCLUDEPATH += $$PWD/../interface
+INCLUDEPATH += $$PWD/../../interface
+
+INCLUDEPATH += $$PWD/../../common/modulecomm
+
+INCLUDEPATH += $$PWD/../../common/modulecomm_shm
+INCLUDEPATH += $$PWD/../../common/modulecomm_fastrtps
+INCLUDEPATH += $$PWD/../../common/modulecomm_inter
+
+LIBS += -L$$PWD/../../common/build-modulecomm-Debug -lmodulecomm
+LIBS += -L$$PWD/../../common/build-modulecomm_fastrtps-Debug -lmodulecomm_fastrtps
+LIBS += -L$$PWD/../../common/build-modulecomm_shm-Debug -lmodulecomm_shm
+LIBS += -L$$PWD/../../common/build-modulecomm_inter-Debug -lmodulecomm_inter
+

+ 4 - 8
src1/driver/interface/lidarmain.cpp

@@ -1,7 +1,9 @@
 #include <QCoreApplication>
 
 
-#include "ivdriver_lidar_rs16.h"
+//#include "ivdriver_lidar_rs16.h"
+
+#include "ivdriver_lidar.h"
 
 #include <signal.h>
 
@@ -182,13 +184,7 @@ void decodeyaml(const char * stryaml)
 int lidarmain(iv::ivdriver_lidar * pivm,int argc, char *argv[],QCoreApplication * pa,const char * strmodulename)
 {
 
-    snprintf(gstr_memname,255,"lidar_pc");
-    snprintf(gstr_rollang,255,"-9.0");
-    snprintf(gstr_inclinationang_xaxis,255,"0.0");
-    snprintf(gstr_inclinationang_yaxis,255,"0");
-    snprintf(gstr_hostip,255,"0.0.0.0");
-    snprintf(gstr_port,255,"6699");//默认端口号
-    snprintf(gstr_yaml,255,"");
+
 
     int nRtn = GetOptLong(argc,argv);
     if(nRtn == 1)  //show help,so exit.

+ 8 - 0
src1/interface/ivmodule.h

@@ -23,7 +23,15 @@ public:
     bool mbrun = false;
 private:
     std::thread * mpthread;
+#ifdef MODULECOMM_DEFAULT_USE_INTER
+    iv::modulecomm::ModuleComm_TYPE mdefcommtype = iv::modulecomm::ModuleComm_INTERIOR;
+#else
+#ifdef MODULECOMM_DEFAULT_USE_FASTRTPS
+    iv::modulecomm::ModuleComm_TYPE mdefcommtype = iv::modulecomm::ModuleComm_FASTRTPS;
+#else
     iv::modulecomm::ModuleComm_TYPE mdefcommtype = iv::modulecomm::ModuleComm_SHAREMEM;
+#endif
+#endif
     char mstrmodulename[256];
 };
 }