From 8a484772c930a1a69b76aeb0a22bed5286eca5ac Mon Sep 17 00:00:00 2001 From: Siva Abhishek Avala Date: Sun, 27 Aug 2023 21:49:49 -0600 Subject: [PATCH] fix: created CPFA_qt_user_functions library for visualization --- CMakeLists.txt | 44 ++++++++++++++------ experiments/CPFAExampleWithVisualisation.xml | 5 ++- source/CPFA/CMakeLists.txt | 7 +++- source/CPFA/CPFA_controller.h | 3 +- source/CPFA/CPFA_loop_functions.h | 1 + 5 files changed, 43 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 16cf649..d41a482 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,24 +41,41 @@ endif() # Set the path where CMake will find additional scripts. set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake) -# Find the ARGoS package. -find_package(PkgConfig) -pkg_check_modules(ARGOS REQUIRED argos3_simulator) -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ARGOS_PREFIX}/share/argos3/cmake) - -# Check for required libraries to compile code depending on Qt and OpenGL. -include(ARGoSCheckQTOpenGL) - -# Find the ARGoS package -find_package(PkgConfig) -pkg_check_modules(ARGOS REQUIRED argos3_simulator) -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ARGOS_PREFIX}/share/argos3/cmake) +## Find the ARGoS package, make sure to save the ARGoS prefix +#find_package(ARGoS REQUIRED) +#include_directories(${CMAKE_SOURCE_DIR} ${ARGOS_INCLUDE_DIRS}) +#link_directories(${ARGOS_LIBRARY_DIR}) +#link_libraries(${ARGOS_LDFLAGS}) + +# +# Check ARGoS +# +find_package(ARGoS REQUIRED) +include_directories(${ARGOS_INCLUDE_DIRS}) +link_directories(${ARGOS_LIBRARY_DIR}) +link_libraries(${ARGOS_LDFLAGS}) +string(REPLACE "/lib/argos3" "" ARGOS_PREFIX "${ARGOS_LIBRARY_DIR}") +set(CMAKE_INSTALL_PREFIX ${ARGOS_PREFIX} CACHE STRING "Install path prefix, prepended onto install directories." FORCE) + +## Find the ARGoS package. +#find_package(PkgConfig) +#pkg_check_modules(ARGOS REQUIRED argos3_simulator) +#set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ARGOS_PREFIX}/share/argos3/cmake) + +## Check for required libraries to compile code depending on Qt and OpenGL. +#include(ARGoSCheckQTOpenGL) + +## Find the ARGoS package +#find_package(PkgConfig) +#pkg_check_modules(ARGOS REQUIRED argos3_simulator) +#set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ARGOS_PREFIX}/share/argos3/cmake) # Find the GSL package. # find_package(GSL REQUIRED) # Find the LUA package. -find_package(Lua52 REQUIRED) +#find_package(Lua52 REQUIRED) +find_package(Lua REQUIRED) # Set ARGoS include directory. #include_directories(${CMAKE_SOURCE_DIR} ${ARGOS_INCLUDE_DIRS} ${GSL_INCLUDE_DIR} ${LUA_INCLUDE_DIR} source) @@ -86,6 +103,7 @@ add_executable(cpfa_evolver source/evolver.cpp) # Specify the libraries needed to compile the evolver. target_link_libraries(cpfa_evolver CPFA_controller CPFA_loop_functions + CPFA_qt_user_functions GA-MPI ${MPI_LIBRARIES} ${Boost_LIBRARIES} diff --git a/experiments/CPFAExampleWithVisualisation.xml b/experiments/CPFAExampleWithVisualisation.xml index 3778aa5..1a755ca 100644 --- a/experiments/CPFAExampleWithVisualisation.xml +++ b/experiments/CPFAExampleWithVisualisation.xml @@ -126,9 +126,10 @@ - + - + diff --git a/source/CPFA/CMakeLists.txt b/source/CPFA/CMakeLists.txt index 428c868..81de814 100644 --- a/source/CPFA/CMakeLists.txt +++ b/source/CPFA/CMakeLists.txt @@ -14,7 +14,12 @@ add_library(CPFA_loop_functions SHARED ${loop_source_files}) add_library(CPFA_controller SHARED CPFA_controller.h CPFA_controller.cpp CPFA_loop_functions.h - CPFA_loop_functions.cpp) + CPFA_loop_functions.cpp + CPFA_qt_user_functions.h + CPFA_qt_user_functions.cpp) + +add_library(CPFA_qt_user_functions SHARED CPFA_qt_user_functions.h + CPFA_qt_user_functions.cpp) ############################################### # link shared object files to dependencies diff --git a/source/CPFA/CPFA_controller.h b/source/CPFA/CPFA_controller.h index a25f734..37fffcc 100644 --- a/source/CPFA/CPFA_controller.h +++ b/source/CPFA/CPFA_controller.h @@ -4,6 +4,7 @@ #include #include #include +#include using namespace std; using namespace argos; @@ -94,4 +95,4 @@ class CPFA_controller : public BaseController { unsigned int survey_count; }; -#endif /* CPFA_CONTROLLER_H */ \ No newline at end of file +#endif /* CPFA_CONTROLLER_H */ diff --git a/source/CPFA/CPFA_loop_functions.h b/source/CPFA/CPFA_loop_functions.h index 658c584..ec7b529 100644 --- a/source/CPFA/CPFA_loop_functions.h +++ b/source/CPFA/CPFA_loop_functions.h @@ -5,6 +5,7 @@ #include #include #include +#include using namespace argos; using namespace std;