Explorar o código

change vtd_ros.

yuchuli %!s(int64=2) %!d(string=hai) anos
pai
achega
3340d473bf

+ 4 - 2
src/ros/catkin/src/vtd_ros/CMakeLists.txt

@@ -1,6 +1,7 @@
 cmake_minimum_required(VERSION 2.8.11)
 project(vtd_ros)
 
+include(${CMAKE_SOURCE_DIR}/adcpilot.cmake)
 
 ## Find catkin macros and libraries
 ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
@@ -54,6 +55,7 @@ catkin_package(
     sensor_msgs pluginlib
   DEPENDS
     Boost
+    Protobuf
 #  DEPENDS system_lib
 )
 
@@ -75,8 +77,8 @@ include_directories(
 )
 
 ## Declare a C++ executable
-add_executable(vtd_ros src/main.cpp src/rdbconn.cpp  src/VTD/RDBHandler.cc )
-target_link_libraries(vtd_ros ${catkin_LIBRARIES}  )
+add_executable(vtd_ros src/main.cpp src/rdbconn.cpp  src/VTD/RDBHandler.cc src/vtd_autoware.cpp ./../../../../include/msgtype/vtd.pb.cc )
+target_link_libraries(vtd_ros ${catkin_LIBRARIES} ${Protobuf_LIBRARIES}  Qt5Core Qt5Xml modulecomm )
 
 
 install(

+ 30 - 0
src/ros/catkin/src/vtd_ros/src/vtd_autoware.cpp

@@ -0,0 +1,30 @@
+#include "vtd_autoware.h"
+
+#include <iostream>
+#include "vtd.pb.h"
+
+#define DEFAULT_BUFFER      204800
+
+vtd_autoware::vtd_autoware()
+{
+
+}
+
+vtd_autoware::~vtd_autoware()
+{
+
+}
+
+void vtd_autoware::UpdateVTD(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname)
+{
+    (void)index;
+    (void)dt;
+    (void)strmemname;
+
+    iv::vtd::rdbdata xrdbdata;
+    if(xrdbdata.ParseFromArray(strdata,nSize))
+    {
+
+    }
+}
+

+ 37 - 0
src/ros/catkin/src/vtd_ros/src/vtd_autoware.h

@@ -0,0 +1,37 @@
+#ifndef VTD_AUTOWARE_H
+#define VTD_AUTOWARE_H
+
+#include <thread>
+#include <mutex>
+#include <condition_variable>
+#include <iostream>
+
+#include "modulecomm.h"
+
+
+
+class vtd_autoware
+{
+public:
+    vtd_autoware();
+    ~vtd_autoware();
+
+private:
+    void UpdateVTD(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname);
+
+  
+
+private:
+    void * mpfromvtd;
+
+    void * mpaegostate;
+
+    std::thread * mpthread;
+    std::thread * mpthreadfusion;
+
+    double mflat0 = 39.1207274;
+    double mflon0 = 117.0280033;
+
+};
+
+#endif // VTD_PILOT_H