From 54d217faf2cc465425bd5c9762710d152c9cc2ff Mon Sep 17 00:00:00 2001 From: TimZnr Date: Thu, 3 Nov 2022 08:54:35 +0100 Subject: [PATCH] Added missing modules --- CMakeLists.txt | 17 +++++++++++++++++ ControlModule/CMakeLists.txt | 7 +++++++ ControlModule/control_module.cpp | 9 +++++++++ ControlModule/control_module.h | 9 +++++++++ Interpreter/CMakeLists.txt | 7 +++++++ Interpreter/interpreter.cpp | 9 +++++++++ Interpreter/interpreter.h | 9 +++++++++ IntersectionHandler/CMakeLists.txt | 7 +++++++ IntersectionHandler/intersection_handler.cpp | 9 +++++++++ IntersectionHandler/intersection_handler.h | 9 +++++++++ lfr.cpp | 19 +++++++++++++------ 11 files changed, 105 insertions(+), 6 deletions(-) create mode 100644 ControlModule/CMakeLists.txt create mode 100644 ControlModule/control_module.cpp create mode 100644 ControlModule/control_module.h create mode 100644 Interpreter/CMakeLists.txt create mode 100644 Interpreter/interpreter.cpp create mode 100644 Interpreter/interpreter.h create mode 100644 IntersectionHandler/CMakeLists.txt create mode 100644 IntersectionHandler/intersection_handler.cpp create mode 100644 IntersectionHandler/intersection_handler.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 84dceb8..1ff0bc6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,19 +8,36 @@ find_package( OpenCV REQUIRED ) include_directories( ${OpenCV_INCLUDE_DIRS} ) include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/Input ) include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/Processing) +include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/ControlModule) +include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/Interpreter) +include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/IntersectionHandler) + link_directories( ${Input_SOURCE_DIRS} ) link_directories( ${Processing_SOURCE_DIRS} ) +link_directories( ${ControlModule_SOURCE_DIRS} ) +link_directories( ${Interpreter_SOURCE_DIRS} ) +link_directories( ${IntersectionHandler_SOURCE_DIRS} ) add_subdirectory(Input) add_subdirectory(Processing) +add_subdirectory(ControlModule) +add_subdirectory(Interpreter) +add_subdirectory(IntersectionHandler) + target_include_directories(Input PRIVATE .) target_include_directories(Processing PRIVATE .) +target_include_directories(ControlModule PRIVATE .) +target_include_directories(Interpreter PRIVATE .) +target_include_directories(IntersectionHandler PRIVATE .) add_executable(lfr_image_processing lfr.cpp) target_link_libraries( lfr_image_processing ${OpenCV_LIBS}) target_link_libraries( lfr_image_processing Input ) target_link_libraries( lfr_image_processing Processing ) +target_link_libraries( lfr_image_processing ControlModule ) +target_link_libraries( lfr_image_processing Interpreter ) +target_link_libraries( lfr_image_processing IntersectionHandler ) set(CPACK_PROJECT_NAME ${PROJECT_NAME}) set(CPACK_PROJECT_VERSION ${PROJECT_VERSION}) diff --git a/ControlModule/CMakeLists.txt b/ControlModule/CMakeLists.txt new file mode 100644 index 0000000..ebcfc78 --- /dev/null +++ b/ControlModule/CMakeLists.txt @@ -0,0 +1,7 @@ +add_library(ControlModule control_module.cpp) +set_target_properties(ControlModule PROPERTIES VERSION ${PROJECT_VERSION}) +target_include_directories(ControlModule PRIVATE .) + +set(CPACK_PROJECT_NAME ${PROJECT_NAME}) +set(CPACK_PROJECT_VERSION ${PROJECT_VERSION}) +include(CPack) \ No newline at end of file diff --git a/ControlModule/control_module.cpp b/ControlModule/control_module.cpp new file mode 100644 index 0000000..00aed54 --- /dev/null +++ b/ControlModule/control_module.cpp @@ -0,0 +1,9 @@ +#include "control_module.h" + +ControlModule::ControlModule(/* args */) +{ +} + +ControlModule::~ControlModule() +{ +} \ No newline at end of file diff --git a/ControlModule/control_module.h b/ControlModule/control_module.h new file mode 100644 index 0000000..f223387 --- /dev/null +++ b/ControlModule/control_module.h @@ -0,0 +1,9 @@ +class ControlModule +{ +private: + /* data */ +public: + ControlModule(/* args */); + + ~ControlModule(); +}; \ No newline at end of file diff --git a/Interpreter/CMakeLists.txt b/Interpreter/CMakeLists.txt new file mode 100644 index 0000000..74ff278 --- /dev/null +++ b/Interpreter/CMakeLists.txt @@ -0,0 +1,7 @@ +add_library(Interpreter interpreter.cpp) +set_target_properties(Interpreter PROPERTIES VERSION ${PROJECT_VERSION}) +target_include_directories(Interpreter PRIVATE .) + +set(CPACK_PROJECT_NAME ${PROJECT_NAME}) +set(CPACK_PROJECT_VERSION ${PROJECT_VERSION}) +include(CPack) \ No newline at end of file diff --git a/Interpreter/interpreter.cpp b/Interpreter/interpreter.cpp new file mode 100644 index 0000000..0b54a84 --- /dev/null +++ b/Interpreter/interpreter.cpp @@ -0,0 +1,9 @@ +#include "interpreter.h" + +Interpreter::Interpreter(/* args */) +{ +} + +Interpreter::~Interpreter() +{ +} \ No newline at end of file diff --git a/Interpreter/interpreter.h b/Interpreter/interpreter.h new file mode 100644 index 0000000..eb22804 --- /dev/null +++ b/Interpreter/interpreter.h @@ -0,0 +1,9 @@ +class Interpreter +{ +private: + /* data */ +public: + Interpreter(/* args */); + + ~Interpreter(); +}; \ No newline at end of file diff --git a/IntersectionHandler/CMakeLists.txt b/IntersectionHandler/CMakeLists.txt new file mode 100644 index 0000000..5ffa8d4 --- /dev/null +++ b/IntersectionHandler/CMakeLists.txt @@ -0,0 +1,7 @@ +add_library(IntersectionHandler intersection_handler.cpp) +set_target_properties(IntersectionHandler PROPERTIES VERSION ${PROJECT_VERSION}) +target_include_directories(IntersectionHandler PRIVATE .) + +set(CPACK_PROJECT_NAME ${PROJECT_NAME}) +set(CPACK_PROJECT_VERSION ${PROJECT_VERSION}) +include(CPack) \ No newline at end of file diff --git a/IntersectionHandler/intersection_handler.cpp b/IntersectionHandler/intersection_handler.cpp new file mode 100644 index 0000000..a6b66e0 --- /dev/null +++ b/IntersectionHandler/intersection_handler.cpp @@ -0,0 +1,9 @@ +#include "intersection_handler.h" + +IntersectionHandler::IntersectionHandler(/* args */) +{ +} + +IntersectionHandler::~IntersectionHandler() +{ +} \ No newline at end of file diff --git a/IntersectionHandler/intersection_handler.h b/IntersectionHandler/intersection_handler.h new file mode 100644 index 0000000..6c634ad --- /dev/null +++ b/IntersectionHandler/intersection_handler.h @@ -0,0 +1,9 @@ +class IntersectionHandler +{ +private: + /* data */ +public: + IntersectionHandler(/* args */); + + ~IntersectionHandler(); +}; \ No newline at end of file diff --git a/lfr.cpp b/lfr.cpp index 3d7df0f..654fdf1 100644 --- a/lfr.cpp +++ b/lfr.cpp @@ -2,6 +2,9 @@ #include #include #include +#include +#include +#include using namespace cv; @@ -9,13 +12,17 @@ const int threshold_binary = 110; int main(void) { - std::cout<<"Hello world"; - Input test; - Processing test1; - Mat image1 = test.readFile("C:\\Line-Following-Robot\\Test_data\\*.jpeg"); - //Mat image2 = test.readWebcam(); + //Set up + Input input; + Processing processing; + ControlModule controleModule; + Interpreter interpreter; + IntersectionHandler intersectionHandler; - test1.calculate_binaray(image1, threshold_binary); + //Mat image1 = input.readFile("C:\\Line-Following-Robot\\Test_data\\*.jpeg"); + Mat image1 = input.readWebcam(); + + processing.calculate_binaray(image1, threshold_binary); imshow("Display window", image1); waitKey(0);