Browse Source

1、点云处理

LiuZe 11 months ago
parent
commit
f1463f303b
3 changed files with 11 additions and 83 deletions
  1. 0 72
      CMakeLists.txt
  2. 10 10
      lidar/lidar_manager.cpp
  3. 1 1
      lidar/lidar_manager.h

+ 0 - 72
CMakeLists.txt

@@ -1,72 +0,0 @@
-set(SON_PROJECT_NAME clamp_lidar)
-message("========== Load son project ${SON_PROJECT_NAME} ==========" )
-option(OPTION_COMMUNICATION_WITH_PLC "plc通信" OFF)
-message("<=${SON_PROJECT_NAME}=> OPTION_COMMUNICATION_WITH_PLC: " ${OPTION_COMMUNICATION_WITH_PLC})
-
-if(OPTION_COMMUNICATION_WITH_PLC AND NOT ENABLE_LIBRARY_PLC)
-    message(FATAL_ERROR "OPTION_COMMUNICATION_WITH_PLC ON but ENABLE_LIBRARY_PLC OFF")
-endif ()
-
-if(NOT ENABLE_LIBRARY_PCL)
-    message(FATAL_ERROR "ENABLE_LIBRARY_PCL OFF")
-endif ()
-
-if (NOT ENABLE_LIBRARY_GOOGLE_LOG)
-    message(FATAL_ERROR "ENABLE_LIBRARY_GOOGLE_LOG OFF")
-endif ()
-
-if (NOT ENABLE_LIBRARY_JSON)
-    message(FATAL_ERROR "ENABLE_LIBRARY_JSON OFF")
-endif ()
-
-if (NOT ENABLE_LIBRARY_THREAD)
-    message(FATAL_ERROR "Not enable ENABLE_LIBRARY_THREAD")
-endif ()
-
-if (OPTION_COMMUNICATION_WITH_PLC)
-    set(snap7_include "/usr/local/include/snap7")
-    if(IS_DIRECTORY ${snap7_include})
-        include_directories(${snap7_include})
-    else ()
-        message(FATAL_ERROR "Not found snap7 directory ${snap7_include}")
-    endif ()
-
-    aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/plc plc)
-    set(SON_PROJECT_SOURCE_LIST ${SON_PROJECT_SOURCE_LIST} ${plc})
-    set(SON_PROJECT_DEPEND_LIST ${SON_PROJECT_DEPEND_LIST} libplc)
-    add_definitions(-DOPTION_COMMUNICATION_WITH_PLC=1)
-else ()
-    add_definitions(-DOPTION_COMMUNICATION_WITH_PLC=0)
-endif ()
-
-include_directories(
-        ${PCL_INCLUDE_DIRS}
-)
-
-aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/lidar lidar)
-aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/detect detect)
-set(SON_PROJECT_SOURCE_LIST ${SON_PROJECT_SOURCE_LIST}
-        ${lidar}
-        ${detect}
-        ${CMAKE_CURRENT_LIST_DIR}/main.cpp
-)
-
-set(SON_PROJECT_DEPEND_LIST ${SON_PROJECT_DEPEND_LIST}
-        libjson
-        liblog
-        libpcl
-        libthread
-        ${PROTOBUF_LIBRARIES}
-)
-
-add_executable(${SON_PROJECT_NAME} ${SON_PROJECT_SOURCE_LIST})
-target_link_libraries(${SON_PROJECT_NAME} ${SON_PROJECT_DEPEND_LIST})
-target_compile_definitions(${SON_PROJECT_NAME} PRIVATE PROJECT_NAME="${SON_PROJECT_NAME}")
-
-install(TARGETS ${SON_PROJECT_NAME}
-        LIBRARY DESTINATION lib  # 动态库安装路径
-        ARCHIVE DESTINATION lib  # 静态库安装路径
-        RUNTIME DESTINATION bin  # 可执行文件安装路径
-        PUBLIC_HEADER DESTINATION include  # 头文件安装路径
-)
-

+ 10 - 10
lidar/lidar_manager.cpp

@@ -52,14 +52,14 @@ Error_manager ClampLidarManager::Init(const std::string &file) {
 
 void ClampLidarManager::thread_func(const std::string &ip_address) {
 
-    while (true) {
-        clamp->mutex.lock();
-        Safety_status safety_t;
-        if (run(&(clamp->lidar), &(clamp->detector), &safety_t)) {
-            clamp->safety_statu = safety_t;
-        }
-        clamp->mutex.unlock();
-
-        usleep(100 * 1000);
-    }
+//    while (true) {
+//        clamp->mutex.lock();
+//        Safety_status safety_t;
+//        if (run(&(clamp->lidar), &(clamp->detector), &safety_t)) {
+//            clamp->safety_statu = safety_t;
+//        }
+//        clamp->mutex.unlock();
+//
+//        usleep(100 * 1000);
+//    }
 }

+ 1 - 1
lidar/lidar_manager.h

@@ -14,7 +14,7 @@ public:
     Error_manager Init(const std::string &file);
 
 private:
-    void thrit ead_func(const std::string &ip_address);
+    void thread_func(const std::string &ip_address);
 
 private:
     ClampLidarProjectConfig m_config;