forked from ilpincy/argos3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First, big import of ARGoS code to form the ARGoS codebase.
Compilation works, but many things are missing: 1 - only the core was imported, no plugins 2 - dynamic linking manager was purged, need a new way to create controllers and loop functions 3 - visitor was purged, need a new way to manage actions on entities 4 - registration of actuators and sensors missing 5 - querying of plugins to be redone
- Loading branch information
0 parents
commit e953685
Showing
112 changed files
with
27,842 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
22449 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# | ||
# Set minimum required version | ||
# | ||
cmake_minimum_required(VERSION 2.8) | ||
|
||
# | ||
# Set the path additional cmake files must be searched for | ||
# | ||
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) | ||
|
||
# | ||
# Make sure we are under unix | ||
# | ||
if(NOT UNIX) | ||
message(FATAL_ERROR "ARGoS compiles only under UNIX, sorry!") | ||
endif(NOT UNIX) | ||
|
||
# | ||
# Check for GCC version >= 4.2 | ||
# | ||
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION) | ||
if (GCC_VERSION VERSION_GREATER 4.2 OR GCC_VERSION VERSION_EQUAL 4.2) | ||
message(STATUS "GCC/G++ version >= 4.2") | ||
else(GCC_VERSION VERSION_GREATER 4.2 OR GCC_VERSION VERSION_EQUAL 4.2) | ||
message(FATAL_ERROR "You need to have at least GCC/G++ version 4.2!") | ||
endif(GCC_VERSION VERSION_GREATER 4.2 OR GCC_VERSION VERSION_EQUAL 4.2) | ||
|
||
# | ||
# Set compiler flags | ||
# | ||
include(${CMAKE_SOURCE_DIR}/cmake/ARGoSBuildFlags.cmake) | ||
|
||
# | ||
# Set build options | ||
# | ||
include(${CMAKE_SOURCE_DIR}/cmake/ARGoSBuildOptions.cmake) | ||
|
||
# | ||
# Check for GSL | ||
# It is required only when compiling the simulator | ||
# | ||
find_package(GSL) | ||
if(GSL_FOUND) | ||
add_definitions(${CMAKE_GSL_CXX_FLAGS}) | ||
include_directories(${GSL_INCLUDE_DIR}) | ||
link_directories(${GSL_LINK_DIRECTORIES}) | ||
else(GSL_FOUND) | ||
if(ARGOS_BUILD_FOR STREQUAL "SIMULATOR") | ||
message(FATAL_ERROR "When compiling the ARGoS simulator, GSL is required") | ||
endif(ARGOS_BUILD_FOR STREQUAL "SIMULATOR") | ||
endif(GSL_FOUND) | ||
|
||
# | ||
# Compile stuff | ||
# | ||
add_subdirectory(core) | ||
#add_subdirectory(plugins) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# | ||
# General compilation flags | ||
# | ||
set(CMAKE_C_FLAGS "-Wall") | ||
set(CMAKE_C_FLAGS_RELEASE "-Os -DNDEBUG") | ||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-Os -ggdb3 -DNDEBUG") | ||
set(CMAKE_C_FLAGS_DEBUG "-ggdb3") | ||
|
||
set(CMAKE_CXX_FLAGS "-Wall") | ||
set(CMAKE_CXX_FLAGS_RELEASE "-Os -DNDEBUG") | ||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-Os -ggdb3 -DNDEBUG") | ||
set(CMAKE_CXX_FLAGS_DEBUG "-ggdb3") | ||
|
||
if(APPLE) | ||
# MAC OSX | ||
# Allow for dynamic lookup of undefined symbols | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -undefined dynamic_lookup") | ||
else(APPLE) | ||
# Linux | ||
# Avoid discarding unused symbols to allow plugins to work | ||
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-as-needed") | ||
endif(APPLE) | ||
|
||
# | ||
# This is required for TinyXML++ to work | ||
# | ||
add_definitions(-DTIXML_USE_TICPP) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# | ||
# What is ARGoS being built for? | ||
# Accepted values: "SIMULATOR" or a robot name (uppercase) | ||
# | ||
if(NOT DEFINED ARGOS_BUILD_FOR) | ||
# Variable was not set, set to default value | ||
set(ARGOS_BUILD_FOR "SIMULATOR" CACHE STRING "What is ARGoS being built for? \"Simulator\" or a robot name (uppercase)") | ||
endif(NOT DEFINED ARGOS_BUILD_FOR) | ||
# Set the macro according to value set in ARGOS_BUILD_FOR | ||
add_definitions(-DARGOS_${ARGOS_BUILD_FOR}_BUILD) | ||
|
||
# | ||
# Compile thread-safe or thread-unsafe log | ||
# By default, use the thread-safe version | ||
# When compiling for the simulator, the thread-safe version is mandatory | ||
# | ||
if(NOT DEFINED ARGOS_THREADSAFE_LOG) | ||
set(ARGOS_THREADSAFE_LOG TRUE CACHE BOOL "ON -> compile thread-safe version of log, OFF -> compile thread-unsafe version of log") | ||
endif(NOT DEFINED ARGOS_THREADSAFE_LOG) | ||
if((NOT ARGOS_THREADSAFE_LOG) AND (ARGOS_BUILD_FOR STREQUAL "SIMULATOR")) | ||
message(FATAL_ERROR "When compiling for the simulator, ARGOS_THREADSAFE_LOG must be ON") | ||
endif((NOT ARGOS_THREADSAFE_LOG) AND (ARGOS_BUILD_FOR STREQUAL "SIMULATOR")) | ||
if(ARGOS_THREADSAFE_LOG) | ||
add_definitions(-DARGOS_THREADSAFE_LOG) | ||
endif(ARGOS_THREADSAFE_LOG) | ||
|
||
# | ||
# Compile support for dynamic library loading or not | ||
# By default, support for dynamic library loading is on | ||
# When compiling for the simulator, support for dynamic library loading must be on | ||
# | ||
if(NOT DEFINED ARGOS_DYNAMIC_LIBRARY_LOADING) | ||
set(ARGOS_DYNAMIC_LIBRARY_LOADING TRUE CACHE BOOL "ON -> compile support for dynamic library loading, OFF -> no support for dynamic library loading") | ||
endif(NOT DEFINED ARGOS_DYNAMIC_LIBRARY_LOADING) | ||
if((NOT ARGOS_DYNAMIC_LIBRARY_LOADING) AND (ARGOS_BUILD_FOR STREQUAL "SIMULATOR")) | ||
message(FATAL_ERROR "When compiling for the simulator, ARGOS_DYNAMIC_LIBRARY_LOADING must be ON") | ||
endif((NOT ARGOS_DYNAMIC_LIBRARY_LOADING) AND (ARGOS_BUILD_FOR STREQUAL "SIMULATOR")) | ||
if(ARGOS_DYNAMIC_LIBRARY_LOADING) | ||
add_definitions(-DARGOS_DYNAMIC_LIBRARY_LOADING) | ||
endif(ARGOS_DYNAMIC_LIBRARY_LOADING) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# Checks whether QT4, OpenGL and GLUT are present and correctly configured | ||
# | ||
# Usage: | ||
# | ||
# INCLUDE(CheckQTOpenGL4ARGoS) | ||
# IF(ARGOS_COMPILE_QTOPENGL) | ||
# | ||
# your qt-opengl-dependent code here | ||
# | ||
# ENDIF(ARGOS_COMPILE_QTOPENGL) | ||
# | ||
# This module defines this variable: | ||
# | ||
# ARGOS_COMPILE_QTOPENGL - True if QT4, OpenGL and GLUT are present and correctly configured | ||
# | ||
# AUTHOR: Carlo Pinciroli <[email protected]> | ||
|
||
# Check for QT4 | ||
set(ARGOS_COMPILE_QTOPENGL false) | ||
set(QT_USE_QTOPENGL true) | ||
find_package(Qt4) | ||
if(QT4_FOUND) | ||
# QT4 found, is it the minimum required version? | ||
if(QT_VERSION_MAJOR GREATER 3 AND QT_VERSION_MINOR GREATER 2) | ||
# Is the QTOpenGL module present? | ||
if(QT_QTOPENGL_FOUND) | ||
# QT is OK, now check for OpenGL | ||
find_package(OpenGL) | ||
if(OPENGL_FOUND) | ||
# OpenGL is ok, now check for GLUT | ||
find_package(GLUT) | ||
if(GLUT_FOUND) | ||
# GLUT is ok | ||
|
||
# All the required libraries are OK | ||
set(ARGOS_COMPILE_QTOPENGL true) | ||
if( APPLE ) | ||
include_directories(${OPENGL_INCLUDE_DIR}/Headers) | ||
endif( APPLE ) | ||
include(${QT_USE_FILE}) | ||
|
||
# Now check for SDL (optional) | ||
set(SDL_BUILDING_LIBRARY true) | ||
find_package(SDL) | ||
if(SDL_FOUND) | ||
# SDL is ok | ||
add_definitions(-DQTOPENGL_WITH_SDL) | ||
|
||
else(SDL_FOUND) | ||
message(STATUS "SDL not found. QTOpenGL won't have joystick support.") | ||
endif(SDL_FOUND) | ||
|
||
else(GLUT_FOUND) | ||
message(STATUS "GLUT not found. Skipping compilation of QT-OpenGL visualization.") | ||
endif(GLUT_FOUND) | ||
|
||
else(OPENGL_FOUND) | ||
message(STATUS "OpenGL not found. Skipping compilation of QT-OpenGL visualization.") | ||
endif(OPENGL_FOUND) | ||
|
||
else(QT_QTOPENGL_FOUND) | ||
message(STATUS "QtOpenGL module not found. Skipping compilation of QT-OpenGL visualization.") | ||
endif(QT_QTOPENGL_FOUND) | ||
|
||
else(QT_VERSION_MAJOR GREATER 3 AND QT_VERSION_MINOR GREATER 2) | ||
message(STATUS "Minimum required version for Qt (>= 4.3) not found. Skipping compilation of QT-OpenGL visualization.") | ||
endif(QT_VERSION_MAJOR GREATER 3 AND QT_VERSION_MINOR GREATER 2) | ||
|
||
else(QT4_FOUND) | ||
message(STATUS "Qt4 not found, skipping compilation of QT-OpenGL visualization.") | ||
endif(QT4_FOUND) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,179 @@ | ||
# Try to find gnu scientific library GSL | ||
# See | ||
# http://www.gnu.org/software/gsl/ and | ||
# http://gnuwin32.sourceforge.net/packages/gsl.htm | ||
# | ||
# Once run this will define: | ||
# | ||
# GSL_FOUND = system has GSL lib | ||
# | ||
# GSL_LIBRARIES = full path to the libraries | ||
# on Unix/Linux with additional linker flags from "gsl-config --libs" | ||
# | ||
# CMAKE_GSL_CXX_FLAGS = Unix compiler flags for GSL, essentially "`gsl-config --cxxflags`" | ||
# | ||
# GSL_INCLUDE_DIR = where to find headers | ||
# | ||
# GSL_LINK_DIRECTORIES = link directories, useful for rpath on Unix | ||
# GSL_EXE_LINKER_FLAGS = rpath on Unix | ||
# | ||
# Felix Woelk 07/2004 | ||
# Jan Woetzel | ||
# | ||
# www.mip.informatik.uni-kiel.de | ||
# -------------------------------- | ||
|
||
IF(WIN32) | ||
# JW tested with gsl-1.8, Windows XP, MSVS 7.1, MSVS 8.0 | ||
SET(GSL_POSSIBLE_ROOT_DIRS | ||
${GSL_ROOT_DIR} | ||
$ENV{GSL_ROOT_DIR} | ||
${GSL_DIR} | ||
${GSL_HOME} | ||
$ENV{GSL_DIR} | ||
$ENV{GSL_HOME} | ||
$ENV{EXTERN_LIBS_DIR}/gsl | ||
$ENV{EXTRA} | ||
# "C:/home/jw/source2/gsl-1.8" | ||
) | ||
FIND_PATH(GSL_INCLUDE_DIR | ||
NAMES gsl/gsl_cdf.h gsl/gsl_randist.h | ||
PATHS ${GSL_POSSIBLE_ROOT_DIRS} | ||
PATH_SUFFIXES include | ||
DOC "GSL header include dir" | ||
) | ||
|
||
FIND_LIBRARY(GSL_GSL_LIBRARY | ||
NAMES gsl libgsl | ||
PATHS ${GSL_POSSIBLE_ROOT_DIRS} | ||
PATH_SUFFIXES lib | ||
DOC "GSL library dir" ) | ||
|
||
FIND_LIBRARY(GSL_GSLCBLAS_LIBRARY | ||
NAMES gslcblas libgslcblas | ||
PATHS ${GSL_POSSIBLE_ROOT_DIRS} | ||
PATH_SUFFIXES lib | ||
DOC "GSL cblas library dir" ) | ||
|
||
SET(GSL_LIBRARIES ${GSL_GSL_LIBRARY}) | ||
|
||
#MESSAGE("DBG\n" | ||
# "GSL_GSL_LIBRARY=${GSL_GSL_LIBRARY}\n" | ||
# "GSL_GSLCBLAS_LIBRARY=${GSL_GSLCBLAS_LIBRARY}\n" | ||
# "GSL_LIBRARIES=${GSL_LIBRARIES}") | ||
|
||
|
||
ELSE(WIN32) | ||
|
||
IF(UNIX) | ||
SET(GSL_CONFIG_PREFER_PATH | ||
"$ENV{GSL_DIR}/bin" | ||
"$ENV{GSL_DIR}" | ||
"$ENV{GSL_HOME}/bin" | ||
"$ENV{GSL_HOME}" | ||
CACHE STRING "preferred path to GSL (gsl-config)") | ||
FIND_PROGRAM(GSL_CONFIG gsl-config | ||
${GSL_CONFIG_PREFER_PATH} | ||
/usr/bin/ | ||
/opt/local/bin | ||
) | ||
# MESSAGE("DBG GSL_CONFIG ${GSL_CONFIG}") | ||
|
||
IF (GSL_CONFIG) | ||
|
||
MESSAGE(STATUS "GSL using gsl-config ${GSL_CONFIG}") | ||
# set CXXFLAGS to be fed into CXX_FLAGS by the user: | ||
EXEC_PROGRAM(${GSL_CONFIG} | ||
ARGS --cflags | ||
OUTPUT_VARIABLE GSL_CXX_FLAGS ) | ||
#SET(GSL_CXX_FLAGS "`${GSL_CONFIG} --cflags`") | ||
|
||
# set INCLUDE_DIRS to prefix+include | ||
EXEC_PROGRAM(${GSL_CONFIG} | ||
ARGS --prefix | ||
OUTPUT_VARIABLE GSL_PREFIX) | ||
SET(GSL_INCLUDE_DIR ${GSL_PREFIX}/include CACHE STRING INTERNAL) | ||
|
||
# set link libraries and link flags | ||
|
||
#SET(GSL_LIBRARIES "`${GSL_CONFIG} --libs`") | ||
|
||
# extract link dirs for rpath | ||
EXEC_PROGRAM(${GSL_CONFIG} | ||
ARGS --libs | ||
OUTPUT_VARIABLE GSL_CONFIG_LIBS ) | ||
SET(GSL_LIBRARIES "${GSL_CONFIG_LIBS}") | ||
|
||
# split off the link dirs (for rpath) | ||
# use regular expression to match wildcard equivalent "-L*<endchar>" | ||
# with <endchar> is a space or a semicolon | ||
STRING(REGEX MATCHALL "[-][L]([^ ;])+" | ||
GSL_LINK_DIRECTORIES_WITH_PREFIX | ||
"${GSL_CONFIG_LIBS}" ) | ||
# MESSAGE("DBG GSL_LINK_DIRECTORIES_WITH_PREFIX=${GSL_LINK_DIRECTORIES_WITH_PREFIX}") | ||
|
||
# remove prefix -L because we need the pure directory for LINK_DIRECTORIES | ||
|
||
IF (GSL_LINK_DIRECTORIES_WITH_PREFIX) | ||
STRING(REGEX REPLACE "[-][L]" "" GSL_LINK_DIRECTORIES ${GSL_LINK_DIRECTORIES_WITH_PREFIX} ) | ||
ENDIF (GSL_LINK_DIRECTORIES_WITH_PREFIX) | ||
SET(GSL_EXE_LINKER_FLAGS "-Wl,-rpath,${GSL_LINK_DIRECTORIES}" CACHE STRING INTERNAL) | ||
# MESSAGE("DBG GSL_LINK_DIRECTORIES=${GSL_LINK_DIRECTORIES}") | ||
# MESSAGE("DBG GSL_EXE_LINKER_FLAGS=${GSL_EXE_LINKER_FLAGS}") | ||
|
||
# ADD_DEFINITIONS("-DHAVE_GSL") | ||
# SET(GSL_DEFINITIONS "-DHAVE_GSL") | ||
MARK_AS_ADVANCED( | ||
GSL_CXX_FLAGS | ||
GSL_INCLUDE_DIR | ||
GSL_LIBRARIES | ||
GSL_LINK_DIRECTORIES | ||
GSL_DEFINITIONS | ||
) | ||
MESSAGE(STATUS "Using GSL from ${GSL_PREFIX}") | ||
|
||
ELSE(GSL_CONFIG) | ||
|
||
INCLUDE(UsePkgConfig) #needed for PKGCONFIG(...) | ||
|
||
MESSAGE(STATUS "GSL using pkgconfig") | ||
# PKGCONFIG(gsl includedir libdir linkflags cflags) | ||
PKGCONFIG(gsl GSL_INCLUDE_DIR GSL_LINK_DIRECTORIES GSL_LIBRARIES GSL_CXX_FLAGS) | ||
IF(GSL_INCLUDE_DIR) | ||
MARK_AS_ADVANCED( | ||
GSL_CXX_FLAGS | ||
GSL_INCLUDE_DIR | ||
GSL_LIBRARIES | ||
GSL_LINK_DIRECTORIES | ||
) | ||
|
||
ELSE(GSL_INCLUDE_DIR) | ||
MESSAGE("FindGSL.cmake: gsl-config/pkg-config gsl not found. Please set it manually. GSL_CONFIG=${GSL_CONFIG}") | ||
ENDIF(GSL_INCLUDE_DIR) | ||
|
||
ENDIF(GSL_CONFIG) | ||
|
||
ENDIF(UNIX) | ||
ENDIF(WIN32) | ||
|
||
|
||
IF(GSL_LIBRARIES) | ||
IF(GSL_INCLUDE_DIR OR GSL_CXX_FLAGS) | ||
|
||
SET(GSL_FOUND 1) | ||
|
||
ENDIF(GSL_INCLUDE_DIR OR GSL_CXX_FLAGS) | ||
ENDIF(GSL_LIBRARIES) | ||
|
||
|
||
# ========================================== | ||
IF(NOT GSL_FOUND) | ||
# make FIND_PACKAGE friendly | ||
IF(NOT GSL_FIND_QUIETLY) | ||
IF(GSL_FIND_REQUIRED) | ||
MESSAGE(FATAL_ERROR "GSL required, please specify it's location.") | ||
ELSE(GSL_FIND_REQUIRED) | ||
MESSAGE(STATUS "ERROR: GSL was not found.") | ||
ENDIF(GSL_FIND_REQUIRED) | ||
ENDIF(NOT GSL_FIND_QUIETLY) | ||
ENDIF(NOT GSL_FOUND) |
Oops, something went wrong.