From 6e4500d932e3e2daf3b6cd1068dca87daf3ce259 Mon Sep 17 00:00:00 2001 From: Tim Zeuner Date: Sun, 15 Jan 2023 22:40:40 +0100 Subject: [PATCH] lfr_central --- CMakeLists.txt | 24 ++++++++++++++++++++++++ main.cpp | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 main.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..df02185 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 3.1.0) +project(lfr_central VERSION 0.1.0) + +include(CTest) +enable_testing() + +set(THREADS_PREFER_PTHREAD_FLAG ON) + +add_subdirectory(AutonomousMode) +add_subdirectory(Communication) +add_subdirectory(Socket) + +add_executable(lfr_central main.cpp) + +target_include_directories(lfr_central PRIVATE ${lfr_image_processing_SOURCE_DIRS}) +target_include_directories(lfr_central PRIVATE ${lfr_uart_SOURCE_DIRS}) +target_include_directories(lfr_central PRIVATE ${lfr_socket_SOURCE_DIRS}) + + +target_link_libraries( lfr_central lfr_image_processing_lib lfr_uart_lib lfr_socket_lib) + +set(CPACK_PROJECT_NAME ${PROJECT_NAME}) +set(CPACK_PROJECT_VERSION ${PROJECT_VERSION}) +include(CPack) diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..98e0fce --- /dev/null +++ b/main.cpp @@ -0,0 +1,37 @@ +#include +#include +#include +#include + +int main(void) +{ + std::cout << "hello central" << std::endl; + + const int thresholdBinary = 140; + const int videoHeight = 720; + const int videoWidth = 1280; + const int gaussKernelSize = 11; + + std::mutex mutex; + + std::cout << "create lfr" << std::endl; + LFR lfr(videoHeight, videoWidth, thresholdBinary, gaussKernelSize, [&](std::exception const &ex) + { + std::unique_lock lock(mutex); + std::cerr<<"camera exception:"< lock(mutex); + std::cerr<<"socket exception:"<