lfr_central
This commit is contained in:
parent
3149466a37
commit
6e4500d932
24
CMakeLists.txt
Normal file
24
CMakeLists.txt
Normal file
@ -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)
|
37
main.cpp
Normal file
37
main.cpp
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include <lfr.h>
|
||||||
|
#include <lfr_socket.h>
|
||||||
|
#include <uart_communication.h>
|
||||||
|
|
||||||
|
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<std::mutex> lock(mutex);
|
||||||
|
std::cerr<<"camera exception:"<<ex.what()<<std::endl;
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
std::cout << "create uart" << std::endl;
|
||||||
|
LFR_UART uartCommunicator;
|
||||||
|
|
||||||
|
std::cout << "create socket" << std::endl;
|
||||||
|
LFR_Socket socket([&](std::exception const &ex)
|
||||||
|
{
|
||||||
|
std::unique_lock<std::mutex> lock(mutex);
|
||||||
|
std::cerr<<"socket exception:"<<ex.what()<<std::endl;
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user