Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: created CPFA_qt_user_functions library for visualization #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 31 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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}
Expand Down
5 changes: 3 additions & 2 deletions experiments/CPFAExampleWithVisualisation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,10 @@

<qt-opengl>
<camera>
<placement idx="0" position=" 0, 0, 10" look_at="0, 0, 0" lens_focal_length="25"/>
<placement index="0" position="0, 0, 10" look_at="0, 0, 0" lens_focal_length="25"/>
</camera>
<user_functions label="CPFA_qt_user_functions"/>
<user_functions library="build/source/CPFA/libCPFA_qt_user_functions"
label="CPFA_qt_user_functions"/>
</qt-opengl>

</visualization>
Expand Down
7 changes: 6 additions & 1 deletion source/CPFA/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion source/CPFA/CPFA_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <source/Base/BaseController.h>
#include <source/Base/Pheromone.h>
#include <source/CPFA/CPFA_loop_functions.h>
#include <source/CPFA/CPFA_qt_user_functions.h>

using namespace std;
using namespace argos;
Expand Down Expand Up @@ -94,4 +95,4 @@ class CPFA_controller : public BaseController {
unsigned int survey_count;
};

#endif /* CPFA_CONTROLLER_H */
#endif /* CPFA_CONTROLLER_H */
1 change: 1 addition & 0 deletions source/CPFA/CPFA_loop_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <argos3/plugins/robots/foot-bot/simulator/footbot_entity.h>
#include <argos3/core/simulator/entity/floor_entity.h>
#include <source/CPFA/CPFA_controller.h>
#include <source/CPFA/CPFA_qt_user_functions.h>

using namespace argos;
using namespace std;
Expand Down