diff -Nru rcssserver3d-0.6.3/ChangeLog rcssserver3d-0.6.4/ChangeLog --- rcssserver3d-0.6.3/ChangeLog 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/ChangeLog 2010-06-08 09:38:29.000000000 +0100 @@ -1,3 +1,86 @@ +2010-06-08 Hedayat Vatankhah + + * linux/rcssserver3d.desktop: + - changed the binary name to rcsoccersim3d + + * rcssserver3d/CMakeLists.txt: + - simspark is now a relative symlink, hopefully fixing some problems on + 'make install' + +2010-06-07 Hedayat Vatankhah + + * NEWS: + - prepared for 0.6.4 release + + * RELEASE: + - add some documentation about new monitor controls + + * plugin/soccer/gamestateaspect/gamestateitem.cpp: + - send game state with initial predicates, so that the logger will not + miss them in the next cycle + + * rcssserver3d/rcsoccersim3d.in: + - removed some extra lines checking for rcssagent3d + + * plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor.cpp: + * plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor.h: + - make the first letter of CheckVisuable() capital + +2010-06-05 Hedayat Vatankhah + + * RELEASE: + * CMakeLists.txt: + - preparing for 0.6.4 release + +2010-05-23 Hedayat Vatankhah + + * rcssserver3d/naosoccersim.rb: + * plugin/soccer/soccerruleaspect/soccerruleaspect.h: + * plugin/soccer/soccerruleaspect/soccerruleaspect.cpp: + - Added the simple referee patch from FCPortugal team (thanks to + Luis Paulo Reis) + +2010-02-28 Marian Buchta + + * cmake/FindBoost.cmake: + - added new version of FindBoost.cmake: finding boost libraries created by Visual C++ 2010 compiler. + + * plugin/soccer/agentintegration/soccerbotbehavior.cpp: + * plugin/soccer/agentstateperceptor/agentstateperceptor.cpp: + * plugin/soccer/ballstateaspect/ballstateaspect.cpp: + * plugin/soccer/beameffector/beameffector.cpp: + * plugin/soccer/catcheffector/catcheffector.cpp: + * plugin/soccer/createeffector/createeffector.cpp: + * plugin/soccer/driveeffector/driveeffector.cpp: + * plugin/soccer/gamestateaspect/gamestateaspect.cpp: + * plugin/soccer/hmdp_effector/hmdpeffector.cpp: + * plugin/soccer/hmdp_effector/hmdpperceptor.cpp: + * plugin/soccer/initeffector/initeffector.cpp: + * plugin/soccer/initeffector/singlematiniteffector.cpp: + * plugin/soccer/initeffector/staticmeshiniteffector.cpp: + * plugin/soccer/internalsoccermonitor/internalsoccerinput.cpp: + * plugin/soccer/internalsoccermonitor/internalsoccerrender.cpp: + * plugin/soccer/kickeffector/kickeffector.cpp: + * plugin/soccer/pantilteffector/pantilteffector.cpp: + * plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor.cpp: + * plugin/soccer/sayeffector/sayeffector.cpp: + * plugin/soccer/sexpmonitor/sexpmonitor.cpp: + * plugin/soccer/soccerbase/soccerbase.cpp: + * plugin/soccer/soccercontrolaspect/soccercontrolaspect.cpp: + * plugin/soccer/soccerruleaspect/soccerruleaspect.cpp: + * plugin/soccer/trainercommandparser/trainercommandparser.cpp: + * plugin/soccer/visionperceptor/visionperceptor.cpp: + * plugin/soccermonitor/soccerinput.cpp: + * rcssagent3d/hoap2behavior.cpp: + * rcssagent3d/naobehavior.cpp: + * rcssagent3d/soccerbehavior.cpp: + * rcssagent3d/soccerbotbehavior.cpp: + * rcssmonitor3d/main.cpp: + * rcssserver3d/main.cpp: + + - change shared_ptr -> boost::shared_ptr because of Visual Studio 2010 compatibility. Issue between boost::shared_ptr and std::tr1::shared_ptr + + 2010-01-18 Hedayat Vatankhah * windows/uninstall_extra.nsi: diff -Nru rcssserver3d-0.6.3/cmake/FindBoost.cmake rcssserver3d-0.6.4/cmake/FindBoost.cmake --- rcssserver3d-0.6.3/cmake/FindBoost.cmake 2010-06-08 19:24:17.000000000 +0100 +++ rcssserver3d-0.6.4/cmake/FindBoost.cmake 2010-06-08 09:38:29.000000000 +0100 @@ -1,862 +1,938 @@ -# - Try to find Boost include dirs and libraries -# Usage of this module as follows: -# -# == Using Header-Only libraries from within Boost: == -# -# find_package( Boost 1.36.0 ) -# if(Boost_FOUND) -# include_directories(${Boost_INCLUDE_DIRS}) -# add_executable(foo foo.cc) -# endif() -# -# -# == Using actual libraries from within Boost: == -# -# set(Boost_USE_STATIC_LIBS ON) -# set(Boost_USE_MULTITHREADED ON) -# find_package( Boost 1.36.0 COMPONENTS date_time filesystem system ... ) -# -# if(Boost_FOUND) -# include_directories(${Boost_INCLUDE_DIRS}) -# add_executable(foo foo.cc) -# target_link_libraries(foo ${Boost_LIBRARIES}) -# endif() -# -# -# The components list needs to contain actual names of boost libraries only, -# such as "date_time" for "libboost_date_time". If you're using parts of -# Boost that contain header files only (e.g. foreach) you do not need to -# specify COMPONENTS. -# -# You should provide a minimum version number that should be used. If you provide this -# version number and specify the REQUIRED attribute, this module will fail if it -# can't find the specified or a later version. If you specify a version number this is -# automatically put into the considered list of version numbers and thus doesn't need -# to be specified in the Boost_ADDITIONAL_VERSIONS variable (see below). -# -# NOTE for Visual Studio Users: -# Automatic linking is used on MSVC & Borland compilers by default when -# #including things in Boost. It's important to note that setting -# Boost_USE_STATIC_LIBS to OFF is NOT enough to get you dynamic linking, -# should you need this feature. Automatic linking typically uses static -# libraries with a few exceptions (Boost.Python is one). -# -# Please see the section below near Boost_LIB_DIAGNOSTIC_DEFINITIONS for -# more details. Adding a TARGET_LINK_LIBRARIES() as shown in the example -# above appears to cause VS to link dynamically if Boost_USE_STATIC_LIBS -# gets set to OFF. It is suggested you avoid automatic linking since it -# will make your application less portable. -# -# =========== The mess that is Boost_ADDITIONAL_VERSIONS (sorry?) ============ -# -# OK, so the Boost_ADDITIONAL_VERSIONS variable can be used to specify a list of -# boost version numbers that should be taken into account when searching -# for Boost. Unfortunately boost puts the version number into the -# actual filename for the libraries, so this variable will certainly be needed -# in the future when new Boost versions are released. -# -# Currently this module searches for the following version numbers: -# 1.33, 1.33.0, 1.33.1, 1.34, 1.34.0, 1.34.1, 1.35, 1.35.0, 1.35.1, -# 1.36, 1.36.0, 1.36.1, 1.37, 1.37.0, 1.38, 1.38.0 -# -# NOTE: If you add a new major 1.x version in Boost_ADDITIONAL_VERSIONS you should -# add both 1.x and 1.x.0 as shown above. Official Boost include directories -# omit the 3rd version number from include paths if it is 0 although not all -# binary Boost releases do so. -# -# SET(Boost_ADDITIONAL_VERSIONS "0.99" "0.99.0" "1.78" "1.78.0") -# -# ============================================================================ -# -# Variables used by this module, they can change the default behaviour and need to be set -# before calling find_package: -# -# Boost_USE_MULTITHREADED Can be set to OFF to use the non-multithreaded -# boost libraries. If not specified, defaults -# to ON. -# -# Boost_USE_STATIC_LIBS Can be set to ON to force the use of the static -# boost libraries. Defaults to OFF. -# -# Other Variables used by this module which you may want to set. -# -# Boost_ADDITIONAL_VERSIONS A list of version numbers to use for searching -# the boost include directory. Please see -# the documentation above regarding this -# annoying, but necessary variable :( -# -# Boost_DEBUG Set this to TRUE to enable debugging output -# of FindBoost.cmake if you are having problems. -# Please enable this before filing any bug -# reports. -# -# Boost_COMPILER Set this to the compiler suffix used by Boost -# (e.g. "-gcc43") if FindBoods has problems finding -# the proper Boost installation -# -# These last three variables are available also as environment variables: -# -# BOOST_ROOT or BOOSTROOT The preferred installation prefix for searching for -# Boost. Set this if the module has problems finding -# the proper Boost installation. -# -# BOOST_INCLUDEDIR Set this to the include directory of Boost, if the -# module has problems finding the proper Boost installation -# -# BOOST_LIBRARYDIR Set this to the lib directory of Boost, if the -# module has problems finding the proper Boost installation -# -# Variables defined by this module: -# -# Boost_FOUND System has Boost, this means the include dir was -# found, as well as all the libraries specified in -# the COMPONENTS list. -# -# Boost_INCLUDE_DIRS Boost include directories: not cached -# -# Boost_INCLUDE_DIR This is almost the same as above, but this one is -# cached and may be modified by advanced users -# -# Boost_LIBRARIES Link these to use the Boost libraries that you -# specified: not cached -# -# Boost_LIBRARY_DIRS The path to where the Boost library files are. -# -# Boost_VERSION The version number of the boost libraries that -# have been found, same as in version.hpp from Boost -# -# Boost_LIB_VERSION The version number in filename form as -# it's appended to the library filenames -# -# Boost_MAJOR_VERSION major version number of boost -# Boost_MINOR_VERSION minor version number of boost -# Boost_SUBMINOR_VERSION subminor version number of boost -# -# Boost_LIB_DIAGNOSTIC_DEFINITIONS [WIN32 Only] You can call -# add_definitions(${Boost_LIB_DIAGNOSTIC_DEFINTIIONS}) -# to have diagnostic information about Boost's -# automatic linking outputted during compilation time. -# -# For each component you list the following variables are set. -# ATTENTION: The component names need to be in lower case, just as the boost -# library names however the CMake variables use upper case for the component -# part. So you'd get Boost_SERIALIZATION_FOUND for example. -# -# Boost_${COMPONENT}_FOUND True IF the Boost library "component" was found. -# Boost_${COMPONENT}_LIBRARY The absolute path of the Boost library "component". -# Boost_${COMPONENT}_LIBRARY_DEBUG The absolute path of the debug version of the -# Boost library "component". -# Boost_${COMPONENT}_LIBRARY_RELEASE The absolute path of the release version of the -# Boost library "component" -# -# Copyright (c) 2006-2008 Andreas Schneider -# Copyright (c) 2007 Wengo -# Copyright (c) 2007 Mike Jackson -# Copyright (c) 2008 Andreas Pakulat -# -# Redistribution AND use is allowed according to the terms of the New -# BSD license. -# For details see the accompanying COPYING-CMAKE-SCRIPTS file. -# - -IF(NOT DEFINED Boost_USE_MULTITHREADED) - SET(Boost_USE_MULTITHREADED TRUE) -ENDIF() - -if(Boost_FIND_VERSION_EXACT) - # The version may appear in a directory with or without the patch - # level, even when the patch level is non-zero. - set(_boost_TEST_VERSIONS - "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}.${Boost_FIND_VERSION_PATCH}" - "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}") -else(Boost_FIND_VERSION_EXACT) - # The user has not requested an exact version. Among known - # versions, find those that are acceptable to the user request. - set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS} - "1.38.0" "1.38" "1.37.0" "1.37" - "1.36.1" "1.36.0" "1.36" "1.35.1" "1.35.0" "1.35" "1.34.1" "1.34.0" - "1.34" "1.33.1" "1.33.0" "1.33") - set(_boost_TEST_VERSIONS) - if(Boost_FIND_VERSION) - set(_Boost_FIND_VERSION_SHORT "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}") - # Select acceptable versions. - foreach(version ${_Boost_KNOWN_VERSIONS}) - if(NOT "${version}" VERSION_LESS "${Boost_FIND_VERSION}") - # This version is high enough. - list(APPEND _boost_TEST_VERSIONS "${version}") - elseif("${version}.99" VERSION_EQUAL "${_Boost_FIND_VERSION_SHORT}.99") - # This version is a short-form for the requested version with - # the patch level dropped. - list(APPEND _boost_TEST_VERSIONS "${version}") - endif() - endforeach(version) - else(Boost_FIND_VERSION) - # Any version is acceptable. - set(_boost_TEST_VERSIONS "${_Boost_KNOWN_VERSIONS}") - endif(Boost_FIND_VERSION) -endif(Boost_FIND_VERSION_EXACT) - -# The reason that we failed to find Boost. This will be set to a -# user-friendly message when we fail to find some necessary piece of -# Boost. -set(Boost_ERROR_REASON) - -############################################ -# -# Check the existence of the libraries. -# -############################################ -# This macro was taken directly from the FindQt4.cmake file that is included -# with the CMake distribution. This is NOT my work. All work was done by the -# original authors of the FindQt4.cmake file. Only minor modifications were -# made to remove references to Qt and make this file more generally applicable -######################################################################### - -MACRO (_Boost_ADJUST_LIB_VARS basename) - IF (Boost_INCLUDE_DIR ) - IF (Boost_${basename}_LIBRARY_DEBUG AND Boost_${basename}_LIBRARY_RELEASE) - # if the generator supports configuration types then set - # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value - IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) - SET(Boost_${basename}_LIBRARY optimized ${Boost_${basename}_LIBRARY_RELEASE} debug ${Boost_${basename}_LIBRARY_DEBUG}) - ELSE(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) - # if there are no configuration types and CMAKE_BUILD_TYPE has no value - # then just use the release libraries - SET(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE} ) - ENDIF(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) - SET(Boost_${basename}_LIBRARIES optimized ${Boost_${basename}_LIBRARY_RELEASE} debug ${Boost_${basename}_LIBRARY_DEBUG}) - ENDIF (Boost_${basename}_LIBRARY_DEBUG AND Boost_${basename}_LIBRARY_RELEASE) - - # if only the release version was found, set the debug variable also to the release version - IF (Boost_${basename}_LIBRARY_RELEASE AND NOT Boost_${basename}_LIBRARY_DEBUG) - SET(Boost_${basename}_LIBRARY_DEBUG ${Boost_${basename}_LIBRARY_RELEASE}) - SET(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE}) - SET(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_RELEASE}) - ENDIF (Boost_${basename}_LIBRARY_RELEASE AND NOT Boost_${basename}_LIBRARY_DEBUG) - - # if only the debug version was found, set the release variable also to the debug version - IF (Boost_${basename}_LIBRARY_DEBUG AND NOT Boost_${basename}_LIBRARY_RELEASE) - SET(Boost_${basename}_LIBRARY_RELEASE ${Boost_${basename}_LIBRARY_DEBUG}) - SET(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_DEBUG}) - SET(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_DEBUG}) - ENDIF (Boost_${basename}_LIBRARY_DEBUG AND NOT Boost_${basename}_LIBRARY_RELEASE) - - IF (Boost_${basename}_LIBRARY) - set(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY} CACHE FILEPATH "The Boost ${basename} library") - - # Remove superfluous "debug" / "optimized" keywords from - # Boost_LIBRARY_DIRS - FOREACH(_boost_my_lib ${Boost_${basename}_LIBRARY}) - GET_FILENAME_COMPONENT(_boost_my_lib_path "${_boost_my_lib}" PATH) - LIST(APPEND Boost_LIBRARY_DIRS ${_boost_my_lib_path}) - ENDFOREACH() - LIST(REMOVE_DUPLICATES Boost_LIBRARY_DIRS) - - set(Boost_LIBRARY_DIRS ${Boost_LIBRARY_DIRS} CACHE FILEPATH "Boost library directory") - SET(Boost_${basename}_FOUND ON CACHE INTERNAL "Whether the Boost ${basename} library found") - ENDIF (Boost_${basename}_LIBRARY) - - ENDIF (Boost_INCLUDE_DIR ) - # Make variables changeble to the advanced user - MARK_AS_ADVANCED( - Boost_${basename}_LIBRARY - Boost_${basename}_LIBRARY_RELEASE - Boost_${basename}_LIBRARY_DEBUG - ) -ENDMACRO (_Boost_ADJUST_LIB_VARS) - -# -# Runs compiler with "-dumpversion" and parses major/minor -# version with a regex. -# -FUNCTION(_Boost_COMPILER_DUMPVERSION _OUTPUT_VERSION) - - EXEC_PROGRAM(${CMAKE_CXX_COMPILER} - ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion - OUTPUT_VARIABLE _boost_COMPILER_VERSION - ) - STRING(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2" - _boost_COMPILER_VERSION ${_boost_COMPILER_VERSION}) - - SET(${_OUTPUT_VERSION} ${_boost_COMPILER_VERSION} PARENT_SCOPE) -ENDFUNCTION() - - -#------------------------------------------------------------------------------- - - -SET( _boost_IN_CACHE TRUE) -IF(Boost_INCLUDE_DIR) - FOREACH(COMPONENT ${Boost_FIND_COMPONENTS}) - STRING(TOUPPER ${COMPONENT} COMPONENT) - IF(NOT Boost_${COMPONENT}_FOUND) - SET( _boost_IN_CACHE FALSE) - ENDIF(NOT Boost_${COMPONENT}_FOUND) - ENDFOREACH(COMPONENT) -ELSE(Boost_INCLUDE_DIR) - SET( _boost_IN_CACHE FALSE) -ENDIF(Boost_INCLUDE_DIR) - -IF (_boost_IN_CACHE) - # in cache already - SET(Boost_FOUND TRUE) - FOREACH(COMPONENT ${Boost_FIND_COMPONENTS}) - STRING(TOUPPER ${COMPONENT} COMPONENT) - _Boost_ADJUST_LIB_VARS( ${COMPONENT} ) - SET(Boost_LIBRARIES ${Boost_LIBRARIES} ${Boost_${COMPONENT}_LIBRARY}) - ENDFOREACH(COMPONENT) - SET(Boost_INCLUDE_DIRS ${Boost_INCLUDE_DIR}) - IF(Boost_VERSION AND NOT "${Boost_VERSION}" STREQUAL "0") - MATH(EXPR Boost_MAJOR_VERSION "${Boost_VERSION} / 100000") - MATH(EXPR Boost_MINOR_VERSION "${Boost_VERSION} / 100 % 1000") - MATH(EXPR Boost_SUBMINOR_VERSION "${Boost_VERSION} % 100") - ENDIF(Boost_VERSION AND NOT "${Boost_VERSION}" STREQUAL "0") - if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "boost ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION} " - "is already in the cache. For debugging messages, please clear the cache.") - endif() -ELSE (_boost_IN_CACHE) - # Need to search for boost - if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "Boost not in cache") - # Output some of their choices - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "_boost_TEST_VERSIONS = ${_boost_TEST_VERSIONS}") - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "Boost_USE_MULTITHREADED = ${Boost_USE_MULTITHREADED}") - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "Boost_USE_STATIC_LIBS = ${Boost_USE_STATIC_LIBS}") - endif() - - IF(WIN32) - # In windows, automatic linking is performed, so you do not have - # to specify the libraries. If you are linking to a dynamic - # runtime, then you can choose to link to either a static or a - # dynamic Boost library, the default is to do a static link. You - # can alter this for a specific library "whatever" by defining - # BOOST_WHATEVER_DYN_LINK to force Boost library "whatever" to be - # linked dynamically. Alternatively you can force all Boost - # libraries to dynamic link by defining BOOST_ALL_DYN_LINK. - - # This feature can be disabled for Boost library "whatever" by - # defining BOOST_WHATEVER_NO_LIB, or for all of Boost by defining - # BOOST_ALL_NO_LIB. - - # If you want to observe which libraries are being linked against - # then defining BOOST_LIB_DIAGNOSTIC will cause the auto-linking - # code to emit a #pragma message each time a library is selected - # for linking. - SET(Boost_LIB_DIAGNOSTIC_DEFINITIONS - "-DBOOST_LIB_DIAGNOSTIC" CACHE STRING "Boost diagnostic define") - ENDIF(WIN32) - - SET(_boost_INCLUDE_SEARCH_DIRS - C:/boost/include - C:/boost - "$ENV{ProgramFiles}/boost" - C:/library/boost - "C:/Program Files/boost" - "C:/Program Files (x86)/boost" - /sw/local/include - ) - - # If BOOST_ROOT was defined in the environment, use it. - if (NOT BOOST_ROOT AND NOT $ENV{BOOST_ROOT} STREQUAL "") - set(BOOST_ROOT $ENV{BOOST_ROOT}) - endif(NOT BOOST_ROOT AND NOT $ENV{BOOST_ROOT} STREQUAL "") - - # If BOOSTROOT was defined in the environment, use it. - if (NOT BOOST_ROOT AND NOT $ENV{BOOSTROOT} STREQUAL "") - set(BOOST_ROOT $ENV{BOOSTROOT}) - endif(NOT BOOST_ROOT AND NOT $ENV{BOOSTROOT} STREQUAL "") - - # If BOOST_INCLUDEDIR was defined in the environment, use it. - IF( NOT $ENV{BOOST_INCLUDEDIR} STREQUAL "" ) - set(BOOST_INCLUDEDIR $ENV{BOOST_INCLUDEDIR}) - ENDIF( NOT $ENV{BOOST_INCLUDEDIR} STREQUAL "" ) - - # If BOOST_LIBRARYDIR was defined in the environment, use it. - IF( NOT $ENV{BOOST_LIBRARYDIR} STREQUAL "" ) - set(BOOST_LIBRARYDIR $ENV{BOOST_LIBRARYDIR}) - ENDIF( NOT $ENV{BOOST_LIBRARYDIR} STREQUAL "" ) - - IF( BOOST_ROOT ) - file(TO_CMAKE_PATH ${BOOST_ROOT} BOOST_ROOT) - ENDIF( BOOST_ROOT ) - - if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "Declared as CMake or Environmental Variables:") - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - " BOOST_ROOT = ${BOOST_ROOT}") - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - " BOOST_INCLUDEDIR = ${BOOST_INCLUDEDIR}") - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - " BOOST_LIBRARYDIR = ${BOOST_LIBRARYDIR}") - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "_boost_TEST_VERSIONS = ${_boost_TEST_VERSIONS}") - endif() - - IF( BOOST_ROOT ) - SET(_boost_INCLUDE_SEARCH_DIRS - ${BOOST_ROOT}/include - ${BOOST_ROOT} - ${_boost_INCLUDE_SEARCH_DIRS}) - ENDIF( BOOST_ROOT ) - - IF( BOOST_INCLUDEDIR ) - file(TO_CMAKE_PATH ${BOOST_INCLUDEDIR} BOOST_INCLUDEDIR) - SET(_boost_INCLUDE_SEARCH_DIRS - ${BOOST_INCLUDEDIR} ${_boost_INCLUDE_SEARCH_DIRS}) - ENDIF( BOOST_INCLUDEDIR ) - - # ------------------------------------------------------------------------ - # Search for Boost include DIR - # ------------------------------------------------------------------------ - # Try to find Boost by stepping backwards through the Boost versions - # we know about. - IF( NOT Boost_INCLUDE_DIR ) - # Build a list of path suffixes for each version. - SET(_boost_PATH_SUFFIXES) - FOREACH(_boost_VER ${_boost_TEST_VERSIONS}) - # Add in a path suffix, based on the required version, ideally - # we could read this from version.hpp, but for that to work we'd - # need to know the include dir already - set(_boost_BOOSTIFIED_VERSION) - - # Transform 1.35 => 1_35 and 1.36.0 => 1_36_0 - IF(_boost_VER MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+") - STRING(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\1_\\2_\\3" - _boost_BOOSTIFIED_VERSION ${_boost_VER}) - ELSEIF(_boost_VER MATCHES "[0-9]+\\.[0-9]+") - STRING(REGEX REPLACE "([0-9]+)\\.([0-9]+)" "\\1_\\2" - _boost_BOOSTIFIED_VERSION ${_boost_VER}) - ENDIF() - - list(APPEND _boost_PATH_SUFFIXES "boost-${_boost_BOOSTIFIED_VERSION}") - if(WIN32) - # For BoostPro's underscores (and others?) - list(APPEND _boost_PATH_SUFFIXES "boost_${_boost_BOOSTIFIED_VERSION}") - endif() - - ENDFOREACH(_boost_VER) - - if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "Include debugging info:") - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - " _boost_INCLUDE_SEARCH_DIRS = ${_boost_INCLUDE_SEARCH_DIRS}") - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - " _boost_PATH_SUFFIXES = ${_boost_PATH_SUFFIXES}") - endif() - - # Look for a standard boost header file. - FIND_PATH(Boost_INCLUDE_DIR - NAMES boost/config.hpp - HINTS ${_boost_INCLUDE_SEARCH_DIRS} - PATH_SUFFIXES ${_boost_PATH_SUFFIXES} - ) - ENDIF( NOT Boost_INCLUDE_DIR ) - - # ------------------------------------------------------------------------ - # Extract version information from version.hpp - # ------------------------------------------------------------------------ - - IF(Boost_INCLUDE_DIR) - # Extract Boost_VERSION and Boost_LIB_VERSION from version.hpp - # Read the whole file: - # - SET(BOOST_VERSION 0) - SET(BOOST_LIB_VERSION "") - FILE(READ "${Boost_INCLUDE_DIR}/boost/version.hpp" _boost_VERSION_HPP_CONTENTS) - if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "location of version.hpp: ${Boost_INCLUDE_DIR}/boost/version.hpp") - endif() - - STRING(REGEX REPLACE ".*#define BOOST_VERSION ([0-9]+).*" "\\1" Boost_VERSION "${_boost_VERSION_HPP_CONTENTS}") - STRING(REGEX REPLACE ".*#define BOOST_LIB_VERSION \"([0-9_]+)\".*" "\\1" Boost_LIB_VERSION "${_boost_VERSION_HPP_CONTENTS}") - - SET(Boost_LIB_VERSION ${Boost_LIB_VERSION} CACHE INTERNAL "The library version string for boost libraries") - SET(Boost_VERSION ${Boost_VERSION} CACHE INTERNAL "The version number for boost libraries") - - IF(NOT "${Boost_VERSION}" STREQUAL "0") - MATH(EXPR Boost_MAJOR_VERSION "${Boost_VERSION} / 100000") - MATH(EXPR Boost_MINOR_VERSION "${Boost_VERSION} / 100 % 1000") - MATH(EXPR Boost_SUBMINOR_VERSION "${Boost_VERSION} % 100") - - set(Boost_ERROR_REASON - "${Boost_ERROR_REASON}Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}\nBoost include path: ${Boost_INCLUDE_DIR}") - ENDIF(NOT "${Boost_VERSION}" STREQUAL "0") - if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "version.hpp reveals boost " - "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}") - endif() - ELSE(Boost_INCLUDE_DIR) - set(Boost_ERROR_REASON - "${Boost_ERROR_REASON}Unable to find the Boost header files. Please set BOOST_ROOT to the root directory containing Boost or BOOST_INCLUDEDIR to the directory containing Boost's headers.") - ENDIF(Boost_INCLUDE_DIR) - - # ------------------------------------------------------------------------ - # Suffix initialization and compiler suffix detection. - # ------------------------------------------------------------------------ - - # Setting some more suffixes for the library - SET (Boost_LIB_PREFIX "") - if ( MSVC AND Boost_USE_STATIC_LIBS ) - SET (Boost_LIB_PREFIX "lib") - endif() - - if (Boost_COMPILER) - set(_boost_COMPILER ${Boost_COMPILER}) - if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "using user-specified Boost_COMPILER = ${_boost_COMPILER}") - endif() - else(Boost_COMPILER) - # Attempt to guess the compiler suffix - # NOTE: this is not perfect yet, if you experience any issues - # please report them and use the Boost_COMPILER variable - # to work around the problems. - if (MSVC90) - SET (_boost_COMPILER "-vc90") - elseif (MSVC80) - SET (_boost_COMPILER "-vc80") - elseif (MSVC71) - SET (_boost_COMPILER "-vc71") - elseif (MSVC70) # Good luck! - SET (_boost_COMPILER "-vc7") # yes, this is correct - elseif (MSVC60) # Good luck! - SET (_boost_COMPILER "-vc6") # yes, this is correct - elseif (BORLAND) - SET (_boost_COMPILER "-bcb") - elseif("${CMAKE_CXX_COMPILER}" MATCHES "icl" - OR "${CMAKE_CXX_COMPILER}" MATCHES "icpc") - if(WIN32) - set (_boost_COMPILER "-iw") - else() - set (_boost_COMPILER "-il") - endif() - elseif (MINGW) - if(${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION} VERSION_LESS 1.34) - SET(_boost_COMPILER "-mgw") # no GCC version encoding prior to 1.34 - else() - _Boost_COMPILER_DUMPVERSION(_boost_COMPILER_VERSION) - SET (_boost_COMPILER "-mgw${_boost_COMPILER_VERSION}") - endif() - elseif (UNIX) - if (CMAKE_COMPILER_IS_GNUCXX) -#if(${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION} VERSION_LESS 1.34) - - if(${Boost_MINOR_VERSION} LESS 34) - SET(_boost_COMPILER "-gcc") # no GCC version encoding prior to 1.34 - else() - _Boost_COMPILER_DUMPVERSION(_boost_COMPILER_VERSION) - # Determine which version of GCC we have. - IF(APPLE) - IF(Boost_MINOR_VERSION) - IF(${Boost_MINOR_VERSION} GREATER 35) - # In Boost 1.36.0 and newer, the mangled compiler name used - # on Mac OS X/Darwin is "xgcc". - SET(_boost_COMPILER "-xgcc${_boost_COMPILER_VERSION}") - ELSE(${Boost_MINOR_VERSION} GREATER 35) - # In Boost <= 1.35.0, there is no mangled compiler name for - # the Mac OS X/Darwin version of GCC. - SET(_boost_COMPILER "") - ENDIF(${Boost_MINOR_VERSION} GREATER 35) - ELSE(Boost_MINOR_VERSION) - # We don't know the Boost version, so assume it's - # pre-1.36.0. - SET(_boost_COMPILER "") - ENDIF(Boost_MINOR_VERSION) - ELSE() - SET (_boost_COMPILER "-gcc${_boost_COMPILER_VERSION}") - ENDIF() - endif() - endif (CMAKE_COMPILER_IS_GNUCXX) - endif() - if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "guessed _boost_COMPILER = ${_boost_COMPILER}") - endif() - endif(Boost_COMPILER) - - SET (_boost_MULTITHREADED "-mt") - if( NOT Boost_USE_MULTITHREADED ) - set (_boost_MULTITHREADED "") - endif() - if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "_boost_MULTITHREADED = ${_boost_MULTITHREADED}") - endif() - - SET( _boost_STATIC_TAG "") - set( _boost_ABI_TAG "") - IF (WIN32) - IF(MSVC) - SET (_boost_ABI_TAG "g") - ENDIF(MSVC) - IF( Boost_USE_STATIC_LIBS ) - SET( _boost_STATIC_TAG "-s") - ENDIF( Boost_USE_STATIC_LIBS ) - ENDIF(WIN32) - SET (_boost_ABI_TAG "${_boost_ABI_TAG}d") - if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "_boost_STATIC_TAG = ${_boost_STATIC_TAG}") - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "_boost_ABI_TAG = ${_boost_ABI_TAG}") - endif() - - # ------------------------------------------------------------------------ - # Begin finding boost libraries - # ------------------------------------------------------------------------ - - SET(_boost_LIBRARIES_SEARCH_DIRS - C:/boost/lib - C:/boost - "$ENV{ProgramFiles}/boost/boost_${Boost_MAJOR_VERSION}_${Boost_MINOR_VERSION}_${Boost_SUBMINOR_VERSION}/lib" - "$ENV{ProgramFiles}/boost" - C:/library/boost/stage/lib - "C:/Program Files/boost/stage/lib" - "C:/Program Files (x86)/boost/stage/lib" - C:/boost/lib - /sw/local/lib - ) - IF( BOOST_ROOT ) - SET(_boost_LIBRARIES_SEARCH_DIRS - ${BOOST_ROOT}/lib - ${BOOST_ROOT}/stage/lib - ${_boost_LIBRARIES_SEARCH_DIRS}) - ENDIF( BOOST_ROOT ) - - IF( BOOST_LIBRARYDIR ) - file(TO_CMAKE_PATH ${BOOST_LIBRARYDIR} BOOST_LIBRARYDIR) - SET(_boost_LIBRARIES_SEARCH_DIRS - ${BOOST_LIBRARYDIR} ${_boost_LIBRARIES_SEARCH_DIRS}) - ENDIF( BOOST_LIBRARYDIR ) - - if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "_boost_LIBRARIES_SEARCH_DIRS = ${_boost_LIBRARIES_SEARCH_DIRS}") - endif() - - FOREACH(COMPONENT ${Boost_FIND_COMPONENTS}) - STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT) - SET( Boost_${UPPERCOMPONENT}_LIBRARY "Boost_${UPPERCOMPONENT}_LIBRARY-NOTFOUND" ) - SET( Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE "Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE-NOTFOUND" ) - SET( Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG "Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG-NOTFOUND") - - # Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES - IF( Boost_USE_STATIC_LIBS ) - SET( _boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) - IF(WIN32) - SET(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) - ELSE(WIN32) - SET(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) - ENDIF(WIN32) - ENDIF( Boost_USE_STATIC_LIBS ) - - FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE - NAMES ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}-${Boost_LIB_VERSION} - ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_STATIC_TAG}-${Boost_LIB_VERSION} - ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}-${Boost_LIB_VERSION} - ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}-${Boost_LIB_VERSION} - ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED} - ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG} - ${Boost_LIB_PREFIX}boost_${COMPONENT} - HINTS ${_boost_LIBRARIES_SEARCH_DIRS} - ) - - FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG - NAMES ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}-${_boost_ABI_TAG}-${Boost_LIB_VERSION} - ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_STATIC_TAG}${_boost_ABI_TAG}-${Boost_LIB_VERSION} - ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}-${_boost_ABI_TAG}-${Boost_LIB_VERSION} - ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}${_boost_ABI_TAG}-${Boost_LIB_VERSION} - ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}-${_boost_ABI_TAG} - ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}${_boost_ABI_TAG} - ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_boost_ABI_TAG} - HINTS ${_boost_LIBRARIES_SEARCH_DIRS} - ) - - _Boost_ADJUST_LIB_VARS(${UPPERCOMPONENT}) - IF( Boost_USE_STATIC_LIBS ) - SET(CMAKE_FIND_LIBRARY_SUFFIXES ${_boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) - ENDIF( Boost_USE_STATIC_LIBS ) - ENDFOREACH(COMPONENT) - # ------------------------------------------------------------------------ - # End finding boost libraries - # ------------------------------------------------------------------------ - - SET(Boost_INCLUDE_DIRS - ${Boost_INCLUDE_DIR} - ) - - SET(Boost_FOUND FALSE) - IF(Boost_INCLUDE_DIR) - SET( Boost_FOUND TRUE ) - - # Check the version of Boost against the requested version. - if (Boost_FIND_VERSION AND NOT Boost_FIND_VERSION_MINOR) - message(SEND_ERROR "When requesting a specific version of Boost, you must provide at least the major and minor version numbers, e.g., 1.34") - endif (Boost_FIND_VERSION AND NOT Boost_FIND_VERSION_MINOR) - if(Boost_MAJOR_VERSION LESS "${Boost_FIND_VERSION_MAJOR}" ) - set( Boost_FOUND FALSE ) - set(_Boost_VERSION_AGE "old") - elseif(Boost_MAJOR_VERSION EQUAL "${Boost_FIND_VERSION_MAJOR}" ) - if(Boost_MINOR_VERSION LESS "${Boost_FIND_VERSION_MINOR}" ) - set( Boost_FOUND FALSE ) - set(_Boost_VERSION_AGE "old") - elseif(Boost_MINOR_VERSION EQUAL "${Boost_FIND_VERSION_MINOR}" ) - if( Boost_FIND_VERSION_PATCH AND Boost_SUBMINOR_VERSION LESS "${Boost_FIND_VERSION_PATCH}" ) - set( Boost_FOUND FALSE ) - set(_Boost_VERSION_AGE "old") - endif( Boost_FIND_VERSION_PATCH AND Boost_SUBMINOR_VERSION LESS "${Boost_FIND_VERSION_PATCH}" ) - endif( Boost_MINOR_VERSION LESS "${Boost_FIND_VERSION_MINOR}" ) - endif( Boost_MAJOR_VERSION LESS "${Boost_FIND_VERSION_MAJOR}" ) - - if (Boost_FOUND AND Boost_FIND_VERSION_EXACT) - # If the user requested an exact version of Boost, check - # that. We already know that the Boost version we have is >= the - # requested version. - set(_Boost_VERSION_AGE "new") - - # If the user didn't specify a patchlevel, it's 0. - if (NOT Boost_FIND_VERSION_PATCH) - set(Boost_FIND_VERSION_PATCH 0) - endif (NOT Boost_FIND_VERSION_PATCH) - - # We'll set Boost_FOUND true again if we have an exact version match. - set(Boost_FOUND FALSE) - if(Boost_MAJOR_VERSION EQUAL "${Boost_FIND_VERSION_MAJOR}" ) - if(Boost_MINOR_VERSION EQUAL "${Boost_FIND_VERSION_MINOR}" ) - if(Boost_SUBMINOR_VERSION EQUAL "${Boost_FIND_VERSION_PATCH}" ) - set( Boost_FOUND TRUE ) - endif(Boost_SUBMINOR_VERSION EQUAL "${Boost_FIND_VERSION_PATCH}" ) - endif( Boost_MINOR_VERSION EQUAL "${Boost_FIND_VERSION_MINOR}" ) - endif( Boost_MAJOR_VERSION EQUAL "${Boost_FIND_VERSION_MAJOR}" ) - endif (Boost_FOUND AND Boost_FIND_VERSION_EXACT) - - if(NOT Boost_FOUND) - # State that we found a version of Boost that is too new or too old. - set(Boost_ERROR_REASON - "${Boost_ERROR_REASON}\nDetected version of Boost is too ${_Boost_VERSION_AGE}. Requested version was ${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}") - if (Boost_FIND_VERSION_PATCH) - set(Boost_ERROR_REASON - "${Boost_ERROR_REASON}.${Boost_FIND_VERSION_PATCH}") - endif (Boost_FIND_VERSION_PATCH) - if (NOT Boost_FIND_VERSION_EXACT) - set(Boost_ERROR_REASON "${Boost_ERROR_REASON} (or newer)") - endif (NOT Boost_FIND_VERSION_EXACT) - set(Boost_ERROR_REASON "${Boost_ERROR_REASON}.") - endif (NOT Boost_FOUND) - - if (Boost_FOUND) - set(_boost_CHECKED_COMPONENT FALSE) - set(_Boost_MISSING_COMPONENTS) - foreach(COMPONENT ${Boost_FIND_COMPONENTS}) - string(TOUPPER ${COMPONENT} COMPONENT) - set(_boost_CHECKED_COMPONENT TRUE) - if(NOT Boost_${COMPONENT}_FOUND) - string(TOLOWER ${COMPONENT} COMPONENT) - list(APPEND _Boost_MISSING_COMPONENTS ${COMPONENT}) - set( Boost_FOUND FALSE) - endif(NOT Boost_${COMPONENT}_FOUND) - endforeach(COMPONENT) - endif (Boost_FOUND) - - if(Boost_DEBUG) - message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] Boost_FOUND = ${Boost_FOUND}") - endif() - - if (_Boost_MISSING_COMPONENTS) - # We were unable to find some libraries, so generate a sensible - # error message that lists the libraries we were unable to find. - set(Boost_ERROR_REASON - "${Boost_ERROR_REASON}\nThe following Boost libraries could not be found:\n") - foreach(COMPONENT ${_Boost_MISSING_COMPONENTS}) - set(Boost_ERROR_REASON - "${Boost_ERROR_REASON} boost_${COMPONENT}\n") - endforeach(COMPONENT) - - list(LENGTH Boost_FIND_COMPONENTS Boost_NUM_COMPONENTS_WANTED) - list(LENGTH _Boost_MISSING_COMPONENTS Boost_NUM_MISSING_COMPONENTS) - if (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS}) - set(Boost_ERROR_REASON - "${Boost_ERROR_REASON}No Boost libraries were found. You may need to set Boost_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.") - else (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS}) - set(Boost_ERROR_REASON - "${Boost_ERROR_REASON}Some (but not all) of the required Boost libraries were found. You may need to install these additional Boost libraries. Alternatively, set Boost_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.") - endif (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS}) - endif (_Boost_MISSING_COMPONENTS) - - IF( NOT Boost_LIBRARY_DIRS AND NOT _boost_CHECKED_COMPONENT ) - # Compatibility Code for backwards compatibility with CMake - # 2.4's FindBoost module. - - # Look for the boost library path. - # Note that the user may not have installed any libraries - # so it is quite possible the Boost_LIBRARY_PATH may not exist. - SET(_boost_LIB_DIR ${Boost_INCLUDE_DIR}) - - IF("${_boost_LIB_DIR}" MATCHES "boost-[0-9]+") - GET_FILENAME_COMPONENT(_boost_LIB_DIR ${_boost_LIB_DIR} PATH) - ENDIF ("${_boost_LIB_DIR}" MATCHES "boost-[0-9]+") - - IF("${_boost_LIB_DIR}" MATCHES "/include$") - # Strip off the trailing "/include" in the path. - GET_FILENAME_COMPONENT(_boost_LIB_DIR ${_boost_LIB_DIR} PATH) - ENDIF("${_boost_LIB_DIR}" MATCHES "/include$") - - IF(EXISTS "${_boost_LIB_DIR}/lib") - SET (_boost_LIB_DIR ${_boost_LIB_DIR}/lib) - ELSE(EXISTS "${_boost_LIB_DIR}/lib") - IF(EXISTS "${_boost_LIB_DIR}/stage/lib") - SET(_boost_LIB_DIR ${_boost_LIB_DIR}/stage/lib) - ELSE(EXISTS "${_boost_LIB_DIR}/stage/lib") - SET(_boost_LIB_DIR "") - ENDIF(EXISTS "${_boost_LIB_DIR}/stage/lib") - ENDIF(EXISTS "${_boost_LIB_DIR}/lib") - - IF(_boost_LIB_DIR AND EXISTS "${_boost_LIB_DIR}") - SET(Boost_LIBRARY_DIRS ${_boost_LIB_DIR} CACHE FILEPATH "Boost library directory") - ENDIF(_boost_LIB_DIR AND EXISTS "${_boost_LIB_DIR}") - - ENDIF( NOT Boost_LIBRARY_DIRS AND NOT _boost_CHECKED_COMPONENT ) - - ELSE(Boost_INCLUDE_DIR) - SET( Boost_FOUND FALSE) - ENDIF(Boost_INCLUDE_DIR) - - IF (Boost_FOUND) - IF (NOT Boost_FIND_QUIETLY) - MESSAGE(STATUS "Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}") - ENDIF(NOT Boost_FIND_QUIETLY) - IF (NOT Boost_FIND_QUIETLY) - MESSAGE(STATUS "Found the following Boost libraries:") - ENDIF(NOT Boost_FIND_QUIETLY) - FOREACH ( COMPONENT ${Boost_FIND_COMPONENTS} ) - STRING( TOUPPER ${COMPONENT} UPPERCOMPONENT ) - IF ( Boost_${UPPERCOMPONENT}_FOUND ) - IF (NOT Boost_FIND_QUIETLY) - MESSAGE (STATUS " ${COMPONENT}") - ENDIF(NOT Boost_FIND_QUIETLY) - SET(Boost_LIBRARIES ${Boost_LIBRARIES} ${Boost_${UPPERCOMPONENT}_LIBRARY}) - ENDIF ( Boost_${UPPERCOMPONENT}_FOUND ) - ENDFOREACH(COMPONENT) - ELSE (Boost_FOUND) - IF (Boost_FIND_REQUIRED) - message(SEND_ERROR "Unable to find the requested Boost libraries.\n${Boost_ERROR_REASON}") - ENDIF(Boost_FIND_REQUIRED) - ENDIF(Boost_FOUND) - - # show the Boost_INCLUDE_DIRS AND Boost_LIBRARIES variables only in the advanced view - MARK_AS_ADVANCED(Boost_INCLUDE_DIR - Boost_INCLUDE_DIRS - Boost_LIBRARY_DIRS - ) -ENDIF(_boost_IN_CACHE) - +# - Try to find Boost include dirs and libraries +# Usage of this module as follows: +# +# NOTE: Take note of the Boost_ADDITIONAL_VERSIONS variable below. +# Due to Boost naming conventions and limitations in CMake this find +# module is NOT future safe with respect to Boost version numbers, +# and may break. +# +# == Using Header-Only libraries from within Boost: == +# +# find_package( Boost 1.36.0 ) +# if(Boost_FOUND) +# include_directories(${Boost_INCLUDE_DIRS}) +# add_executable(foo foo.cc) +# endif() +# +# +# == Using actual libraries from within Boost: == +# +# set(Boost_USE_STATIC_LIBS ON) +# set(Boost_USE_MULTITHREADED ON) +# find_package( Boost 1.36.0 COMPONENTS date_time filesystem system ... ) +# +# if(Boost_FOUND) +# include_directories(${Boost_INCLUDE_DIRS}) +# add_executable(foo foo.cc) +# target_link_libraries(foo ${Boost_LIBRARIES}) +# endif() +# +# +# The components list needs to contain actual names of boost libraries only, +# such as "date_time" for "libboost_date_time". If you're using parts of +# Boost that contain header files only (e.g. foreach) you do not need to +# specify COMPONENTS. +# +# You should provide a minimum version number that should be used. If you provide this +# version number and specify the REQUIRED attribute, this module will fail if it +# can't find the specified or a later version. If you specify a version number this is +# automatically put into the considered list of version numbers and thus doesn't need +# to be specified in the Boost_ADDITIONAL_VERSIONS variable (see below). +# +# NOTE for Visual Studio Users: +# Automatic linking is used on MSVC & Borland compilers by default when +# #including things in Boost. It's important to note that setting +# Boost_USE_STATIC_LIBS to OFF is NOT enough to get you dynamic linking, +# should you need this feature. Automatic linking typically uses static +# libraries with a few exceptions (Boost.Python is one). +# +# Please see the section below near Boost_LIB_DIAGNOSTIC_DEFINITIONS for +# more details. Adding a TARGET_LINK_LIBRARIES() as shown in the example +# above appears to cause VS to link dynamically if Boost_USE_STATIC_LIBS +# gets set to OFF. It is suggested you avoid automatic linking since it +# will make your application less portable. +# +# =========== The mess that is Boost_ADDITIONAL_VERSIONS (sorry?) ============ +# +# OK, so the Boost_ADDITIONAL_VERSIONS variable can be used to specify a list of +# boost version numbers that should be taken into account when searching +# for Boost. Unfortunately boost puts the version number into the +# actual filename for the libraries, so this variable will certainly be needed +# in the future when new Boost versions are released. +# +# Currently this module searches for the following version numbers: +# 1.33, 1.33.0, 1.33.1, 1.34, 1.34.0, 1.34.1, 1.35, 1.35.0, 1.35.1, +# 1.36, 1.36.0, 1.36.1, 1.37, 1.37.0, 1.38, 1.38.0, 1.39, 1.39.0, +# 1.40, 1.40.0, 1.41, 1.41.0 +# +# NOTE: If you add a new major 1.x version in Boost_ADDITIONAL_VERSIONS you should +# add both 1.x and 1.x.0 as shown above. Official Boost include directories +# omit the 3rd version number from include paths if it is 0 although not all +# binary Boost releases do so. +# +# SET(Boost_ADDITIONAL_VERSIONS "1.78" "1.78.0" "1.79" "1.79.0") +# +# ===================================== ============= ======================== +# +# Variables used by this module, they can change the default behaviour and +# need to be set before calling find_package: +# +# Boost_USE_MULTITHREADED Can be set to OFF to use the non-multithreaded +# boost libraries. If not specified, defaults +# to ON. +# +# Boost_USE_STATIC_LIBS Can be set to ON to force the use of the static +# boost libraries. Defaults to OFF. +# +# Other Variables used by this module which you may want to set. +# +# Boost_ADDITIONAL_VERSIONS A list of version numbers to use for searching +# the boost include directory. Please see +# the documentation above regarding this +# annoying, but necessary variable :( +# +# Boost_DEBUG Set this to TRUE to enable debugging output +# of FindBoost.cmake if you are having problems. +# Please enable this before filing any bug +# reports. +# +# Boost_DETAILED_FAILURE_MSG FindBoost doesn't output detailed information +# about why it failed or how to fix the problem +# unless this is set to TRUE or the REQUIRED +# keyword is specified in find_package(). +# [Since CMake 2.8.0] +# +# Boost_COMPILER Set this to the compiler suffix used by Boost +# (e.g. "-gcc43") if FindBoost has problems finding +# the proper Boost installation +# +# These last three variables are available also as environment variables: +# +# BOOST_ROOT or BOOSTROOT The preferred installation prefix for searching for +# Boost. Set this if the module has problems finding +# the proper Boost installation. +# +# BOOST_INCLUDEDIR Set this to the include directory of Boost, if the +# module has problems finding the proper Boost installation +# +# BOOST_LIBRARYDIR Set this to the lib directory of Boost, if the +# module has problems finding the proper Boost installation +# +# Variables defined by this module: +# +# Boost_FOUND System has Boost, this means the include dir was +# found, as well as all the libraries specified in +# the COMPONENTS list. +# +# Boost_INCLUDE_DIRS Boost include directories: not cached +# +# Boost_INCLUDE_DIR This is almost the same as above, but this one is +# cached and may be modified by advanced users +# +# Boost_LIBRARIES Link to these to use the Boost libraries that you +# specified: not cached +# +# Boost_LIBRARY_DIRS The path to where the Boost library files are. +# +# Boost_VERSION The version number of the boost libraries that +# have been found, same as in version.hpp from Boost +# +# Boost_LIB_VERSION The version number in filename form as +# it's appended to the library filenames +# +# Boost_MAJOR_VERSION major version number of boost +# Boost_MINOR_VERSION minor version number of boost +# Boost_SUBMINOR_VERSION subminor version number of boost +# +# Boost_LIB_DIAGNOSTIC_DEFINITIONS [WIN32 Only] You can call +# add_definitions(${Boost_LIB_DIAGNOSTIC_DEFINITIONS}) +# to have diagnostic information about Boost's +# automatic linking outputted during compilation time. +# +# For each component you specify in find_package(), the following (UPPER-CASE) +# variables are set. You can use these variables if you would like to pick and +# choose components for your targets instead of just using Boost_LIBRARIES. +# +# Boost_${COMPONENT}_FOUND True IF the Boost library "component" was found. +# +# Boost_${COMPONENT}_LIBRARY Contains the libraries for the specified Boost +# "component" (includes debug and optimized keywords +# when needed). + +#============================================================================= +# Copyright 2006-2009 Kitware, Inc. +# Copyright 2006-2008 Andreas Schneider +# Copyright 2007 Wengo +# Copyright 2007 Mike Jackson +# Copyright 2008 Andreas Pakulat +# Copyright 2008-2009 Philip Lowman +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distributed this file outside of CMake, substitute the full +# License text for the above reference.) + +#------------------------------------------------------------------------------- +# FindBoost functions & macros +# +############################################ +# +# Check the existence of the libraries. +# +############################################ +# This macro was taken directly from the FindQt4.cmake file that is included +# with the CMake distribution. This is NOT my work. All work was done by the +# original authors of the FindQt4.cmake file. Only minor modifications were +# made to remove references to Qt and make this file more generally applicable +# And ELSE/ENDIF pairs were removed for readability. +######################################################################### + +MACRO (_Boost_ADJUST_LIB_VARS basename) + IF (Boost_INCLUDE_DIR ) + IF (Boost_${basename}_LIBRARY_DEBUG AND Boost_${basename}_LIBRARY_RELEASE) + # if the generator supports configuration types then set + # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value + IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + SET(Boost_${basename}_LIBRARY optimized ${Boost_${basename}_LIBRARY_RELEASE} debug ${Boost_${basename}_LIBRARY_DEBUG}) + ELSE() + # if there are no configuration types and CMAKE_BUILD_TYPE has no value + # then just use the release libraries + SET(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE} ) + ENDIF() + # FIXME: This probably should be set for both cases + SET(Boost_${basename}_LIBRARIES optimized ${Boost_${basename}_LIBRARY_RELEASE} debug ${Boost_${basename}_LIBRARY_DEBUG}) + ENDIF() + + # if only the release version was found, set the debug variable also to the release version + IF (Boost_${basename}_LIBRARY_RELEASE AND NOT Boost_${basename}_LIBRARY_DEBUG) + SET(Boost_${basename}_LIBRARY_DEBUG ${Boost_${basename}_LIBRARY_RELEASE}) + SET(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE}) + SET(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_RELEASE}) + ENDIF() + + # if only the debug version was found, set the release variable also to the debug version + IF (Boost_${basename}_LIBRARY_DEBUG AND NOT Boost_${basename}_LIBRARY_RELEASE) + SET(Boost_${basename}_LIBRARY_RELEASE ${Boost_${basename}_LIBRARY_DEBUG}) + SET(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_DEBUG}) + SET(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_DEBUG}) + ENDIF() + + IF (Boost_${basename}_LIBRARY) + set(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY} CACHE FILEPATH "The Boost ${basename} library") + + # Remove superfluous "debug" / "optimized" keywords from + # Boost_LIBRARY_DIRS + FOREACH(_boost_my_lib ${Boost_${basename}_LIBRARY}) + GET_FILENAME_COMPONENT(_boost_my_lib_path "${_boost_my_lib}" PATH) + LIST(APPEND Boost_LIBRARY_DIRS ${_boost_my_lib_path}) + ENDFOREACH() + LIST(REMOVE_DUPLICATES Boost_LIBRARY_DIRS) + + set(Boost_LIBRARY_DIRS ${Boost_LIBRARY_DIRS} CACHE FILEPATH "Boost library directory") + SET(Boost_${basename}_FOUND ON CACHE INTERNAL "Whether the Boost ${basename} library found") + ENDIF(Boost_${basename}_LIBRARY) + + ENDIF (Boost_INCLUDE_DIR ) + # Make variables changeble to the advanced user + MARK_AS_ADVANCED( + Boost_${basename}_LIBRARY + Boost_${basename}_LIBRARY_RELEASE + Boost_${basename}_LIBRARY_DEBUG + ) +ENDMACRO (_Boost_ADJUST_LIB_VARS) + +#------------------------------------------------------------------------------- + +# +# Runs compiler with "-dumpversion" and parses major/minor +# version with a regex. +# +FUNCTION(_Boost_COMPILER_DUMPVERSION _OUTPUT_VERSION) + + EXEC_PROGRAM(${CMAKE_CXX_COMPILER} + ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion + OUTPUT_VARIABLE _boost_COMPILER_VERSION + ) + STRING(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2" + _boost_COMPILER_VERSION ${_boost_COMPILER_VERSION}) + + SET(${_OUTPUT_VERSION} ${_boost_COMPILER_VERSION} PARENT_SCOPE) +ENDFUNCTION() + +# +# A convenience function for marking desired components +# as found or not +# +function(_Boost_MARK_COMPONENTS_FOUND _yes_or_no) + foreach(COMPONENT ${Boost_FIND_COMPONENTS}) + string(TOUPPER ${COMPONENT} UPPERCOMPONENT) + set(Boost_${UPPERCOMPONENT}_FOUND ${_yes_or_no} CACHE INTERNAL "Whether the Boost ${COMPONENT} library found" FORCE) + endforeach() +endfunction() + +# +# End functions/macros +# +#------------------------------------------------------------------------------- + + + + +IF(NOT DEFINED Boost_USE_MULTITHREADED) + SET(Boost_USE_MULTITHREADED TRUE) +ENDIF() + +if(Boost_FIND_VERSION_EXACT) + # The version may appear in a directory with or without the patch + # level, even when the patch level is non-zero. + set(_boost_TEST_VERSIONS + "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}.${Boost_FIND_VERSION_PATCH}" + "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}") +else(Boost_FIND_VERSION_EXACT) + # The user has not requested an exact version. Among known + # versions, find those that are acceptable to the user request. + set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS} + "1.41.0" "1.41" "1.40.0" "1.40" "1.39.0" "1.39" "1.38.0" "1.38" "1.37.0" "1.37" + "1.36.1" "1.36.0" "1.36" "1.35.1" "1.35.0" "1.35" "1.34.1" "1.34.0" + "1.34" "1.33.1" "1.33.0" "1.33") + set(_boost_TEST_VERSIONS) + if(Boost_FIND_VERSION) + set(_Boost_FIND_VERSION_SHORT "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}") + # Select acceptable versions. + foreach(version ${_Boost_KNOWN_VERSIONS}) + if(NOT "${version}" VERSION_LESS "${Boost_FIND_VERSION}") + # This version is high enough. + list(APPEND _boost_TEST_VERSIONS "${version}") + elseif("${version}.99" VERSION_EQUAL "${_Boost_FIND_VERSION_SHORT}.99") + # This version is a short-form for the requested version with + # the patch level dropped. + list(APPEND _boost_TEST_VERSIONS "${version}") + endif() + endforeach(version) + else(Boost_FIND_VERSION) + # Any version is acceptable. + set(_boost_TEST_VERSIONS "${_Boost_KNOWN_VERSIONS}") + endif(Boost_FIND_VERSION) +endif(Boost_FIND_VERSION_EXACT) + +# The reason that we failed to find Boost. This will be set to a +# user-friendly message when we fail to find some necessary piece of +# Boost. +set(Boost_ERROR_REASON) + +SET( _boost_IN_CACHE TRUE) +IF(Boost_INCLUDE_DIR) + + # On versions < 1.35, remove the System library from the considered list + # since it wasn't added until 1.35. + if(Boost_VERSION AND Boost_FIND_COMPONENTS) + math(EXPR _boost_maj "${Boost_VERSION} / 100000") + math(EXPR _boost_min "${Boost_VERSION} / 100 % 1000") + if(${_boost_maj}.${_boost_min} VERSION_LESS 1.35) + list(REMOVE_ITEM Boost_FIND_COMPONENTS system) + endif() + endif() + + FOREACH(COMPONENT ${Boost_FIND_COMPONENTS}) + STRING(TOUPPER ${COMPONENT} COMPONENT) + IF(NOT Boost_${COMPONENT}_FOUND) + SET( _boost_IN_CACHE FALSE) + ENDIF(NOT Boost_${COMPONENT}_FOUND) + ENDFOREACH(COMPONENT) +ELSE(Boost_INCLUDE_DIR) + SET( _boost_IN_CACHE FALSE) +ENDIF(Boost_INCLUDE_DIR) + +IF (_boost_IN_CACHE) + # in cache already + SET(Boost_FOUND TRUE) + FOREACH(COMPONENT ${Boost_FIND_COMPONENTS}) + STRING(TOUPPER ${COMPONENT} COMPONENT) + _Boost_ADJUST_LIB_VARS( ${COMPONENT} ) + SET(Boost_LIBRARIES ${Boost_LIBRARIES} ${Boost_${COMPONENT}_LIBRARY}) + ENDFOREACH(COMPONENT) + SET(Boost_INCLUDE_DIRS ${Boost_INCLUDE_DIR}) + IF(Boost_VERSION AND NOT "${Boost_VERSION}" STREQUAL "0") + MATH(EXPR Boost_MAJOR_VERSION "${Boost_VERSION} / 100000") + MATH(EXPR Boost_MINOR_VERSION "${Boost_VERSION} / 100 % 1000") + MATH(EXPR Boost_SUBMINOR_VERSION "${Boost_VERSION} % 100") + ENDIF(Boost_VERSION AND NOT "${Boost_VERSION}" STREQUAL "0") + if(Boost_DEBUG) + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "boost ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION} " + "is already in the cache. For debugging messages, please clear the cache.") + endif() +ELSE (_boost_IN_CACHE) + # Need to search for boost + if(Boost_DEBUG) + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "Boost not in cache") + # Output some of their choices + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "_boost_TEST_VERSIONS = ${_boost_TEST_VERSIONS}") + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "Boost_USE_MULTITHREADED = ${Boost_USE_MULTITHREADED}") + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "Boost_USE_STATIC_LIBS = ${Boost_USE_STATIC_LIBS}") + endif() + + IF(WIN32) + # In windows, automatic linking is performed, so you do not have + # to specify the libraries. If you are linking to a dynamic + # runtime, then you can choose to link to either a static or a + # dynamic Boost library, the default is to do a static link. You + # can alter this for a specific library "whatever" by defining + # BOOST_WHATEVER_DYN_LINK to force Boost library "whatever" to be + # linked dynamically. Alternatively you can force all Boost + # libraries to dynamic link by defining BOOST_ALL_DYN_LINK. + + # This feature can be disabled for Boost library "whatever" by + # defining BOOST_WHATEVER_NO_LIB, or for all of Boost by defining + # BOOST_ALL_NO_LIB. + + # If you want to observe which libraries are being linked against + # then defining BOOST_LIB_DIAGNOSTIC will cause the auto-linking + # code to emit a #pragma message each time a library is selected + # for linking. + SET(Boost_LIB_DIAGNOSTIC_DEFINITIONS + "-DBOOST_LIB_DIAGNOSTIC" CACHE STRING "Boost diagnostic define") + ENDIF(WIN32) + + SET(_boost_INCLUDE_SEARCH_DIRS + C:/boost/include + C:/boost + C:/library/boost + "C:/Program Files/boost" + "C:/Program Files (x86)/boost" + "$ENV{ProgramFiles}/boost/include" + "$ENV{ProgramFiles}/boost" + /sw/local/include + ) + + # If BOOST_ROOT was defined in the environment, use it. + if (NOT BOOST_ROOT AND NOT $ENV{BOOST_ROOT} STREQUAL "") + set(BOOST_ROOT $ENV{BOOST_ROOT}) + endif(NOT BOOST_ROOT AND NOT $ENV{BOOST_ROOT} STREQUAL "") + + # If BOOSTROOT was defined in the environment, use it. + if (NOT BOOST_ROOT AND NOT $ENV{BOOSTROOT} STREQUAL "") + set(BOOST_ROOT $ENV{BOOSTROOT}) + endif(NOT BOOST_ROOT AND NOT $ENV{BOOSTROOT} STREQUAL "") + + # If BOOST_INCLUDEDIR was defined in the environment, use it. + IF( NOT $ENV{BOOST_INCLUDEDIR} STREQUAL "" ) + set(BOOST_INCLUDEDIR $ENV{BOOST_INCLUDEDIR}) + ENDIF( NOT $ENV{BOOST_INCLUDEDIR} STREQUAL "" ) + + # If BOOST_LIBRARYDIR was defined in the environment, use it. + IF( NOT $ENV{BOOST_LIBRARYDIR} STREQUAL "" ) + set(BOOST_LIBRARYDIR $ENV{BOOST_LIBRARYDIR}) + ENDIF( NOT $ENV{BOOST_LIBRARYDIR} STREQUAL "" ) + + IF( BOOST_ROOT ) + file(TO_CMAKE_PATH ${BOOST_ROOT} BOOST_ROOT) + ENDIF( BOOST_ROOT ) + + if(Boost_DEBUG) + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "Declared as CMake or Environmental Variables:") + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + " BOOST_ROOT = ${BOOST_ROOT}") + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + " BOOST_INCLUDEDIR = ${BOOST_INCLUDEDIR}") + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + " BOOST_LIBRARYDIR = ${BOOST_LIBRARYDIR}") + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "_boost_TEST_VERSIONS = ${_boost_TEST_VERSIONS}") + endif() + + IF( BOOST_ROOT ) + SET(_boost_INCLUDE_SEARCH_DIRS + ${BOOST_ROOT}/include + ${BOOST_ROOT} + ${_boost_INCLUDE_SEARCH_DIRS}) + ENDIF( BOOST_ROOT ) + + IF( BOOST_INCLUDEDIR ) + file(TO_CMAKE_PATH ${BOOST_INCLUDEDIR} BOOST_INCLUDEDIR) + SET(_boost_INCLUDE_SEARCH_DIRS + ${BOOST_INCLUDEDIR} ${_boost_INCLUDE_SEARCH_DIRS}) + ENDIF( BOOST_INCLUDEDIR ) + + # ------------------------------------------------------------------------ + # Search for Boost include DIR + # ------------------------------------------------------------------------ + # Try to find Boost by stepping backwards through the Boost versions + # we know about. + IF( NOT Boost_INCLUDE_DIR ) + # Build a list of path suffixes for each version. + SET(_boost_PATH_SUFFIXES) + FOREACH(_boost_VER ${_boost_TEST_VERSIONS}) + # Add in a path suffix, based on the required version, ideally + # we could read this from version.hpp, but for that to work we'd + # need to know the include dir already + set(_boost_BOOSTIFIED_VERSION) + + # Transform 1.35 => 1_35 and 1.36.0 => 1_36_0 + IF(_boost_VER MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+") + STRING(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\1_\\2_\\3" + _boost_BOOSTIFIED_VERSION ${_boost_VER}) + ELSEIF(_boost_VER MATCHES "[0-9]+\\.[0-9]+") + STRING(REGEX REPLACE "([0-9]+)\\.([0-9]+)" "\\1_\\2" + _boost_BOOSTIFIED_VERSION ${_boost_VER}) + ENDIF() + + list(APPEND _boost_PATH_SUFFIXES "boost-${_boost_BOOSTIFIED_VERSION}") + if(WIN32) + # For BoostPro's underscores (and others?) + list(APPEND _boost_PATH_SUFFIXES "boost_${_boost_BOOSTIFIED_VERSION}") + endif() + + ENDFOREACH(_boost_VER) + + if(Boost_DEBUG) + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "Include debugging info:") + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + " _boost_INCLUDE_SEARCH_DIRS = ${_boost_INCLUDE_SEARCH_DIRS}") + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + " _boost_PATH_SUFFIXES = ${_boost_PATH_SUFFIXES}") + endif() + + # Look for a standard boost header file. + FIND_PATH(Boost_INCLUDE_DIR + NAMES boost/config.hpp + HINTS ${_boost_INCLUDE_SEARCH_DIRS} + PATH_SUFFIXES ${_boost_PATH_SUFFIXES} + ) + ENDIF( NOT Boost_INCLUDE_DIR ) + + # ------------------------------------------------------------------------ + # Extract version information from version.hpp + # ------------------------------------------------------------------------ + + IF(Boost_INCLUDE_DIR) + # Extract Boost_VERSION and Boost_LIB_VERSION from version.hpp + # Read the whole file: + # + SET(BOOST_VERSION 0) + SET(BOOST_LIB_VERSION "") + FILE(READ "${Boost_INCLUDE_DIR}/boost/version.hpp" _boost_VERSION_HPP_CONTENTS) + if(Boost_DEBUG) + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "location of version.hpp: ${Boost_INCLUDE_DIR}/boost/version.hpp") + endif() + + STRING(REGEX REPLACE ".*#define BOOST_VERSION ([0-9]+).*" "\\1" Boost_VERSION "${_boost_VERSION_HPP_CONTENTS}") + STRING(REGEX REPLACE ".*#define BOOST_LIB_VERSION \"([0-9_]+)\".*" "\\1" Boost_LIB_VERSION "${_boost_VERSION_HPP_CONTENTS}") + + SET(Boost_LIB_VERSION ${Boost_LIB_VERSION} CACHE INTERNAL "The library version string for boost libraries") + SET(Boost_VERSION ${Boost_VERSION} CACHE INTERNAL "The version number for boost libraries") + + IF(NOT "${Boost_VERSION}" STREQUAL "0") + MATH(EXPR Boost_MAJOR_VERSION "${Boost_VERSION} / 100000") + MATH(EXPR Boost_MINOR_VERSION "${Boost_VERSION} / 100 % 1000") + MATH(EXPR Boost_SUBMINOR_VERSION "${Boost_VERSION} % 100") + + set(Boost_ERROR_REASON + "${Boost_ERROR_REASON}Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}\nBoost include path: ${Boost_INCLUDE_DIR}") + ENDIF(NOT "${Boost_VERSION}" STREQUAL "0") + if(Boost_DEBUG) + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "version.hpp reveals boost " + "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}") + endif() + ELSE(Boost_INCLUDE_DIR) + set(Boost_ERROR_REASON + "${Boost_ERROR_REASON}Unable to find the Boost header files. Please set BOOST_ROOT to the root directory containing Boost or BOOST_INCLUDEDIR to the directory containing Boost's headers.") + ENDIF(Boost_INCLUDE_DIR) + + # ------------------------------------------------------------------------ + # Suffix initialization and compiler suffix detection. + # ------------------------------------------------------------------------ + + # Setting some more suffixes for the library + SET (Boost_LIB_PREFIX "") + if ( WIN32 AND Boost_USE_STATIC_LIBS ) + SET (Boost_LIB_PREFIX "lib") + endif() + + if (Boost_COMPILER) + set(_boost_COMPILER ${Boost_COMPILER}) + if(Boost_DEBUG) + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "using user-specified Boost_COMPILER = ${_boost_COMPILER}") + endif() + else(Boost_COMPILER) + # Attempt to guess the compiler suffix + # NOTE: this is not perfect yet, if you experience any issues + # please report them and use the Boost_COMPILER variable + # to work around the problems. + if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel" + OR "${CMAKE_CXX_COMPILER}" MATCHES "icl" + OR "${CMAKE_CXX_COMPILER}" MATCHES "icpc") + if(WIN32) + set (_boost_COMPILER "-iw") + else() + set (_boost_COMPILER "-il") + endif() + elseif (MSVC90) + SET (_boost_COMPILER "-vc90") + elseif (MSVC10) + SET (_boost_COMPILER "-vc100") + elseif (MSVC80) + SET (_boost_COMPILER "-vc80") + elseif (MSVC71) + SET (_boost_COMPILER "-vc71") + elseif (MSVC70) # Good luck! + SET (_boost_COMPILER "-vc7") # yes, this is correct + elseif (MSVC60) # Good luck! + SET (_boost_COMPILER "-vc6") # yes, this is correct + elseif (BORLAND) + SET (_boost_COMPILER "-bcb") + elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "SunPro") + set(_boost_COMPILER "-sw") + elseif (MINGW) + if(${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION} VERSION_LESS 1.34) + SET(_boost_COMPILER "-mgw") # no GCC version encoding prior to 1.34 + else() + _Boost_COMPILER_DUMPVERSION(_boost_COMPILER_VERSION) + SET (_boost_COMPILER "-mgw${_boost_COMPILER_VERSION}") + endif() + elseif (UNIX) + if (CMAKE_COMPILER_IS_GNUCXX) + if(${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION} VERSION_LESS 1.34) + SET(_boost_COMPILER "-gcc") # no GCC version encoding prior to 1.34 + else() + _Boost_COMPILER_DUMPVERSION(_boost_COMPILER_VERSION) + # Determine which version of GCC we have. + IF(APPLE) + IF(Boost_MINOR_VERSION) + IF(${Boost_MINOR_VERSION} GREATER 35) + # In Boost 1.36.0 and newer, the mangled compiler name used + # on Mac OS X/Darwin is "xgcc". + SET(_boost_COMPILER "-xgcc${_boost_COMPILER_VERSION}") + ELSE(${Boost_MINOR_VERSION} GREATER 35) + # In Boost <= 1.35.0, there is no mangled compiler name for + # the Mac OS X/Darwin version of GCC. + SET(_boost_COMPILER "") + ENDIF(${Boost_MINOR_VERSION} GREATER 35) + ELSE(Boost_MINOR_VERSION) + # We don't know the Boost version, so assume it's + # pre-1.36.0. + SET(_boost_COMPILER "") + ENDIF(Boost_MINOR_VERSION) + ELSE() + SET (_boost_COMPILER "-gcc${_boost_COMPILER_VERSION}") + ENDIF() + endif() + endif (CMAKE_COMPILER_IS_GNUCXX) + endif() + if(Boost_DEBUG) + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "guessed _boost_COMPILER = ${_boost_COMPILER}") + endif() + endif(Boost_COMPILER) + + SET (_boost_MULTITHREADED "-mt") + if( NOT Boost_USE_MULTITHREADED ) + set (_boost_MULTITHREADED "") + endif() + if(Boost_DEBUG) + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "_boost_MULTITHREADED = ${_boost_MULTITHREADED}") + endif() + + SET( _boost_STATIC_TAG "") + set( _boost_ABI_TAG "") + IF (WIN32) + IF(MSVC OR "${CMAKE_CXX_COMPILER}" MATCHES "icl" + OR "${CMAKE_CXX_COMPILER}" MATCHES "icpc") + SET (_boost_ABI_TAG "g") + ENDIF() + IF( Boost_USE_STATIC_LIBS ) + SET( _boost_STATIC_TAG "-s") + ENDIF( Boost_USE_STATIC_LIBS ) + ENDIF(WIN32) + SET (_boost_ABI_TAG "${_boost_ABI_TAG}d") + if(Boost_DEBUG) + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "_boost_STATIC_TAG = ${_boost_STATIC_TAG}") + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "_boost_ABI_TAG = ${_boost_ABI_TAG}") + endif() + + # ------------------------------------------------------------------------ + # Begin finding boost libraries + # ------------------------------------------------------------------------ + + SET(_boost_LIBRARIES_SEARCH_DIRS + ${Boost_INCLUDE_DIR}/lib + ${Boost_INCLUDE_DIR}/../lib + C:/boost/lib + C:/boost + "$ENV{ProgramFiles}/boost/boost_${Boost_MAJOR_VERSION}_${Boost_MINOR_VERSION}_${Boost_SUBMINOR_VERSION}/lib" + "$ENV{ProgramFiles}/boost/boost_${Boost_MAJOR_VERSION}_${Boost_MINOR_VERSION}/lib" + "$ENV{ProgramFiles}/boost/lib" + C:/library/boost/stage/lib + "C:/Program Files/boost/stage/lib" + "C:/Program Files (x86)/boost/stage/lib" + "$ENV{ProgramFiles}/boost" + /sw/local/lib + ) + IF( BOOST_ROOT ) + SET(_boost_LIBRARIES_SEARCH_DIRS + ${BOOST_ROOT}/lib + ${BOOST_ROOT}/stage/lib + ${_boost_LIBRARIES_SEARCH_DIRS}) + ENDIF( BOOST_ROOT ) + + IF( BOOST_LIBRARYDIR ) + file(TO_CMAKE_PATH ${BOOST_LIBRARYDIR} BOOST_LIBRARYDIR) + SET(_boost_LIBRARIES_SEARCH_DIRS + ${BOOST_LIBRARYDIR} ${_boost_LIBRARIES_SEARCH_DIRS}) + ENDIF( BOOST_LIBRARYDIR ) + + if(Boost_DEBUG) + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "_boost_LIBRARIES_SEARCH_DIRS = ${_boost_LIBRARIES_SEARCH_DIRS}") + endif() + + FOREACH(COMPONENT ${Boost_FIND_COMPONENTS}) + STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT) + SET( Boost_${UPPERCOMPONENT}_LIBRARY "Boost_${UPPERCOMPONENT}_LIBRARY-NOTFOUND" ) + SET( Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE "Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE-NOTFOUND" ) + SET( Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG "Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG-NOTFOUND") + + # Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES + IF( Boost_USE_STATIC_LIBS ) + SET( _boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) + IF(WIN32) + SET(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) + ELSE(WIN32) + SET(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) + ENDIF(WIN32) + ENDIF( Boost_USE_STATIC_LIBS ) + + FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE + NAMES ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}-${Boost_LIB_VERSION} + ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_STATIC_TAG}-${Boost_LIB_VERSION} + ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}-${Boost_LIB_VERSION} + ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}-${Boost_LIB_VERSION} + ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED} + ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG} + ${Boost_LIB_PREFIX}boost_${COMPONENT} + HINTS ${_boost_LIBRARIES_SEARCH_DIRS} + ) + + FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG + NAMES ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}-${_boost_ABI_TAG}-${Boost_LIB_VERSION} + ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_STATIC_TAG}${_boost_ABI_TAG}-${Boost_LIB_VERSION} + ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}-${_boost_ABI_TAG}-${Boost_LIB_VERSION} + ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}${_boost_ABI_TAG}-${Boost_LIB_VERSION} + ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}-${_boost_ABI_TAG} + ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}${_boost_ABI_TAG} + ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_boost_ABI_TAG} + HINTS ${_boost_LIBRARIES_SEARCH_DIRS} + ) + + _Boost_ADJUST_LIB_VARS(${UPPERCOMPONENT}) + IF( Boost_USE_STATIC_LIBS ) + SET(CMAKE_FIND_LIBRARY_SUFFIXES ${_boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) + ENDIF( Boost_USE_STATIC_LIBS ) + ENDFOREACH(COMPONENT) + # ------------------------------------------------------------------------ + # End finding boost libraries + # ------------------------------------------------------------------------ + + SET(Boost_INCLUDE_DIRS + ${Boost_INCLUDE_DIR} + ) + + SET(Boost_FOUND FALSE) + IF(Boost_INCLUDE_DIR) + SET( Boost_FOUND TRUE ) + + # Check the version of Boost against the requested version. + if (Boost_FIND_VERSION AND NOT Boost_FIND_VERSION_MINOR) + message(SEND_ERROR "When requesting a specific version of Boost, you must provide at least the major and minor version numbers, e.g., 1.34") + endif (Boost_FIND_VERSION AND NOT Boost_FIND_VERSION_MINOR) + if(Boost_MAJOR_VERSION LESS "${Boost_FIND_VERSION_MAJOR}" ) + set( Boost_FOUND FALSE ) + set(_Boost_VERSION_AGE "old") + elseif(Boost_MAJOR_VERSION EQUAL "${Boost_FIND_VERSION_MAJOR}" ) + if(Boost_MINOR_VERSION LESS "${Boost_FIND_VERSION_MINOR}" ) + set( Boost_FOUND FALSE ) + set(_Boost_VERSION_AGE "old") + elseif(Boost_MINOR_VERSION EQUAL "${Boost_FIND_VERSION_MINOR}" ) + if( Boost_FIND_VERSION_PATCH AND Boost_SUBMINOR_VERSION LESS "${Boost_FIND_VERSION_PATCH}" ) + set( Boost_FOUND FALSE ) + set(_Boost_VERSION_AGE "old") + endif( Boost_FIND_VERSION_PATCH AND Boost_SUBMINOR_VERSION LESS "${Boost_FIND_VERSION_PATCH}" ) + endif( Boost_MINOR_VERSION LESS "${Boost_FIND_VERSION_MINOR}" ) + endif( Boost_MAJOR_VERSION LESS "${Boost_FIND_VERSION_MAJOR}" ) + + if (NOT Boost_FOUND) + _Boost_MARK_COMPONENTS_FOUND(OFF) + endif() + + if (Boost_FOUND AND Boost_FIND_VERSION_EXACT) + # If the user requested an exact version of Boost, check + # that. We already know that the Boost version we have is >= the + # requested version. + set(_Boost_VERSION_AGE "new") + + # If the user didn't specify a patchlevel, it's 0. + if (NOT Boost_FIND_VERSION_PATCH) + set(Boost_FIND_VERSION_PATCH 0) + endif (NOT Boost_FIND_VERSION_PATCH) + + # We'll set Boost_FOUND true again if we have an exact version match. + set(Boost_FOUND FALSE) + _Boost_MARK_COMPONENTS_FOUND(OFF) + if(Boost_MAJOR_VERSION EQUAL "${Boost_FIND_VERSION_MAJOR}" ) + if(Boost_MINOR_VERSION EQUAL "${Boost_FIND_VERSION_MINOR}" ) + if(Boost_SUBMINOR_VERSION EQUAL "${Boost_FIND_VERSION_PATCH}" ) + set( Boost_FOUND TRUE ) + _Boost_MARK_COMPONENTS_FOUND(ON) + endif(Boost_SUBMINOR_VERSION EQUAL "${Boost_FIND_VERSION_PATCH}" ) + endif( Boost_MINOR_VERSION EQUAL "${Boost_FIND_VERSION_MINOR}" ) + endif( Boost_MAJOR_VERSION EQUAL "${Boost_FIND_VERSION_MAJOR}" ) + endif (Boost_FOUND AND Boost_FIND_VERSION_EXACT) + + if(NOT Boost_FOUND) + # State that we found a version of Boost that is too new or too old. + set(Boost_ERROR_REASON + "${Boost_ERROR_REASON}\nDetected version of Boost is too ${_Boost_VERSION_AGE}. Requested version was ${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}") + if (Boost_FIND_VERSION_PATCH) + set(Boost_ERROR_REASON + "${Boost_ERROR_REASON}.${Boost_FIND_VERSION_PATCH}") + endif (Boost_FIND_VERSION_PATCH) + if (NOT Boost_FIND_VERSION_EXACT) + set(Boost_ERROR_REASON "${Boost_ERROR_REASON} (or newer)") + endif (NOT Boost_FIND_VERSION_EXACT) + set(Boost_ERROR_REASON "${Boost_ERROR_REASON}.") + endif (NOT Boost_FOUND) + + # Always check for missing components + set(_boost_CHECKED_COMPONENT FALSE) + set(_Boost_MISSING_COMPONENTS "") + foreach(COMPONENT ${Boost_FIND_COMPONENTS}) + string(TOUPPER ${COMPONENT} COMPONENT) + set(_boost_CHECKED_COMPONENT TRUE) + if(NOT Boost_${COMPONENT}_FOUND) + string(TOLOWER ${COMPONENT} COMPONENT) + list(APPEND _Boost_MISSING_COMPONENTS ${COMPONENT}) + set( Boost_FOUND FALSE) + endif(NOT Boost_${COMPONENT}_FOUND) + endforeach(COMPONENT) + + if(Boost_DEBUG) + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] Boost_FOUND = ${Boost_FOUND}") + endif() + + if (_Boost_MISSING_COMPONENTS) + # We were unable to find some libraries, so generate a sensible + # error message that lists the libraries we were unable to find. + set(Boost_ERROR_REASON + "${Boost_ERROR_REASON}\nThe following Boost libraries could not be found:\n") + foreach(COMPONENT ${_Boost_MISSING_COMPONENTS}) + set(Boost_ERROR_REASON + "${Boost_ERROR_REASON} boost_${COMPONENT}\n") + endforeach(COMPONENT) + + list(LENGTH Boost_FIND_COMPONENTS Boost_NUM_COMPONENTS_WANTED) + list(LENGTH _Boost_MISSING_COMPONENTS Boost_NUM_MISSING_COMPONENTS) + if (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS}) + set(Boost_ERROR_REASON + "${Boost_ERROR_REASON}No Boost libraries were found. You may need to set Boost_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.") + else (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS}) + set(Boost_ERROR_REASON + "${Boost_ERROR_REASON}Some (but not all) of the required Boost libraries were found. You may need to install these additional Boost libraries. Alternatively, set Boost_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.") + endif (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS}) + endif (_Boost_MISSING_COMPONENTS) + + IF( NOT Boost_LIBRARY_DIRS AND NOT _boost_CHECKED_COMPONENT ) + # Compatibility Code for backwards compatibility with CMake + # 2.4's FindBoost module. + + # Look for the boost library path. + # Note that the user may not have installed any libraries + # so it is quite possible the Boost_LIBRARY_PATH may not exist. + SET(_boost_LIB_DIR ${Boost_INCLUDE_DIR}) + + IF("${_boost_LIB_DIR}" MATCHES "boost-[0-9]+") + GET_FILENAME_COMPONENT(_boost_LIB_DIR ${_boost_LIB_DIR} PATH) + ENDIF ("${_boost_LIB_DIR}" MATCHES "boost-[0-9]+") + + IF("${_boost_LIB_DIR}" MATCHES "/include$") + # Strip off the trailing "/include" in the path. + GET_FILENAME_COMPONENT(_boost_LIB_DIR ${_boost_LIB_DIR} PATH) + ENDIF("${_boost_LIB_DIR}" MATCHES "/include$") + + IF(EXISTS "${_boost_LIB_DIR}/lib") + SET (_boost_LIB_DIR ${_boost_LIB_DIR}/lib) + ELSE(EXISTS "${_boost_LIB_DIR}/lib") + IF(EXISTS "${_boost_LIB_DIR}/stage/lib") + SET(_boost_LIB_DIR ${_boost_LIB_DIR}/stage/lib) + ELSE(EXISTS "${_boost_LIB_DIR}/stage/lib") + SET(_boost_LIB_DIR "") + ENDIF(EXISTS "${_boost_LIB_DIR}/stage/lib") + ENDIF(EXISTS "${_boost_LIB_DIR}/lib") + + IF(_boost_LIB_DIR AND EXISTS "${_boost_LIB_DIR}") + SET(Boost_LIBRARY_DIRS ${_boost_LIB_DIR} CACHE FILEPATH "Boost library directory") + ENDIF(_boost_LIB_DIR AND EXISTS "${_boost_LIB_DIR}") + + ENDIF( NOT Boost_LIBRARY_DIRS AND NOT _boost_CHECKED_COMPONENT ) + + ELSE(Boost_INCLUDE_DIR) + SET( Boost_FOUND FALSE) + ENDIF(Boost_INCLUDE_DIR) + + IF (Boost_FOUND) + IF (NOT Boost_FIND_QUIETLY) + MESSAGE(STATUS "Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}") + if(Boost_FIND_COMPONENTS) + message(STATUS "Found the following Boost libraries:") + endif() + ENDIF(NOT Boost_FIND_QUIETLY) + FOREACH ( COMPONENT ${Boost_FIND_COMPONENTS} ) + STRING( TOUPPER ${COMPONENT} UPPERCOMPONENT ) + IF ( Boost_${UPPERCOMPONENT}_FOUND ) + IF (NOT Boost_FIND_QUIETLY) + MESSAGE (STATUS " ${COMPONENT}") + ENDIF(NOT Boost_FIND_QUIETLY) + SET(Boost_LIBRARIES ${Boost_LIBRARIES} ${Boost_${UPPERCOMPONENT}_LIBRARY}) + ENDIF ( Boost_${UPPERCOMPONENT}_FOUND ) + ENDFOREACH(COMPONENT) + else() + if(Boost_FIND_REQUIRED) + message(SEND_ERROR "Unable to find the requested Boost libraries.\n${Boost_ERROR_REASON}") + else() + if(NOT Boost_FIND_QUIETLY) + # we opt not to automatically output Boost_ERROR_REASON here as + # it could be quite lengthy and somewhat imposing in it's requests + # Since Boost is not always a required dependency we'll leave this + # up to the end-user. + if(Boost_DEBUG OR Boost_DETAILED_FAILURE_MSG) + message(STATUS "Could NOT find Boost\n${Boost_ERROR_REASON}") + else() + message(STATUS "Could NOT find Boost") + endif() + endif() + endif(Boost_FIND_REQUIRED) + endif() + + # show the Boost_INCLUDE_DIRS AND Boost_LIBRARIES variables only in the advanced view + MARK_AS_ADVANCED(Boost_INCLUDE_DIR + Boost_INCLUDE_DIRS + Boost_LIBRARY_DIRS + ) +ENDIF(_boost_IN_CACHE) + diff -Nru rcssserver3d-0.6.3/CMakeLists.txt rcssserver3d-0.6.4/CMakeLists.txt --- rcssserver3d-0.6.3/CMakeLists.txt 2010-01-18 21:17:07.000000000 +0000 +++ rcssserver3d-0.6.4/CMakeLists.txt 2010-06-08 09:38:29.000000000 +0100 @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 2.6) project(rcssserver3d CXX C) -set(PACKAGE_VERSION "0.6.3") +set(PACKAGE_VERSION "0.6.4") ########## check for headerfiles/libraries ########## include(CheckIncludeFile) diff -Nru rcssserver3d-0.6.3/data/rsg/agent/ball.rsg rcssserver3d-0.6.4/data/rsg/agent/ball.rsg --- rcssserver3d-0.6.3/data/rsg/agent/ball.rsg 2010-01-18 21:17:07.000000000 +0000 +++ rcssserver3d-0.6.4/data/rsg/agent/ball.rsg 2010-06-08 09:38:29.000000000 +0100 @@ -15,7 +15,7 @@ (setScale $Radius $Radius $Radius) ) - (nd Body + (nd RigidBody (setName physics) (setSphereTotal $Mass $Radius) diff -Nru rcssserver3d-0.6.3/data/rsg/agent/fieldline.rsg rcssserver3d-0.6.4/data/rsg/agent/fieldline.rsg --- rcssserver3d-0.6.3/data/rsg/agent/fieldline.rsg 1970-01-01 01:00:00.000000000 +0100 +++ rcssserver3d-0.6.4/data/rsg/agent/fieldline.rsg 2010-06-08 09:38:29.000000000 +0100 @@ -0,0 +1,28 @@ +; -*- mode: lisp; -*- +; +; create a field line from ($BegX $BegY) to ($EndX $EndY) +; + +(RSG 0 1) +( + (templ $BegX $BegY $EndX $EndY) + + (nd Transform + (nd Line + (setBeginPoint $BegX $BegY 0) + (setEndPoint $EndX $EndY 0) + ) + ) + + ;; (def $centerX (eval (eval $BegX + $EndX) / 2.0)) + ;; (def $centerY (eval (eval $BegY + $EndY) / 2.0)) + ;; (def $lengthX (eval $EndX - $BegX)) + ;; (def $lengthY (eval $EndY - $BegY)) + + ;; (nd Transform + ;; (setLocalPos $centerX $centerY 0) + ;; (nd Box + ;; (setExtents $lengthX $lengthY 0.1) + ;; ) + ;; ) + ) \ No newline at end of file diff -Nru rcssserver3d-0.6.3/data/rsg/agent/fieldring.rsg rcssserver3d-0.6.4/data/rsg/agent/fieldring.rsg --- rcssserver3d-0.6.3/data/rsg/agent/fieldring.rsg 1970-01-01 01:00:00.000000000 +0100 +++ rcssserver3d-0.6.4/data/rsg/agent/fieldring.rsg 2010-06-08 09:38:29.000000000 +0100 @@ -0,0 +1,89 @@ +; -*- mode: lisp; -*- +; +; create a field ring with radius $Radius +; + +(RSG 0 1) +( + (templ $Radius) + + (def $px0 (eval 1.0 * $Radius)) + (def $py0 0.0) + + (def $px36 (eval 0.80901699437494745 * $Radius)) + (def $py36 (eval 0.58778525229247314 * $Radius)) + + (def $px72 (eval 0.30901699437494745 * $Radius)) + (def $py72 (eval 0.95105651629515353 * $Radius)) + + (def $px108 (eval -0.30901699437494734 * $Radius)) + (def $py108 (eval 0.95105651629515364 * $Radius)) + + (def $px144 (eval -0.80901699437494734 * $Radius)) + (def $py144 (eval 0.58778525229247325 * $Radius)) + + (def $px180 (eval -1.0 * $Radius)) + (def $py180 (eval 0.0)) + + (def $px216 $px144) + (def $py216 (eval -1 * $py144)) + + (def $px252 $px108) + (def $py252 (eval -1 * $py108)) + + (def $px288 $px72) + (def $py288 (eval -1 * $py72)) + + (def $px324 $px36) + (def $py324 (eval -1 * $py36)) + + (importScene rsg/agent/fieldline.rsg + $px0 $py0 + $px36 $py36 + ) + + (importScene rsg/agent/fieldline.rsg + $px36 $py36 + $px72 $py72 + ) + + (importScene rsg/agent/fieldline.rsg + $px72 $py72 + $px108 $py108 + ) + + (importScene rsg/agent/fieldline.rsg + $px108 $py108 + $px144 $py144 + ) + + (importScene rsg/agent/fieldline.rsg + $px144 $py144 + $px180 $py180 + ) + + (importScene rsg/agent/fieldline.rsg + $px180 $py180 + $px216 $py216 + ) + + (importScene rsg/agent/fieldline.rsg + $px216 $py216 + $px252 $py252 + ) + + (importScene rsg/agent/fieldline.rsg + $px252 $py252 + $px288 $py288 + ) + + (importScene rsg/agent/fieldline.rsg + $px288 $py288 + $px324 $py324 + ) + + (importScene rsg/agent/fieldline.rsg + $px324 $py324 + $px0 $py0 + ) + ) diff -Nru rcssserver3d-0.6.3/data/rsg/agent/hoap2.rsg rcssserver3d-0.6.4/data/rsg/agent/hoap2.rsg --- rcssserver3d-0.6.3/data/rsg/agent/hoap2.rsg 2010-01-18 21:17:07.000000000 +0000 +++ rcssserver3d-0.6.4/data/rsg/agent/hoap2.rsg 2010-06-08 09:38:29.000000000 +0100 @@ -142,7 +142,7 @@ (nd Transform (setLocalPos $offsetLeftShoulderCylX $offsetLeftShoulderCylY $offsetLeftShoulderCylZ) (setLocalRotation 0 90 0) - (nd CCylinder + (nd Capsule (setMaterial matGrey) (setParams $TorsoCylinderRadius $TorsoCylinderLength) ) @@ -151,7 +151,7 @@ (nd Transform (setLocalPos $offsetRightShoulderCylX $offsetRightShoulderCylY $offsetRightShoulderCylZ) (setLocalRotation 0 90 0) - (nd CCylinder + (nd Capsule (setMaterial matGrey) (setParams $TorsoCylinderRadius $TorsoCylinderLength) ) @@ -373,7 +373,7 @@ (nd Transform (setLocalPos 0 0 (eval -1 * (eval (eval $UpperarmHeight / 2.0) + (eval $ElbowRadius / 2.0)))) (setLocalRotation 0 90 0) - (nd CCylinder + (nd Capsule (setMaterial matGrey) (setParams $ElbowRadius $ElbowLength) ) @@ -410,7 +410,7 @@ (nd Transform (setLocalPos 0 0 (eval -1 * (eval (eval $UpperarmHeight / 2.0) + (eval $ElbowRadius / 2.0)))) (setLocalRotation 0 90 0) - (nd CCylinder + (nd Capsule (setMaterial matGrey) (setParams $ElbowRadius $ElbowLength) ) diff -Nru rcssserver3d-0.6.3/data/rsg/agent/nao/box_physics_nocollider.rsg rcssserver3d-0.6.4/data/rsg/agent/nao/box_physics_nocollider.rsg --- rcssserver3d-0.6.3/data/rsg/agent/nao/box_physics_nocollider.rsg 2010-01-18 21:17:07.000000000 +0000 +++ rcssserver3d-0.6.4/data/rsg/agent/nao/box_physics_nocollider.rsg 2010-06-08 09:38:29.000000000 +0100 @@ -4,7 +4,7 @@ ( (templ $lenX $lenY $lenZ $totalMass) - (nd Body + (nd RigidBody (setName boxBody) (setBoxTotal $totalMass $lenX $lenY $lenZ) diff -Nru rcssserver3d-0.6.3/data/rsg/agent/nao/box_physics.rsg rcssserver3d-0.6.4/data/rsg/agent/nao/box_physics.rsg --- rcssserver3d-0.6.3/data/rsg/agent/nao/box_physics.rsg 2010-01-18 21:17:07.000000000 +0000 +++ rcssserver3d-0.6.4/data/rsg/agent/nao/box_physics.rsg 2010-06-08 09:38:29.000000000 +0100 @@ -4,7 +4,7 @@ ( (templ $lenX $lenY $lenZ $totalMass) - (nd Body + (nd RigidBody (setName boxBody) (setBoxTotal $totalMass $lenX $lenY $lenZ) @@ -16,4 +16,4 @@ (importScene rsg/agent/nao/contactjointhandler.rsg) ) -) \ No newline at end of file +) diff -Nru rcssserver3d-0.6.3/data/rsg/agent/nao/box_physics_with_handler.rsg rcssserver3d-0.6.4/data/rsg/agent/nao/box_physics_with_handler.rsg --- rcssserver3d-0.6.3/data/rsg/agent/nao/box_physics_with_handler.rsg 2010-01-18 21:17:07.000000000 +0000 +++ rcssserver3d-0.6.4/data/rsg/agent/nao/box_physics_with_handler.rsg 2010-06-08 09:38:29.000000000 +0100 @@ -4,7 +4,7 @@ ( (templ $lenX $lenY $lenZ $totalMass) - (nd Body + (nd RigidBody (setName boxBody) (setBoxTotal $totalMass $lenX $lenY $lenZ) diff -Nru rcssserver3d-0.6.3/data/rsg/agent/nao/capsule_appearance.rsg rcssserver3d-0.6.4/data/rsg/agent/nao/capsule_appearance.rsg --- rcssserver3d-0.6.3/data/rsg/agent/nao/capsule_appearance.rsg 1970-01-01 01:00:00.000000000 +0100 +++ rcssserver3d-0.6.4/data/rsg/agent/nao/capsule_appearance.rsg 2010-06-08 09:38:29.000000000 +0100 @@ -0,0 +1,11 @@ +; -*- mode: lisp; -*- + +(RSG 0 1) +( + (templ $radius $length $material) + + (nd Capsule + (setParams $radius $length) + (setMaterial $material) + ) +) diff -Nru rcssserver3d-0.6.3/data/rsg/agent/nao/capsule_physics_nocollider.rsg rcssserver3d-0.6.4/data/rsg/agent/nao/capsule_physics_nocollider.rsg --- rcssserver3d-0.6.3/data/rsg/agent/nao/capsule_physics_nocollider.rsg 1970-01-01 01:00:00.000000000 +0100 +++ rcssserver3d-0.6.4/data/rsg/agent/nao/capsule_physics_nocollider.rsg 2010-06-08 09:38:29.000000000 +0100 @@ -0,0 +1,13 @@ +; -*- mode: lisp; -*- + +(RSG 0 1) +( + (templ $radius $length $totalMass) + + (nd RigidBody + (setName capsuleBody) + (setCapsuleTotal $totalMass $radius) + + (importScene rsg/agent/nao/dragcontroller.rsg) + ) +) diff -Nru rcssserver3d-0.6.3/data/rsg/agent/nao/capsule_physics.rsg rcssserver3d-0.6.4/data/rsg/agent/nao/capsule_physics.rsg --- rcssserver3d-0.6.3/data/rsg/agent/nao/capsule_physics.rsg 1970-01-01 01:00:00.000000000 +0100 +++ rcssserver3d-0.6.4/data/rsg/agent/nao/capsule_physics.rsg 2010-06-08 09:38:29.000000000 +0100 @@ -0,0 +1,19 @@ +; -*- mode: lisp; -*- + +(RSG 0 1) +( + (templ $radius $length $totalMass) + + (nd RigidBody + (setName capsuleBody) + (setCapsuleTotal $totalMass $radius $length) + + (importScene rsg/agent/nao/dragcontroller.rsg) + ) + + (nd CapsuleCollider + (setParams $radius $length) + + (importScene rsg/agent/nao/contactjointhandler.rsg) + ) + ) diff -Nru rcssserver3d-0.6.3/data/rsg/agent/nao/ccylinder_appearance.rsg rcssserver3d-0.6.4/data/rsg/agent/nao/ccylinder_appearance.rsg --- rcssserver3d-0.6.3/data/rsg/agent/nao/ccylinder_appearance.rsg 2010-01-18 21:17:07.000000000 +0000 +++ rcssserver3d-0.6.4/data/rsg/agent/nao/ccylinder_appearance.rsg 1970-01-01 01:00:00.000000000 +0100 @@ -1,11 +0,0 @@ -; -*- mode: lisp; -*- - -(RSG 0 1) -( - (templ $radius $length $material) - - (nd CCylinder - (setParams $radius $length) - (setMaterial $material) - ) -) diff -Nru rcssserver3d-0.6.3/data/rsg/agent/nao/ccylinder_physics_nocollider.rsg rcssserver3d-0.6.4/data/rsg/agent/nao/ccylinder_physics_nocollider.rsg --- rcssserver3d-0.6.3/data/rsg/agent/nao/ccylinder_physics_nocollider.rsg 2010-01-18 21:17:07.000000000 +0000 +++ rcssserver3d-0.6.4/data/rsg/agent/nao/ccylinder_physics_nocollider.rsg 1970-01-01 01:00:00.000000000 +0100 @@ -1,13 +0,0 @@ -; -*- mode: lisp; -*- - -(RSG 0 1) -( - (templ $radius $length $totalMass) - - (nd Body - (setName ccylinderBody) - (setCappedCylinderTotal $totalMass $radius) - - (importScene rsg/agent/nao/dragcontroller.rsg) - ) -) diff -Nru rcssserver3d-0.6.3/data/rsg/agent/nao/ccylinder_physics.rsg rcssserver3d-0.6.4/data/rsg/agent/nao/ccylinder_physics.rsg --- rcssserver3d-0.6.3/data/rsg/agent/nao/ccylinder_physics.rsg 2010-01-18 21:17:07.000000000 +0000 +++ rcssserver3d-0.6.4/data/rsg/agent/nao/ccylinder_physics.rsg 1970-01-01 01:00:00.000000000 +0100 @@ -1,19 +0,0 @@ -; -*- mode: lisp; -*- - -(RSG 0 1) -( - (templ $radius $length $totalMass) - - (nd Body - (setName ccylinderBody) - (setCappedCylinderTotal $totalMass $radius $length) - - (importScene rsg/agent/nao/dragcontroller.rsg) - ) - - (nd CCylinderCollider - (setParams $radius $length) - - (importScene rsg/agent/nao/contactjointhandler.rsg) - ) - ) diff -Nru rcssserver3d-0.6.3/data/rsg/agent/nao/naoneckhead.rsg rcssserver3d-0.6.4/data/rsg/agent/nao/naoneckhead.rsg --- rcssserver3d-0.6.3/data/rsg/agent/nao/naoneckhead.rsg 2010-01-18 21:17:07.000000000 +0000 +++ rcssserver3d-0.6.4/data/rsg/agent/nao/naoneckhead.rsg 2010-06-08 09:38:29.000000000 +0100 @@ -43,12 +43,12 @@ (setName neck) (setLocalPos $Neck_X $Neck_Y $Neck_Z) - (importScene rsg/agent/nao/ccylinder_appearance.rsg $Neck_Radius $Neck_Length matDarkGrey) - (importScene rsg/agent/nao/ccylinder_physics.rsg $Neck_Radius $Neck_Length $Neck_Mass) + (importScene rsg/agent/nao/capsule_appearance.rsg $Neck_Radius $Neck_Length matDarkGrey) + (importScene rsg/agent/nao/capsule_physics.rsg $Neck_Radius $Neck_Length $Neck_Mass) (importScene rsg/agent/nao/hingejoint.rsg hj1 he1 - ../ccylinderBody ../../body/boxBody + ../capsuleBody ../../body/boxBody 0 0 0 0 0 1 $he1_min $he1_max) @@ -80,7 +80,7 @@ (importScene rsg/agent/nao/hingejoint.rsg hj2 he2 - ../sphereBody ../../neck/ccylinderBody + ../sphereBody ../../neck/capsuleBody ;../boxBody ../../body/boxBody 0 0 -0.005 1 0 0 diff -Nru rcssserver3d-0.6.3/data/rsg/agent/nao/nao.rsg rcssserver3d-0.6.4/data/rsg/agent/nao/nao.rsg --- rcssserver3d-0.6.3/data/rsg/agent/nao/nao.rsg 2010-01-18 21:17:07.000000000 +0000 +++ rcssserver3d-0.6.4/data/rsg/agent/nao/nao.rsg 2010-06-08 09:38:29.000000000 +0100 @@ -68,6 +68,15 @@ (setName AgentState) (nd GameStatePerceptor) (nd HearPerceptor) + (nd Transform + (nd Cylinder + (setName SelectionMarker) + (setParams 1.0 1.0) + (setScale 0.2 0.2 0.02) + (setMaterial matSelect) + (setTransparent) + ) + ) ) (nd GyroRatePerceptor (setName torso)) diff -Nru rcssserver3d-0.6.3/data/rsg/agent/nao/soccer.rsg rcssserver3d-0.6.4/data/rsg/agent/nao/soccer.rsg --- rcssserver3d-0.6.3/data/rsg/agent/nao/soccer.rsg 2010-01-18 21:17:07.000000000 +0000 +++ rcssserver3d-0.6.4/data/rsg/agent/nao/soccer.rsg 2010-06-08 09:38:29.000000000 +0100 @@ -10,6 +10,8 @@ (def $FieldWidth (eval Soccer.FieldWidth)) (def $FieldHeight (eval Soccer.FieldHeight)) (def $GoalDepth (eval Soccer.GoalDepth)) + (def $PenaltyLength (eval Soccer.PenaltyLength)) + (def $PenaltyWidth (eval Soccer.PenaltyWidth)) ;; height of the field ground plane (def $FieldMaterial matGrass) @@ -22,6 +24,8 @@ (def $GoalHalfDepth (eval $GoalDepth / 2.0)) (def $FieldLengthTextureSize (eval $FieldLength / 12.0 )) (def $FieldWidthTextureSize (eval $FieldWidth / 8.0 )) + (def $PenaltyX (eval $FieldHalfLength - $PenaltyLength )) + (def $PenaltyHalfWidth (eval $PenaltyWidth * 0.5 )) (def $BorderLength (eval $FieldLength * 0.333)) (def $BorderWidth (eval $FieldWidth * 0.75)) @@ -193,6 +197,71 @@ 0 F2R ) +;; +;; add field lines +;; +;; middle line +(importScene rsg/agent/fieldline.rsg + 0 (eval -1 * $FieldHalfWidth) + 0 $FieldHalfWidth + ) + +;; ground lines +(importScene rsg/agent/fieldline.rsg + $FieldHalfLength (eval -1 * $FieldHalfWidth) + $FieldHalfLength $FieldHalfWidth + ) + +(importScene rsg/agent/fieldline.rsg + (eval -1 * $FieldHalfLength) (eval -1 * $FieldHalfWidth) + (eval -1 * $FieldHalfLength) $FieldHalfWidth + ) + +;; side lines +(importScene rsg/agent/fieldline.rsg + $FieldHalfLength $FieldHalfWidth + (eval -1 * $FieldHalfLength) $FieldHalfWidth + ) + +(importScene rsg/agent/fieldline.rsg + $FieldHalfLength (eval -1 * $FieldHalfWidth) + (eval -1 * $FieldHalfLength) (eval -1 * $FieldHalfWidth) + ) + +;; penalty lines +(importScene rsg/agent/fieldline.rsg + $PenaltyX $PenaltyHalfWidth + $PenaltyX (eval -1 * $PenaltyHalfWidth) + ) + +(importScene rsg/agent/fieldline.rsg + $PenaltyX $PenaltyHalfWidth + $FieldHalfLength $PenaltyHalfWidth + ) + +(importScene rsg/agent/fieldline.rsg + $PenaltyX (eval -1 * $PenaltyHalfWidth) + $FieldHalfLength (eval -1 * $PenaltyHalfWidth) + ) + +(importScene rsg/agent/fieldline.rsg + (eval -1 * $PenaltyX) $PenaltyHalfWidth + (eval -1 * $PenaltyX) (eval -1 * $PenaltyHalfWidth) + ) + +(importScene rsg/agent/fieldline.rsg + (eval -1 * $PenaltyX) $PenaltyHalfWidth + (eval -1 * $FieldHalfLength) $PenaltyHalfWidth + ) + +(importScene rsg/agent/fieldline.rsg + (eval -1 * $PenaltyX) (eval -1 * $PenaltyHalfWidth) + (eval -1 * $FieldHalfLength) (eval -1 * $PenaltyHalfWidth) + ) + +;; ring +(importScene rsg/agent/fieldring.rsg + 1.8) ;; ;; add the ball diff -Nru rcssserver3d-0.6.3/data/rsg/agent/nao/sphere_physics_nocollider.rsg rcssserver3d-0.6.4/data/rsg/agent/nao/sphere_physics_nocollider.rsg --- rcssserver3d-0.6.3/data/rsg/agent/nao/sphere_physics_nocollider.rsg 2010-01-18 21:17:07.000000000 +0000 +++ rcssserver3d-0.6.4/data/rsg/agent/nao/sphere_physics_nocollider.rsg 2010-06-08 09:38:29.000000000 +0100 @@ -4,7 +4,7 @@ ( (templ $radius $totalMass) - (nd Body + (nd RigidBody (setName sphereBody) (setSphereTotal $totalMass $radius) diff -Nru rcssserver3d-0.6.3/data/rsg/agent/nao/sphere_physics.rsg rcssserver3d-0.6.4/data/rsg/agent/nao/sphere_physics.rsg --- rcssserver3d-0.6.3/data/rsg/agent/nao/sphere_physics.rsg 2010-01-18 21:17:07.000000000 +0000 +++ rcssserver3d-0.6.4/data/rsg/agent/nao/sphere_physics.rsg 2010-06-08 09:38:29.000000000 +0100 @@ -4,7 +4,7 @@ ( (templ $radius $totalMass) - (nd Body + (nd RigidBody (setName sphereBody) (setSphereTotal $totalMass $radius) diff -Nru rcssserver3d-0.6.3/data/rsg/agent/soccerbot055.rsg rcssserver3d-0.6.4/data/rsg/agent/soccerbot055.rsg --- rcssserver3d-0.6.3/data/rsg/agent/soccerbot055.rsg 2010-01-18 21:17:07.000000000 +0000 +++ rcssserver3d-0.6.4/data/rsg/agent/soccerbot055.rsg 2010-06-08 09:38:29.000000000 +0100 @@ -168,7 +168,7 @@ (nd Transform (setLocalPos $offsetLeftShoulderCylX $offsetLeftShoulderCylY $offsetLeftShoulderCylZ) (setLocalRotation 0 90 0) - (nd CCylinder + (nd Capsule (setName leftshoulderpin) (setMaterial matDarkGrey) (setParams $TorsoCylinderRadius $TorsoCylinderLength) @@ -178,7 +178,7 @@ (nd Transform (setLocalPos $offsetRightShoulderCylX $offsetRightShoulderCylY $offsetRightShoulderCylZ) (setLocalRotation 0 90 0) - (nd CCylinder + (nd Capsule (setName rightshoulderpin) (setMaterial matDarkGrey) (setParams $TorsoCylinderRadius $TorsoCylinderLength) @@ -336,7 +336,7 @@ (nd Transform (setLocalPos 0 0 (eval -1 * (eval (eval $UpperarmHeight / 2.0) + (eval $ElbowRadius / 2.0)))) (setLocalRotation 0 90 0) - (nd CCylinder + (nd Capsule (setMaterial matGrey) (setParams $ElbowRadius $ElbowLength) ) @@ -374,7 +374,7 @@ (nd Transform (setLocalPos 0 0 (eval -1 * (eval (eval $UpperarmHeight / 2.0) + (eval $ElbowRadius / 2.0)))) (setLocalRotation 0 90 0) - (nd CCylinder + (nd Capsule (setMaterial matGrey) (setParams $ElbowRadius $ElbowLength) ) diff -Nru rcssserver3d-0.6.3/data/rsg/agent/soccerbot056.rsg rcssserver3d-0.6.4/data/rsg/agent/soccerbot056.rsg --- rcssserver3d-0.6.3/data/rsg/agent/soccerbot056.rsg 2010-01-18 21:17:07.000000000 +0000 +++ rcssserver3d-0.6.4/data/rsg/agent/soccerbot056.rsg 2010-06-08 09:38:29.000000000 +0100 @@ -204,7 +204,7 @@ (nd Transform (setLocalPos $offsetLeftShoulderCylX $offsetLeftShoulderCylY $offsetLeftShoulderCylZ) (setLocalRotation 0 90 0) - (nd CCylinder + (nd Capsule (setName leftshoulderpin) (setMaterial matDarkGrey) (setParams $TorsoCylinderRadius $TorsoCylinderLength) @@ -214,7 +214,7 @@ (nd Transform (setLocalPos $offsetRightShoulderCylX $offsetRightShoulderCylY $offsetRightShoulderCylZ) (setLocalRotation 0 90 0) - (nd CCylinder + (nd Capsule (setName rightshoulderpin) (setMaterial matDarkGrey) (setParams $TorsoCylinderRadius $TorsoCylinderLength) @@ -409,7 +409,7 @@ (nd Transform (setLocalPos 0 0 (eval -1 * (eval (eval $UpperarmHeight / 2.0) + (eval $ElbowRadius / 2.0)))) (setLocalRotation 0 90 0) - (nd CCylinder + (nd Capsule (setMaterial matGrey) (setParams $ElbowRadius $ElbowLength) ) @@ -455,7 +455,7 @@ (nd Transform (setLocalPos 0 0 (eval -1 * (eval (eval $UpperarmHeight / 2.0) + (eval $ElbowRadius / 2.0)))) (setLocalRotation 0 90 0) - (nd CCylinder + (nd Capsule (setMaterial matGrey) (setParams $ElbowRadius $ElbowLength) ) @@ -771,7 +771,7 @@ (nd Transform (setLocalPos 0 0 (eval (eval $ThighHeight * -0.5) - 0.025)) (setLocalRotation 0 90 0) - (nd CCylinder + (nd Capsule (setMaterial matRed) (setParams 0.1 (eval $ThighLength - 0.2)) ) @@ -812,7 +812,7 @@ (nd Transform (setLocalPos 0 0 (eval (eval $ThighHeight * -0.5) - 0.025)) (setLocalRotation 0 90 0) - (nd CCylinder + (nd Capsule (setMaterial matRed) (setParams 0.1 (eval $ThighLength - 0.2)) ) diff -Nru rcssserver3d-0.6.3/data/rsg/agent/soccerbot058/box.rsg rcssserver3d-0.6.4/data/rsg/agent/soccerbot058/box.rsg --- rcssserver3d-0.6.3/data/rsg/agent/soccerbot058/box.rsg 2010-01-18 21:17:07.000000000 +0000 +++ rcssserver3d-0.6.4/data/rsg/agent/soccerbot058/box.rsg 2010-06-08 09:38:29.000000000 +0100 @@ -8,17 +8,17 @@ (setMaterial $material) ) - (nd Body + (nd RigidBody (setName boxBody) (setBoxTotal $totalMass $lenX $lenY $lenZ) - (nd DragController - (setAngularDrag 0.01) - (setLinearDrag 0.01) - ) + (nd DragController + (setAngularDrag 0.01) + (setLinearDrag 0.01) + ) ) (nd BoxCollider (setBoxLengths $lenX $lenY $lenZ) (importScene rsg/agent/nao/contactjointhandler.rsg) ) - ) \ No newline at end of file + ) diff -Nru rcssserver3d-0.6.3/data/rsg/agent/soccerbot058/box_with_handler.rsg rcssserver3d-0.6.4/data/rsg/agent/soccerbot058/box_with_handler.rsg --- rcssserver3d-0.6.3/data/rsg/agent/soccerbot058/box_with_handler.rsg 2010-01-18 21:17:07.000000000 +0000 +++ rcssserver3d-0.6.4/data/rsg/agent/soccerbot058/box_with_handler.rsg 2010-06-08 09:38:29.000000000 +0100 @@ -8,7 +8,7 @@ (setMaterial $material) ) - (nd Body + (nd RigidBody (setName boxBody) (setBoxTotal $totalMass $lenX $lenY $lenZ) (nd DragController @@ -21,4 +21,4 @@ (setBoxLengths $lenX $lenY $lenZ) (importScene rsg/agent/nao/touchperceptorhandler.rsg) ) - ) \ No newline at end of file + ) diff -Nru rcssserver3d-0.6.3/data/rsg/agent/soccerbot058/box_with_hj_with_capsule.rsg rcssserver3d-0.6.4/data/rsg/agent/soccerbot058/box_with_hj_with_capsule.rsg --- rcssserver3d-0.6.3/data/rsg/agent/soccerbot058/box_with_hj_with_capsule.rsg 1970-01-01 01:00:00.000000000 +0100 +++ rcssserver3d-0.6.4/data/rsg/agent/soccerbot058/box_with_hj_with_capsule.rsg 2010-06-08 09:38:29.000000000 +0100 @@ -0,0 +1,37 @@ +;; -*- mode: lisp; -*- + +(RSG 0 1) +( + (templ $name $perceptorName $effectorName $attach + $x $y $z + $lenX $lenY $lenZ + $anchorX $anchorY $anchorZ + $axisX $axisY $axisZ $minDeg $maxDeg + $totalMass $material $ElbowRadius $ElbowLen) + + (nd Transform + (setName $name) + (setLocalPos $x $y $z) + (importScene rsg/agent/soccerbot058/box.rsg + $lenX $lenY $lenZ + $totalMass $material) + + ;; install hinge joint + (importScene rsg/agent/nao/hingejoint.rsg + $perceptorName $effectorName + ../boxBody $attach + $anchorX $anchorY $anchorZ + $axisX $axisY $axisZ + $minDeg $maxDeg) + + ;; static cylinder for the elbow + (nd Transform + (setLocalPos $anchorX $anchorY $anchorZ) + (setLocalRotation 0 90 0) + (nd Capsule + (setMaterial matGrey) + (setParams $ElbowRadius $ElbowLen) + ) + ) + ) + ) diff -Nru rcssserver3d-0.6.3/data/rsg/agent/soccerbot058/box_with_hj_with_ccylinder.rsg rcssserver3d-0.6.4/data/rsg/agent/soccerbot058/box_with_hj_with_ccylinder.rsg --- rcssserver3d-0.6.3/data/rsg/agent/soccerbot058/box_with_hj_with_ccylinder.rsg 2010-01-18 21:17:07.000000000 +0000 +++ rcssserver3d-0.6.4/data/rsg/agent/soccerbot058/box_with_hj_with_ccylinder.rsg 1970-01-01 01:00:00.000000000 +0100 @@ -1,37 +0,0 @@ -;; -*- mode: lisp; -*- - -(RSG 0 1) -( - (templ $name $perceptorName $effectorName $attach - $x $y $z - $lenX $lenY $lenZ - $anchorX $anchorY $anchorZ - $axisX $axisY $axisZ $minDeg $maxDeg - $totalMass $material $ElbowRadius $ElbowLen) - - (nd Transform - (setName $name) - (setLocalPos $x $y $z) - (importScene rsg/agent/soccerbot058/box.rsg - $lenX $lenY $lenZ - $totalMass $material) - - ;; install hinge joint - (importScene rsg/agent/nao/hingejoint.rsg - $perceptorName $effectorName - ../boxBody $attach - $anchorX $anchorY $anchorZ - $axisX $axisY $axisZ - $minDeg $maxDeg) - - ;; static cylinder for the elbow - (nd Transform - (setLocalPos $anchorX $anchorY $anchorZ) - (setLocalRotation 0 90 0) - (nd CCylinder - (setMaterial matGrey) - (setParams $ElbowRadius $ElbowLen) - ) - ) - ) - ) diff -Nru rcssserver3d-0.6.3/data/rsg/agent/soccerbot058/head.rsg rcssserver3d-0.6.4/data/rsg/agent/soccerbot058/head.rsg --- rcssserver3d-0.6.3/data/rsg/agent/soccerbot058/head.rsg 2010-01-18 21:17:07.000000000 +0000 +++ rcssserver3d-0.6.4/data/rsg/agent/soccerbot058/head.rsg 2010-06-08 09:38:29.000000000 +0100 @@ -9,7 +9,7 @@ (setName head) (setLocalPos $HeadPosX $HeadPosY $HeadPosZ) - (nd Body + (nd RigidBody (setName sphereBody) (setSphereTotal $headMass $headRadius $HeadPosX $HeadPosY $HeadPosZ diff -Nru rcssserver3d-0.6.3/data/rsg/agent/soccerbot058/lowerarm_body.rsg rcssserver3d-0.6.4/data/rsg/agent/soccerbot058/lowerarm_body.rsg --- rcssserver3d-0.6.3/data/rsg/agent/soccerbot058/lowerarm_body.rsg 2010-01-18 21:17:07.000000000 +0000 +++ rcssserver3d-0.6.4/data/rsg/agent/soccerbot058/lowerarm_body.rsg 2010-06-08 09:38:29.000000000 +0100 @@ -32,7 +32,7 @@ - (eval 0.04 * $scale))) - (nd Body + (nd RigidBody (setName boxBody) ;; Lower arm (setBox $LowerarmMass $LowerarmLength $LowerarmWidth $LowerarmHeight) diff -Nru rcssserver3d-0.6.3/data/rsg/agent/soccerbot058/lowerarm.rsg rcssserver3d-0.6.4/data/rsg/agent/soccerbot058/lowerarm.rsg --- rcssserver3d-0.6.3/data/rsg/agent/soccerbot058/lowerarm.rsg 2010-01-18 21:17:07.000000000 +0000 +++ rcssserver3d-0.6.4/data/rsg/agent/soccerbot058/lowerarm.rsg 2010-06-08 09:38:29.000000000 +0100 @@ -38,7 +38,7 @@ (nd Transform (setLocalPos $anchorX $anchorY $anchorZ) (setLocalRotation 0 90 0) - (nd CCylinder + (nd Capsule (setMaterial matGrey) (setParams $ElbowRadius $ElbowLen) ) diff -Nru rcssserver3d-0.6.3/data/rsg/agent/soccerbot058/soccerbot.rsg rcssserver3d-0.6.4/data/rsg/agent/soccerbot058/soccerbot.rsg --- rcssserver3d-0.6.3/data/rsg/agent/soccerbot058/soccerbot.rsg 2010-01-18 21:17:07.000000000 +0000 +++ rcssserver3d-0.6.4/data/rsg/agent/soccerbot058/soccerbot.rsg 2010-06-08 09:38:29.000000000 +0100 @@ -216,7 +216,7 @@ $offsetLeftShoulderCylY $offsetLeftShoulderCylZ) (setLocalRotation 0 90 0) - (nd CCylinder + (nd Capsule (setName leftshoulderpin) (setMaterial matDarkGrey) (setParams $TorsoCylinderRadius $TorsoCylinderLength) @@ -228,7 +228,7 @@ $offsetRightShoulderCylY $offsetRightShoulderCylZ) (setLocalRotation 0 90 0) - (nd CCylinder + (nd Capsule (setName rightshoulderpin) (setMaterial matDarkGrey) (setParams $TorsoCylinderRadius $TorsoCylinderLength) @@ -434,7 +434,7 @@ - (eval $ShankHeight / 2.0) - (eval 0.05 * $scale))) (def $ShankAnchorZ (eval $ShankHeight * 0.5)) - (importScene rsg/agent/soccerbot058/box_with_hj_with_ccylinder.rsg + (importScene rsg/agent/soccerbot058/box_with_hj_with_capsule.rsg leftshank llj4 lle4 ../../leftthigh/boxBody $LeftShankPosX $LeftShankPosY $LeftShankPosZ $ShankLength $ShankWidth $ShankHeight @@ -447,7 +447,7 @@ (def $RightShankPosX $RightThighPosX) (def $RightShankPosY $RightThighPosY) (def $RightShankPosZ $LeftShankPosZ) - (importScene rsg/agent/soccerbot058/box_with_hj_with_ccylinder.rsg + (importScene rsg/agent/soccerbot058/box_with_hj_with_capsule.rsg rightshank rlj4 rle4 ../../rightthigh/boxBody $RightShankPosX $RightShankPosY $RightShankPosZ $ShankLength $ShankWidth $ShankHeight diff -Nru rcssserver3d-0.6.3/data/rsg/agent/soccerbot058/soccerbottorso.rsg rcssserver3d-0.6.4/data/rsg/agent/soccerbot058/soccerbottorso.rsg --- rcssserver3d-0.6.3/data/rsg/agent/soccerbot058/soccerbottorso.rsg 2010-01-18 21:17:07.000000000 +0000 +++ rcssserver3d-0.6.4/data/rsg/agent/soccerbot058/soccerbottorso.rsg 2010-06-08 09:38:29.000000000 +0100 @@ -16,7 +16,7 @@ ; + (eval 0.1 * $scale)) ; + (eval $headRadius / 2.0))) - (nd Body + (nd RigidBody (setName boxBody) ; Upper torso mass (setBoxTotal $upperMass $upperLenX $upperLenY $upperLenZ) diff -Nru rcssserver3d-0.6.3/data/rsg/agent/soccerbotcomp.rsg rcssserver3d-0.6.4/data/rsg/agent/soccerbotcomp.rsg --- rcssserver3d-0.6.3/data/rsg/agent/soccerbotcomp.rsg 2010-01-18 21:17:07.000000000 +0000 +++ rcssserver3d-0.6.4/data/rsg/agent/soccerbotcomp.rsg 2010-06-08 09:38:29.000000000 +0100 @@ -203,7 +203,7 @@ (nd Transform (setLocalPos $offsetLeftShoulderCylX $offsetLeftShoulderCylY $offsetLeftShoulderCylZ) (setLocalRotation 0 90 0) - (nd CCylinder + (nd Capsule (setName leftshoulderpin) (setMaterial matDarkGrey) (setParams $TorsoCylinderRadius $TorsoCylinderLength) @@ -213,7 +213,7 @@ (nd Transform (setLocalPos $offsetRightShoulderCylX $offsetRightShoulderCylY $offsetRightShoulderCylZ) (setLocalRotation 0 90 0) - (nd CCylinder + (nd Capsule (setName rightshoulderpin) (setMaterial matDarkGrey) (setParams $TorsoCylinderRadius $TorsoCylinderLength) @@ -369,7 +369,7 @@ (nd Transform (setLocalPos 0 0 (eval -1 * (eval (eval $UpperarmHeight / 2.0) + (eval $ElbowRadius / 2.0)))) (setLocalRotation 0 90 0) - (nd CCylinder + (nd Capsule (setMaterial matGrey) (setParams $ElbowRadius $ElbowLength) ) @@ -415,7 +415,7 @@ (nd Transform (setLocalPos 0 0 (eval -1 * (eval (eval $UpperarmHeight / 2.0) + (eval $ElbowRadius / 2.0)))) (setLocalRotation 0 90 0) - (nd CCylinder + (nd Capsule (setMaterial matGrey) (setParams $ElbowRadius $ElbowLength) ) @@ -621,7 +621,7 @@ (nd Transform (setLocalPos 0 0 (eval (eval $ThighHeight * -0.5) - 0.025)) (setLocalRotation 0 90 0) - (nd CCylinder + (nd Capsule (setMaterial matRed) (setParams 0.1 (eval $ThighLength - 0.2)) ) @@ -662,7 +662,7 @@ (nd Transform (setLocalPos 0 0 (eval (eval $ThighHeight * -0.5) - 0.025)) (setLocalRotation 0 90 0) - (nd CCylinder + (nd Capsule (setMaterial matRed) (setParams 0.1 (eval $ThighLength - 0.2)) ) diff -Nru rcssserver3d-0.6.3/data/rsg/agent/soccerbotleftlowerarmcomp.rsg rcssserver3d-0.6.4/data/rsg/agent/soccerbotleftlowerarmcomp.rsg --- rcssserver3d-0.6.3/data/rsg/agent/soccerbotleftlowerarmcomp.rsg 2010-01-18 21:17:07.000000000 +0000 +++ rcssserver3d-0.6.4/data/rsg/agent/soccerbotleftlowerarmcomp.rsg 2010-06-08 09:38:29.000000000 +0100 @@ -44,7 +44,7 @@ - (eval $HandBox3Height / 2.0) ) - 0.04 ) ) - (nd Body + (nd RigidBody (setName boxBody) ; Lower arm mass (setBox $LowerarmMass $LowerarmLength $LowerarmWidth $LowerarmHeight) diff -Nru rcssserver3d-0.6.3/data/rsg/agent/soccerbotrightlowerarmcomp.rsg rcssserver3d-0.6.4/data/rsg/agent/soccerbotrightlowerarmcomp.rsg --- rcssserver3d-0.6.3/data/rsg/agent/soccerbotrightlowerarmcomp.rsg 2010-01-18 21:17:07.000000000 +0000 +++ rcssserver3d-0.6.4/data/rsg/agent/soccerbotrightlowerarmcomp.rsg 2010-06-08 09:38:29.000000000 +0100 @@ -44,7 +44,7 @@ - (eval $HandBox3Height / 2.0) ) - 0.04 ) ) - (nd Body + (nd RigidBody (setName boxBody) ; Lower arm mass (setBox $LowerarmMass $LowerarmLength $LowerarmWidth $LowerarmHeight) diff -Nru rcssserver3d-0.6.3/data/rsg/agent/soccerbottorsocomp.rsg rcssserver3d-0.6.4/data/rsg/agent/soccerbottorsocomp.rsg --- rcssserver3d-0.6.3/data/rsg/agent/soccerbottorsocomp.rsg 2010-01-18 21:17:07.000000000 +0000 +++ rcssserver3d-0.6.4/data/rsg/agent/soccerbottorsocomp.rsg 2010-06-08 09:38:29.000000000 +0100 @@ -14,7 +14,7 @@ (def $HeadPosY 0.05) (def $HeadPosZ (eval (eval (eval 0.5 * $upperLenZ) + 0.1) + (eval $headRadius / 2.0))) - (nd Body + (nd RigidBody (setName boxBody) ; Upper torso mass (setBox $upperMass $upperLenX $upperLenY $upperLenZ) diff -Nru rcssserver3d-0.6.3/data/rsg/agent/soccerbottorso.rsg rcssserver3d-0.6.4/data/rsg/agent/soccerbottorso.rsg --- rcssserver3d-0.6.3/data/rsg/agent/soccerbottorso.rsg 2010-01-18 21:17:07.000000000 +0000 +++ rcssserver3d-0.6.4/data/rsg/agent/soccerbottorso.rsg 2010-06-08 09:38:29.000000000 +0100 @@ -10,7 +10,7 @@ ;(setScale 1.0 1.0 1.0) ) - (nd Body + (nd RigidBody (setName boxBody) ;(setBoxTotal $totalMass $lenX $lenY $lenZ) (setBox $totalMass $lenX $lenY $lenZ) @@ -36,4 +36,4 @@ ) ) -) \ No newline at end of file +) diff -Nru rcssserver3d-0.6.3/data/scripts/rcs-materials.rb rcssserver3d-0.6.4/data/scripts/rcs-materials.rb --- rcssserver3d-0.6.3/data/scripts/rcs-materials.rb 2010-01-18 21:17:07.000000000 +0000 +++ rcssserver3d-0.6.4/data/scripts/rcs-materials.rb 2010-06-08 09:38:29.000000000 +0100 @@ -22,7 +22,6 @@ material.setDiffuse(0.1,0.6,0.1,1.0) material.setAmbient(0.1,0.3,0.1,1.0) - #---------------------------------------------------------------- # left team #---------------------------------------------------------------- diff -Nru rcssserver3d-0.6.3/data/scripts/rcs-materials-textures.rb rcssserver3d-0.6.4/data/scripts/rcs-materials-textures.rb --- rcssserver3d-0.6.3/data/scripts/rcs-materials-textures.rb 2010-01-18 21:17:07.000000000 +0000 +++ rcssserver3d-0.6.4/data/scripts/rcs-materials-textures.rb 2010-06-08 09:38:29.000000000 +0100 @@ -19,7 +19,6 @@ material.setDiffuse(1.0,0.64,0.4,1.0) material.setAmbient(0.2,0.01,0.0,1.0) - # grass # without lines diff -Nru rcssserver3d-0.6.3/debian/changelog rcssserver3d-0.6.4/debian/changelog --- rcssserver3d-0.6.3/debian/changelog 2010-06-08 19:24:17.000000000 +0100 +++ rcssserver3d-0.6.4/debian/changelog 2010-06-08 19:24:17.000000000 +0100 @@ -1,5 +1,5 @@ -rcssserver3d (0.6.3-6karmic) karmic; urgency=high +rcssserver3d (0.6.4-0karmic1) karmic; urgency=high - * Stable release + * Stable release - -- Hossein Ansari Tue, 19 Jan 2010 12:26:17 +0330 + -- Hossein Ansari Tue, 08 Jun 2010 21:06:07 +0430 diff -Nru rcssserver3d-0.6.3/debian/control rcssserver3d-0.6.4/debian/control --- rcssserver3d-0.6.3/debian/control 2010-06-08 19:24:17.000000000 +0100 +++ rcssserver3d-0.6.4/debian/control 2010-06-08 19:24:17.000000000 +0100 @@ -1,7 +1,7 @@ Source: rcssserver3d Priority: optional Maintainer: Hossein Ansari -Build-Depends: debhelper (>= 7), cmake, simspark-dev , libode-dev ( >= 3:0.11-5) , libboost-dev( >= 1.35), libboost-regex-dev( >= 1.35), libboost-thread-dev( >= 1.35), libfreetype6-dev, libsdl1.2-dev, libdevil-dev, freeglut3-dev, ruby1.8-dev, libmng-dev, libpng12-dev, libtiff4-dev +Build-Depends: debhelper (>= 7), cmake, simspark-dev ( >= 0.2.1) , libode-dev ( >= 3:0.11-5) , libboost-dev( >= 1.35), libboost-regex-dev( >= 1.35), libboost-thread-dev( >= 1.35), libfreetype6-dev, libsdl1.2-dev, libdevil-dev, freeglut3-dev, ruby1.8-dev, libmng-dev, libpng12-dev, libtiff4-dev Standards-Version: 3.8.3 Section: devel Homepage: http://robocup.allafiha.com @@ -9,7 +9,7 @@ Package: rcssserver3d-dev Section: libdevel Architecture: any -Depends: rcssserver3d (= ${binary:Version}),cmake, simspark-dev , libode-dev ( >= 3:0.11-5) , libboost-dev( >= 1.35), libboost-regex-dev( >= 1.35), libboost-thread-dev( >= 1.35), libfreetype6-dev, libsdl1.2-dev, libdevil-dev, freeglut3-dev, ruby1.8-dev, libmng-dev, libpng12-dev, libtiff4-dev +Depends: rcssserver3d (= ${binary:Version}),cmake, simspark-dev ( >= 0.2.1) , libode-dev ( >= 3:0.11-5) , libboost-dev( >= 1.35), libboost-regex-dev( >= 1.35), libboost-thread-dev( >= 1.35), libfreetype6-dev, libsdl1.2-dev, libdevil-dev, freeglut3-dev, ruby1.8-dev, libmng-dev, libpng12-dev, libtiff4-dev Description: Robocup 3D Soccer Simulation Server development files Description: Robocup 3D Soccer Simulation Server development files diff -Nru rcssserver3d-0.6.3/debian/copyright rcssserver3d-0.6.4/debian/copyright --- rcssserver3d-0.6.3/debian/copyright 2010-06-08 19:24:17.000000000 +0100 +++ rcssserver3d-0.6.4/debian/copyright 2010-06-08 19:24:17.000000000 +0100 @@ -1,22 +1,24 @@ -This package was debianized by Hossein Ansari on -Tue, 19 Jan 2010 12:26:17 +0330. +This work was packaged for Debian by: -It was downloaded from http://robocup.allafiha.com + Hossein Ansari on Tue, 08 Jun 2010 20:41:39 +0430 + +It was downloaded from http://sourceforge.net/projects/simspark Upstream Author(s): Hedayat Vatankhah - + Copyright: - Copyright (C) 2010 Hedayat Vatankhah hedayat@gmail.com + Copyright (C) 2010 Hedayat Vatankhah -The Debian packaging is: +License: + + GPL3 Copyright (C) 2010 Hossein Ansari + and is licensed under the GPL version 3, see `/usr/share/common-licenses/GPL-3'. -# Please also look if there are files or directories which have a -# different copyright/license attached and list them here. diff -Nru rcssserver3d-0.6.3/debian/docs rcssserver3d-0.6.4/debian/docs --- rcssserver3d-0.6.3/debian/docs 2010-06-08 19:24:17.000000000 +0100 +++ rcssserver3d-0.6.4/debian/docs 1970-01-01 01:00:00.000000000 +0100 @@ -1,5 +0,0 @@ -NEWS -README -README.MacOSX -README-soccer -TODO diff -Nru rcssserver3d-0.6.3/debian/rcssserver3d.dirs rcssserver3d-0.6.4/debian/rcssserver3d.dirs --- rcssserver3d-0.6.3/debian/rcssserver3d.dirs 2010-06-08 19:24:17.000000000 +0100 +++ rcssserver3d-0.6.4/debian/rcssserver3d.dirs 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -usr/lib diff -Nru rcssserver3d-0.6.3/debian/rules rcssserver3d-0.6.4/debian/rules --- rcssserver3d-0.6.3/debian/rules 2010-06-08 19:24:17.000000000 +0100 +++ rcssserver3d-0.6.4/debian/rules 2010-06-08 19:24:17.000000000 +0100 @@ -9,91 +9,5 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 - - - - - -# shared library versions, option 1 -version=2.0.5 -major=2 -# option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so -#version=`ls src/.libs/lib*.so.* | \ -# awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'` -#major=`ls src/.libs/lib*.so.* | \ -# awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'` - -builddir/Makefile: - dh_testdir - # Add here commands to configure the package. - mkdir -p builddir - cd builddir && cmake .. -DCMAKE_INSTALL_PREFIX=/usr #-DCMAKE_C_FLAGS="$(CFLAGS)" -DCMAKE_LD_FLAGS="-Wl,-z,defs" -DCMAKE_CXX_FLAGS="$(CXXFLAGS)" -DCMAKE_SKIP_RPATH=ON -DCMAKE_VERBOSE_MAKEFILE=ON - - -build: build-stamp -build-stamp: builddir/Makefile - dh_testdir - - # Add here commands to compile the package. - $(MAKE) -C builddir -j 2 - - touch $@ - -clean: - dh_testdir - dh_testroot - rm -f build-stamp - - # Add here commands to clean up after the build process. - rm -rf builddir - - - dh_clean - -install: build - dh_testdir - dh_testroot - dh_prep - dh_installdirs - dh_link /usr/bin/rcssserver3d $(CURDIR)/debian/builddir/rcssserver3d/simspark - # Add here commands to install the package into debian/tmp - $(MAKE) -C builddir DESTDIR=$(CURDIR)/debian/tmp install - - -# Build architecture-independent files here. -binary-indep: build install -# We have nothing to do by default. - -# Build architecture-dependent files here. -binary-arch: build install - dh_testdir -a - dh_testroot -a - dh_installchangelogs -a ChangeLog - dh_installdocs -a - dh_installexamples -a - dh_install -a -s --sourcedir=debian/tmp --list-missing -# dh_installmenu -# dh_installdebconf -# dh_installlogrotate -# dh_installemacsen -# dh_installpam -# dh_installmime -# dh_installinit -# dh_installcron -# dh_installinfo - dh_installman -a - dh_link -a /usr/bin/rcssserver3d $(CURDIR)/debian/tmp/usr/bin/simspark - dh_strip -a - dh_compress -a - dh_fixperms -a -# dh_perl -# dh_python - dh_makeshlibs -a - dh_installdeb -a - dh_shlibdeps -a -Lsimspark -l/usr/lib/simspark:$(CURDIR)/debian/tmp/usr/lib/rcssserver3d - dh_gencontrol -a - dh_md5sums -a - dh_builddeb -a - -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install +%: + dh $@ diff -Nru rcssserver3d-0.6.3/doc/users/definitions.tex~ rcssserver3d-0.6.4/doc/users/definitions.tex~ --- rcssserver3d-0.6.3/doc/users/definitions.tex~ 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/doc/users/definitions.tex~ 1970-01-01 01:00:00.000000000 +0100 @@ -1,143 +0,0 @@ -\documentclass[10pt,a4paper]{book} -\usepackage{a4} % 297x210 paper -\usepackage{amsmath} -\usepackage{amssymb} % Some extra symbols -\usepackage{makeidx} % If you want to generate an index, automatically -\usepackage{graphicx} % If you want to include postscript graphics -\usepackage{color} -\usepackage{multicol} -\usepackage{pifont} -\usepackage{url} -\usepackage{titlesec} -\usepackage{titletoc} -\usepackage{cite} -\usepackage{scalefnt} -\usepackage{fancyhdr} -\usepackage{wrapfig} -\usepackage{charter} -\usepackage[british]{babel} -\usepackage{lscape} -\usepackage{hyperref} -\hypersetup{ - colorlinks,% - citecolor=blue,% - filecolor=black,% - linkcolor=black,% - urlcolor=black,% - pdftex=true,% - breaklinks=true} -\usepackage{listings} -\lstset{language=bash,basicstyle=\small,breaklines=false} -\usepackage{subfigure} -\usepackage[font=small,labelfont=bf,textfont=it]{caption} -\titlespacing*{\section}{0pt}{1.5cm plus 0.2cm minus 0.2cm}{0.5cm} -\titlespacing*{\subsection}{0pt}{1.2cm plus 0.2cm minus 0.2cm}{0.5cm} -\titlespacing*{\subsubsection}{0pt}{1.0cm plus 0.2cm minus 0.2cm}{0.5cm} -\titleformat*{\section}{\usefont{T1}{pag}{db}{n}\selectfont\large} -\titleformat*{\subsection}{\usefont{T1}{pag}{db}{n}\selectfont\large} -\titleformat*{\subsubsection}{\sf\selectfont\large} - -\definecolor{Grey}{rgb}{0.40,0.60,0.80} - -\titleformat{\chapter}[display] -{\normalfont\huge\sf} -{\flushright\vspace{1cm}{\Huge\color{Grey}\thechapter\vspace{0.2cm}\hrule}} -{10pt} -{\vspace{-2.2cm}\scalefont{1.15}} - -\setlength{\footskip}{1.5cm} -% Define footer for chapter start pages -\fancypagestyle{plain}{ - \fancyhf{} - \cfoot{} - \fancyfoot[r]{\sf\bfseries\thepage} -} - -\pagestyle{fancy} - -\renewcommand{\headrulewidth}{0pt} - -% Change TOC style -\titlecontents{chapter}[0pt] - {\addvspace{1.5pc}} - {\contentsmargin{0pt} \sf \makebox[0pt][r] - {\color{Grey}\Huge\thecontentslabel\enspace} \large} - {\contentsmargin{0pt} \large} - {\bfseries\hfill\contentspage} - [\color{Grey}\hrule\addvspace{0.6pc}] - -\contentsmargin{2.0em} - -\titlecontents{section}[5em] {\contentslabel{2.3em}}{}{}{\hfill\contentspage} -\titlecontents{subsection}[9em]{\contentslabel{3em}}{}{}{\hfill\contentspage} - -\newenvironment{fancyfig} -{ - \begin{figure}[float] - \begin{center} -} -{ - {\color{Grey}\vspace{0.2cm}\hrule} - \end{center} - \end{figure} -} - -\topmargin=-0.3in -\textheight=8.93in -\oddsidemargin=0.57in -\evensidemargin=0.57in -\textwidth=5.71in -\renewcommand{\headwidth}{\textwidth} - -\makeatletter -\renewcommand{\@seccntformat}[1]{\llap{\csname the#1\endcsname\hskip1em}} - -\renewcommand{\maketitle}{\pagestyle{empty}% - \begin{titlepage}% - \vspace{5cm} - \hspace{-4.5cm}% - \includegraphics{fig/header}\hfill% - \vspace*{0.1cm} - \hspace*{-2.5cm}% - \begin{minipage}[t]{0.5\linewidth} - \textsf{\Large - \flushleft{% - \textit{Edited by:}\\% - Joschka Boedecker\\% - Klaus Dorer\\% - Markus Rollmann\\% - Yuan Xu\\% - Feng Xue\\% - Marian Buchta\\% - Hedayat Vatankhah\\% - } - } - \end{minipage} - \hspace*{6cm} - \begin{minipage}[t]{0.5\linewidth} - \textsf{\Large\flushright{Version 1.2}} - \end{minipage} - - \vspace{-4cm} - - \begin{minipage}[t]{\linewidth} - \hspace*{2.25cm} - \includegraphics[width=16cm]{fig/simsparklogo} - \end{minipage} - - \vspace*{-0.25cm} - \hspace*{-3cm}% - \begin{minipage}[b]{3cm} - \textsf{\Large\flushleft{January 2010}} - \end{minipage} - - \end{titlepage}% -} - -\makeatother -\pagestyle{fancy} -\lhead{} -\rhead{} -\cfoot{} -\rfoot{\sf\bfseries\thepage} - diff -Nru rcssserver3d-0.6.3/doc/users/robots.tex rcssserver3d-0.6.4/doc/users/robots.tex --- rcssserver3d-0.6.3/doc/users/robots.tex 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/doc/users/robots.tex 2010-06-08 09:38:29.000000000 +0100 @@ -237,11 +237,11 @@ box\_physics\_with\_handler.rsg & Not only do the job as file “box\_physics.rsg”, but also install a touchperceptorhandler under the BoxCollider Node. \\ - ccylinder\_appearance.rsg & Install a capped cylinder which is + capsule\_appearance.rsg & Install a capsule which is for the GL render. \\ - ccylinder\_physics.rsg & Install a capped cylinder that has + capsule\_physics.rsg & Install a capsule that has physics effect(ODE related) \\ - ccylinder\_physics\_nocollider.rsg & Install a capped cylinder that + capsule\_physics\_nocollider.rsg & Install a capsule that only has dynamics effect (mass, linear velocity, etc). But it can never collide to the others. \\ contactjointhandler.rsg & Install a contactjointhandler to diff -Nru rcssserver3d-0.6.3/linux/rcssserver3d.desktop rcssserver3d-0.6.4/linux/rcssserver3d.desktop --- rcssserver3d-0.6.3/linux/rcssserver3d.desktop 2010-01-18 21:17:07.000000000 +0000 +++ rcssserver3d-0.6.4/linux/rcssserver3d.desktop 2010-06-08 09:38:29.000000000 +0100 @@ -2,7 +2,7 @@ Encoding=UTF-8 Name=RoboCup Soccer Server 3D Comment=RoboCup Soccer Simulation Server 3D -Exec=simspark +Exec=rcsoccersim3d Icon=simspark Terminal=false Type=Application diff -Nru rcssserver3d-0.6.3/NEWS rcssserver3d-0.6.4/NEWS --- rcssserver3d-0.6.3/NEWS 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/NEWS 2010-06-08 09:38:29.000000000 +0100 @@ -1,3 +1,26 @@ +[0.6.4] +This release is supposed to be the final version of rcssserver3d for +RoboCup 2010 in Singapore. The release includes a referee patch contributed +by FCPortugal team which enforces some rules to avoid crowding of many players +in a small area and to penalize ill-behaved players. Additionally, this +release comes with some more facilities for a human referee to control the game +and individual players in the field. + +* New keys in rcssmonitor3d: +- n: Cycle through agents. A red marker disc shows which agent is currently + selected +- e: Clear selection +- lctrl+s: Go into specific-agent-selection-mode. A specific agent can now be + selected by pressing l or r and then a number. So the sequence 'lctrl+s, l, 4' + selects the agent with uniform number 4 of the left team +- m: Move selected agent FreeKickDist meters back +- x: Kill selected agent + +* Other changes: +- Improved referee to enforce more fair games +- Visual Studio 2010 compilation fixes +- Agents can sense field lines if enabled (currently disabled) + [0.6.3] In this release, we are preparing for a simulation with more robots than before. The current target is to have 6 vs 6 games, so we have made some changes to diff -Nru rcssserver3d-0.6.3/plugin/soccer/agentintegration/soccerbotbehavior.cpp rcssserver3d-0.6.4/plugin/soccer/agentintegration/soccerbotbehavior.cpp --- rcssserver3d-0.6.3/plugin/soccer/agentintegration/soccerbotbehavior.cpp 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/agentintegration/soccerbotbehavior.cpp 2010-06-08 09:38:29.000000000 +0100 @@ -2,7 +2,7 @@ this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2003 Koblenz University - $Id: soccerbotbehavior.cpp 9 2008-11-24 02:39:02Z hedayat $ + $Id: soccerbotbehavior.cpp 181 2010-02-28 10:55:34Z marianbuchta $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -213,7 +213,7 @@ return; } - shared_ptr predList = senselist; + boost::shared_ptr predList = senselist; if (predList.get() != 0) { diff -Nru rcssserver3d-0.6.3/plugin/soccer/agentstate/agentstate.cpp rcssserver3d-0.6.4/plugin/soccer/agentstate/agentstate.cpp --- rcssserver3d-0.6.3/plugin/soccer/agentstate/agentstate.cpp 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/agentstate/agentstate.cpp 2010-06-08 09:38:29.000000000 +0100 @@ -4,7 +4,7 @@ Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group - $Id: agentstate.cpp 21 2009-01-14 14:38:57Z yxu $ + $Id: agentstate.cpp 207 2010-06-01 13:04:58Z sgvandijk $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -23,9 +23,11 @@ #include #include #include +#include #include using namespace oxygen; +using namespace kerosin; using namespace std; AgentState::AgentState() : ObjectState(), mTeamIndex(TI_NONE), @@ -33,7 +35,8 @@ mHearMax(2), mHearInc(1), mHearDecay(2), mHearMateCap(2), mHearOppCap(2), mIfSelfMsg(false), - mIfMateMsg(false), mIfOppMsg(false) + mIfMateMsg(false), mIfOppMsg(false), + mSelected(false) { // set mID and mUniformNumber into a joint state SetUniformNumber(0); @@ -211,6 +214,18 @@ } void +AgentState::UpdateHierarchyInternal() +{ + boost::shared_ptr node = boost::shared_dynamic_cast(GetChild("SelectionMarker", true)); + if (!node) + { + GetLog()->Error() << "ERROR: (AgentState::UpdateHierarchyInternal) could not find selection marker\n"; + return; + } + node->SetVisible(mSelected); +} + +void AgentState::OnUnlink() { ObjectState::OnUnlink(); @@ -226,3 +241,20 @@ game_state->ReturnUniform(GetTeamIndex(), GetUniformNumber()); } +bool +AgentState::IsSelected() const +{ + return mSelected; +} + +void +AgentState::Select(bool s) +{ + mSelected = s; +} + +void +AgentState::UnSelect() +{ + mSelected = false; +} diff -Nru rcssserver3d-0.6.3/plugin/soccer/agentstate/agentstate.h rcssserver3d-0.6.4/plugin/soccer/agentstate/agentstate.h --- rcssserver3d-0.6.3/plugin/soccer/agentstate/agentstate.h 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/agentstate/agentstate.h 2010-06-08 09:38:29.000000000 +0100 @@ -4,7 +4,7 @@ Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group - $Id: agentstate.h 21 2009-01-14 14:38:57Z yxu $ + $Id: agentstate.h 207 2010-06-01 13:04:58Z sgvandijk $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -27,7 +27,7 @@ namespace oxygen { - class Body; + class RigidBody; } class AgentState : public ObjectState @@ -91,6 +91,10 @@ bool GetMessage(std::string& msg, float& direction, bool teamMate); bool GetSelfMessage(std::string& msg); + bool IsSelected() const; + void Select(bool s = true); + void UnSelect(); + protected: /** team index */ TTeamIndex mTeamIndex; @@ -134,7 +138,9 @@ /** is there any message from oponnent */ bool mIfOppMsg; + bool mSelected; protected: + virtual void UpdateHierarchyInternal(); virtual void OnUnlink(); }; diff -Nru rcssserver3d-0.6.3/plugin/soccer/agentstateperceptor/agentstateperceptor.cpp rcssserver3d-0.6.4/plugin/soccer/agentstateperceptor/agentstateperceptor.cpp --- rcssserver3d-0.6.3/plugin/soccer/agentstateperceptor/agentstateperceptor.cpp 2010-01-18 21:17:05.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/agentstateperceptor/agentstateperceptor.cpp 2010-06-08 09:38:29.000000000 +0100 @@ -4,7 +4,7 @@ Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2004 RoboCup Soccer Server 3D Maintenance Group - $Id: agentstateperceptor.cpp 21 2009-01-14 14:38:57Z yxu $ + $Id: agentstateperceptor.cpp 181 2010-02-28 10:55:34Z marianbuchta $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -60,7 +60,7 @@ predicate.name = "AgentState"; predicate.parameter.Clear(); - shared_ptr parent = + boost::shared_ptr parent = shared_dynamic_cast(GetParent().lock()); if (parent.get() == 0) @@ -68,7 +68,7 @@ GetLog()->Warning() << "WARNING: (AgentStatePerceptor) " << "parent node is not derived from BaseNode\n"; } else { - shared_ptr rvp = + boost::shared_ptr rvp = parent->FindChildSupportingClass(false); if (rvp.get() == 0) { diff -Nru rcssserver3d-0.6.3/plugin/soccer/ball/ball.cpp rcssserver3d-0.6.4/plugin/soccer/ball/ball.cpp --- rcssserver3d-0.6.3/plugin/soccer/ball/ball.cpp 2010-01-18 21:17:05.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/ball/ball.cpp 2010-06-08 09:38:29.000000000 +0100 @@ -4,7 +4,7 @@ Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2004 RoboCup Soccer Server 3D Maintenance Group - $Id: ball.cpp 21 2009-01-14 14:38:57Z yxu $ + $Id: ball.cpp 176 2010-02-25 12:19:37Z a-held $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -46,7 +46,7 @@ if (mBody.get() == 0) { - mBody = shared_dynamic_cast(GetChildOfClass("Body")); + mBody = shared_dynamic_cast(GetChildOfClass("RigidBody")); } } diff -Nru rcssserver3d-0.6.3/plugin/soccer/ball/ball.h rcssserver3d-0.6.4/plugin/soccer/ball/ball.h --- rcssserver3d-0.6.3/plugin/soccer/ball/ball.h 2010-01-18 21:17:05.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/ball/ball.h 2010-06-08 09:38:29.000000000 +0100 @@ -4,7 +4,7 @@ Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group - $Id: ball.h 9 2008-11-24 02:39:02Z hedayat $ + $Id: ball.h 176 2010-02-25 12:19:37Z a-held $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -23,7 +23,7 @@ #define BALL_H #include -#include +#include #include class BallStateAspect; @@ -65,7 +65,7 @@ salt::Vector3f mForce; salt::Vector3f mTorque; - boost::shared_ptr mBody; + boost::shared_ptr mBody; boost::shared_ptr mKickedLast; boost::shared_ptr mBallStateAspect; }; diff -Nru rcssserver3d-0.6.3/plugin/soccer/ballstateaspect/ballstateaspect.cpp rcssserver3d-0.6.4/plugin/soccer/ballstateaspect/ballstateaspect.cpp --- rcssserver3d-0.6.3/plugin/soccer/ballstateaspect/ballstateaspect.cpp 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/ballstateaspect/ballstateaspect.cpp 2010-06-08 09:38:29.000000000 +0100 @@ -4,7 +4,7 @@ Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group - $Id: ballstateaspect.cpp 68 2009-06-15 15:08:14Z sgvandijk $ + $Id: ballstateaspect.cpp 181 2010-02-28 10:55:34Z marianbuchta $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -46,7 +46,7 @@ { } -bool BallStateAspect::GetLastCollidingAgent(shared_ptr& agent, +bool BallStateAspect::GetLastCollidingAgent(boost::shared_ptr& agent, TTime& time) { agent = mLastCollidingAgent; @@ -55,7 +55,7 @@ return (agent.get() != 0); } -bool BallStateAspect::GetLastKickingAgent(shared_ptr& agent, +bool BallStateAspect::GetLastKickingAgent(boost::shared_ptr& agent, TTime& time) { agent = mLastKickingAgent; diff -Nru rcssserver3d-0.6.3/plugin/soccer/beameffector/beameffector.cpp rcssserver3d-0.6.4/plugin/soccer/beameffector/beameffector.cpp --- rcssserver3d-0.6.3/plugin/soccer/beameffector/beameffector.cpp 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/beameffector/beameffector.cpp 2010-06-08 09:38:29.000000000 +0100 @@ -4,7 +4,7 @@ Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group - $Id: beameffector.cpp 21 2009-01-14 14:38:57Z yxu $ + $Id: beameffector.cpp 181 2010-02-28 10:55:34Z marianbuchta $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -60,7 +60,7 @@ return; } - shared_ptr beamAction = + boost::shared_ptr beamAction = shared_dynamic_cast(mAction); mAction.reset(); @@ -110,7 +110,7 @@ // on the team pos = SoccerBase::FlipView(pos, mAgentState->GetTeamIndex()); - shared_ptr agentAspect; + boost::shared_ptr agentAspect; SoccerBase::GetTransformParent(*this, agentAspect); if (agentAspect.get() == 0) { @@ -127,14 +127,14 @@ } } -shared_ptr +boost::shared_ptr BeamEffector::GetActionObject(const Predicate& predicate) { if (predicate.name != GetPredicate()) { GetLog()->Error() << "ERROR: (BeamEffector) invalid predicate" << predicate.name << "\n"; - return shared_ptr(); + return boost::shared_ptr(); } Predicate::Iterator iter = predicate.begin(); @@ -144,7 +144,7 @@ { GetLog()->Error() << "ERROR: (BeamEffector) float expected for parameter1\n"; - return shared_ptr(new ActionObject(GetPredicate())); + return boost::shared_ptr(new ActionObject(GetPredicate())); } float posY; @@ -152,7 +152,7 @@ { GetLog()->Error() << "ERROR: (BeamEffector) float expected for parameter2\n"; - return shared_ptr(new ActionObject(GetPredicate())); + return boost::shared_ptr(new ActionObject(GetPredicate())); } float angle; @@ -160,10 +160,10 @@ { GetLog()->Error() << "ERROR: (BeamEffector) float expected for parameter3\n"; - return shared_ptr(new ActionObject(GetPredicate())); + return boost::shared_ptr(new ActionObject(GetPredicate())); } - return shared_ptr(new BeamAction(GetPredicate(), posX, posY, angle)); + return boost::shared_ptr(new BeamAction(GetPredicate(), posX, posY, angle)); } void diff -Nru rcssserver3d-0.6.3/plugin/soccer/beameffector/beameffector.h rcssserver3d-0.6.4/plugin/soccer/beameffector/beameffector.h --- rcssserver3d-0.6.3/plugin/soccer/beameffector/beameffector.h 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/beameffector/beameffector.h 2010-06-08 09:38:29.000000000 +0100 @@ -4,7 +4,7 @@ Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group - $Id: beameffector.h 21 2009-01-14 14:38:57Z yxu $ + $Id: beameffector.h 176 2010-02-25 12:19:37Z a-held $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -23,7 +23,7 @@ #define BEAMEFFECTOR_H #include -#include +#include #include class BeamEffector : public oxygen::Effector @@ -51,7 +51,7 @@ protected: /** the reference to the parents body node */ - boost::shared_ptr mBody; + boost::shared_ptr mBody; /** the reference to the GameState */ boost::shared_ptr mGameState; diff -Nru rcssserver3d-0.6.3/plugin/soccer/catcheffector/catcheffector.cpp rcssserver3d-0.6.4/plugin/soccer/catcheffector/catcheffector.cpp --- rcssserver3d-0.6.3/plugin/soccer/catcheffector/catcheffector.cpp 2010-01-18 21:17:05.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/catcheffector/catcheffector.cpp 2010-06-08 09:38:29.000000000 +0100 @@ -82,7 +82,7 @@ return; } - shared_ptr catchAction = + boost::shared_ptr catchAction = shared_dynamic_cast(mAction); mAction.reset(); if (catchAction.get() == 0) @@ -148,7 +148,7 @@ MoveBall(ballPos); } -shared_ptr +boost::shared_ptr CatchEffector::GetActionObject(const Predicate& predicate) { do @@ -161,12 +161,12 @@ } // construct the CatchAction object - return shared_ptr(new CatchAction(GetPredicate())); + return boost::shared_ptr(new CatchAction(GetPredicate())); } while (0); // some error happened - return shared_ptr(); + return boost::shared_ptr(); } void @@ -187,7 +187,7 @@ return; } - shared_ptr geom = + boost::shared_ptr geom = shared_dynamic_cast(mAgent->GetChild("geometry")); if (geom.get() == 0) { diff -Nru rcssserver3d-0.6.3/plugin/soccer/catcheffector/catcheffector.h rcssserver3d-0.6.4/plugin/soccer/catcheffector/catcheffector.h --- rcssserver3d-0.6.3/plugin/soccer/catcheffector/catcheffector.h 2010-01-18 21:17:05.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/catcheffector/catcheffector.h 2010-06-08 09:38:29.000000000 +0100 @@ -22,7 +22,7 @@ #define CATCHEFFECTOR_H #include -#include +#include #include #include @@ -33,7 +33,7 @@ namespace oxygen { - class Body; + class RigidBody; class AgentAspect; } @@ -74,7 +74,7 @@ protected: /** reference to the body node of the ball */ - boost::shared_ptr mBallBody; + boost::shared_ptr mBallBody; /** reference to the agent aspect */ boost::shared_ptr mAgent; /** reference to the agentstate */ diff -Nru rcssserver3d-0.6.3/plugin/soccer/CMakeLists.txt rcssserver3d-0.6.4/plugin/soccer/CMakeLists.txt --- rcssserver3d-0.6.3/plugin/soccer/CMakeLists.txt 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/CMakeLists.txt 2010-06-08 09:38:29.000000000 +0100 @@ -44,7 +44,8 @@ hmdp_effector/hmdpaction.h hmdp_effector/hmdpeffector.h hmdp_effector/hmdpperceptor.h - hmdp_effector/naospecific.h + hmdp_effector/naospecific.h + line/line.h ) set(soccer_LIB_SRCS @@ -117,6 +118,8 @@ hmdp_effector/hmdpperceptor.cpp hmdp_effector/hmdpwrapper.cpp hmdp_effector/naospecific.cpp + line/line.cpp + line/line_c.cpp ) include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${FREETYPE_INCLUDE_DIRS} diff -Nru rcssserver3d-0.6.3/plugin/soccer/createeffector/createeffector.cpp rcssserver3d-0.6.4/plugin/soccer/createeffector/createeffector.cpp --- rcssserver3d-0.6.3/plugin/soccer/createeffector/createeffector.cpp 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/createeffector/createeffector.cpp 2010-06-08 09:38:29.000000000 +0100 @@ -4,7 +4,7 @@ Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group - $Id: createeffector.cpp 9 2008-11-24 02:39:02Z hedayat $ + $Id: createeffector.cpp 181 2010-02-28 10:55:34Z marianbuchta $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -41,7 +41,7 @@ if ( mAction.get() == 0 ) return; - shared_ptr createAction = + boost::shared_ptr createAction = shared_dynamic_cast(mAction); mAction.reset(); if (createAction.get() == 0) @@ -51,7 +51,7 @@ return; } - shared_ptr aspect = GetAgentAspect(); + boost::shared_ptr aspect = GetAgentAspect(); if (aspect.get() == 0) { GetLog()->Error() @@ -68,14 +68,14 @@ } -shared_ptr +boost::shared_ptr CreateEffector::GetActionObject(const Predicate& predicate) { if (predicate.name != GetPredicate()) { GetLog()->Error() << "ERROR: (CreateEffector) invalid predicate" << predicate.name << "\n"; - return shared_ptr(); + return boost::shared_ptr(); } // @@ -83,6 +83,6 @@ // type should be passed later on and stored in the CreateAction object // - return shared_ptr(new CreateAction(GetPredicate())); + return boost::shared_ptr(new CreateAction(GetPredicate())); } diff -Nru rcssserver3d-0.6.3/plugin/soccer/driveeffector/driveeffector.cpp rcssserver3d-0.6.4/plugin/soccer/driveeffector/driveeffector.cpp --- rcssserver3d-0.6.3/plugin/soccer/driveeffector/driveeffector.cpp 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/driveeffector/driveeffector.cpp 2010-06-08 09:38:29.000000000 +0100 @@ -4,7 +4,7 @@ Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group - $Id: driveeffector.cpp 21 2009-01-14 14:38:57Z yxu $ + $Id: driveeffector.cpp 181 2010-02-28 10:55:34Z marianbuchta $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -49,7 +49,7 @@ return false; } - shared_ptr parent = + boost::shared_ptr parent = shared_dynamic_cast(GetParent().lock()); if (parent.get() == 0) @@ -59,7 +59,7 @@ return false; } - shared_ptr driveAction = shared_dynamic_cast(action); + boost::shared_ptr driveAction = shared_dynamic_cast(action); if (driveAction.get() == 0) { @@ -88,14 +88,14 @@ return true; } -shared_ptr +boost::shared_ptr DriveEffector::GetActionObject(const Predicate& predicate) { if (predicate.name != GetPredicate()) { GetLog()->Error() << "ERROR: (DriveEffector) invalid predicate" << predicate.name << "\n"; - return shared_ptr(); + return boost::shared_ptr(); } Vector3f force; @@ -103,10 +103,10 @@ { GetLog()->Error() << "ERROR: (DriveEffector) Vector3f parameter expected\n"; - return shared_ptr(new ActionObject(GetPredicate())); + return boost::shared_ptr(new ActionObject(GetPredicate())); } - return shared_ptr(new DriveAction(GetPredicate(),force)); + return boost::shared_ptr(new DriveAction(GetPredicate(),force)); } void @@ -116,7 +116,7 @@ SoccerBase::GetBody(*this,mBody); SoccerBase::GetAgentState(*this,mAgentState); - shared_ptr geom = + boost::shared_ptr geom = shared_dynamic_cast(mTransformParent->GetChild("geometry")); mMaxDistance = 0.001; diff -Nru rcssserver3d-0.6.3/plugin/soccer/driveeffector/driveeffector.h rcssserver3d-0.6.4/plugin/soccer/driveeffector/driveeffector.h --- rcssserver3d-0.6.3/plugin/soccer/driveeffector/driveeffector.h 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/driveeffector/driveeffector.h 2010-06-08 09:38:29.000000000 +0100 @@ -4,7 +4,7 @@ Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group - $Id: driveeffector.h 21 2009-01-14 14:38:57Z yxu $ + $Id: driveeffector.h 176 2010-02-25 12:19:37Z a-held $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -24,7 +24,7 @@ #include #include -#include +#include #include class DriveEffector : public oxygen::Effector @@ -84,7 +84,7 @@ /** the reference to the parent transform node */ boost::shared_ptr mTransformParent; /** the reference to the parents body node */ - boost::shared_ptr mBody; + boost::shared_ptr mBody; //! a reference to the agent state boost::shared_ptr mAgentState; diff -Nru rcssserver3d-0.6.3/plugin/soccer/export.cpp rcssserver3d-0.6.4/plugin/soccer/export.cpp --- rcssserver3d-0.6.3/plugin/soccer/export.cpp 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/export.cpp 2010-06-08 09:38:29.000000000 +0100 @@ -4,7 +4,7 @@ Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group - $Id: export.cpp 82 2009-07-31 20:40:14Z hedayat $ + $Id: export.cpp 190 2010-03-30 11:33:03Z yxu $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -53,6 +53,7 @@ #include "agentintegration/soccerbotbehavior.h" #include "hmdp_effector/hmdpeffector.h" #include "hmdp_effector/hmdpperceptor.h" +#include "line/line.h" ZEITGEIST_EXPORT_BEGIN() ZEITGEIST_EXPORT(SoccerControlAspect); @@ -88,5 +89,6 @@ ZEITGEIST_EXPORT(SoccerbotBehavior); ZEITGEIST_EXPORT(HMDPPerceptor); ZEITGEIST_EXPORT(HMDPEffector); + ZEITGEIST_EXPORT(Line); ZEITGEIST_EXPORT_END() diff -Nru rcssserver3d-0.6.3/plugin/soccer/gamestateaspect/gamestateaspect.cpp rcssserver3d-0.6.4/plugin/soccer/gamestateaspect/gamestateaspect.cpp --- rcssserver3d-0.6.3/plugin/soccer/gamestateaspect/gamestateaspect.cpp 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/gamestateaspect/gamestateaspect.cpp 2010-06-08 09:38:29.000000000 +0100 @@ -4,7 +4,7 @@ Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group - $Id: gamestateaspect.cpp 21 2009-01-14 14:38:57Z yxu $ + $Id: gamestateaspect.cpp 181 2010-02-28 10:55:34Z marianbuchta $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -307,7 +307,7 @@ } bool -GameStateAspect::RequestUniform(shared_ptr agentState, +GameStateAspect::RequestUniform(boost::shared_ptr agentState, std::string teamName, unsigned int unum) { if (agentState.get() == 0) diff -Nru rcssserver3d-0.6.3/plugin/soccer/gamestateaspect/gamestateitem.cpp rcssserver3d-0.6.4/plugin/soccer/gamestateaspect/gamestateitem.cpp --- rcssserver3d-0.6.3/plugin/soccer/gamestateaspect/gamestateitem.cpp 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/gamestateaspect/gamestateitem.cpp 2010-06-08 09:38:29.000000000 +0100 @@ -4,7 +4,7 @@ Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group - $Id: gamestateitem.cpp 21 2009-01-14 14:38:57Z yxu $ + $Id: gamestateitem.cpp 210 2010-06-06 08:55:20Z hedayat $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -97,6 +97,8 @@ pred.parameter.AddValue (SoccerBase::PlayMode2Str(static_cast(i))); } + + GetPredicates(pList); } void GameStateItem::GetPredicates(PredicateList& pList) diff -Nru rcssserver3d-0.6.3/plugin/soccer/hmdp_effector/hmdpeffector.cpp rcssserver3d-0.6.4/plugin/soccer/hmdp_effector/hmdpeffector.cpp --- rcssserver3d-0.6.3/plugin/soccer/hmdp_effector/hmdpeffector.cpp 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/hmdp_effector/hmdpeffector.cpp 2010-06-08 09:38:29.000000000 +0100 @@ -85,7 +85,7 @@ return; } - shared_ptr hMDPAction = shared_dynamic_cast(mAction); + boost::shared_ptr hMDPAction = shared_dynamic_cast(mAction); mAction.reset(); if (hMDPAction.get() == 0) { @@ -96,14 +96,14 @@ } -shared_ptr HMDPEffector::GetActionObject(const Predicate& predicate) +boost::shared_ptr HMDPEffector::GetActionObject(const Predicate& predicate) { //std::cout << " GetActionObject called " << std::endl; if (predicate.name != GetPredicate()) { GetLog()->Error() << "ERROR: (HMDPEffector) invalid predicate" << predicate.name << "\n"; - return shared_ptr(); + return boost::shared_ptr(); } std::string message; @@ -112,13 +112,13 @@ { GetLog()->Error() << "ERROR: (HMDPEffector) Some Problem while receiving the HMDP Message\n"; - return shared_ptr(); + return boost::shared_ptr(); }; inMessage = inMessage + message + "\r\n"; //std::cout << inMessage << std::endl; - return shared_ptr(new HMDPAction(GetPredicate(), inMessage)); + return boost::shared_ptr(new HMDPAction(GetPredicate(), inMessage)); } void HMDPEffector::OnLink() @@ -130,7 +130,7 @@ ifActive = true; iter = 0; // just to do the right things on iter = 0 in pre physics routine - shared_ptr parent = GetParent().lock(); + boost::shared_ptr parent = GetParent().lock(); if (parent.get() == 0) { @@ -141,7 +141,7 @@ // parent should be a transform, or some other node, which has a // Body-child - mBody = shared_dynamic_cast(parent->GetChildOfClass("Body")); + mBody = shared_dynamic_cast(parent->GetChildOfClass("RigidBody")); if (mBody.get() == 0) { @@ -196,8 +196,8 @@ void HMDPEffector::ReadOutJointList() { - shared_ptr parent = GetParent().lock(); - shared_ptr grandparent = parent->GetParent().lock(); + boost::shared_ptr parent = GetParent().lock(); + boost::shared_ptr grandparent = parent->GetParent().lock(); grandparent->ListChildrenSupportingClass(jointList, true); @@ -214,8 +214,8 @@ servo_gain[i] = 0.05; servo_angle[i] = 0; - shared_ptr join = *j_it; - shared_ptr jparent = + boost::shared_ptr join = *j_it; + boost::shared_ptr jparent = shared_dynamic_cast(join->GetParent().lock()); std::cout << i << " " << jparent->GetName() << std::endl; i++; @@ -259,16 +259,16 @@ for (TLeafList::iterator j_it = jointList.begin(); j_it != jointList.end(); j_it++) { - shared_ptr joint = shared_static_cast (*j_it); + boost::shared_ptr joint = shared_static_cast (*j_it); servo_angle[i] = joint->GetAngle() - zeroPosServo(i); double tpos = servo_target_pos[i]; float err = servo_gain[i] * (tpos - servo_angle[i]); - joint->SetParameter(dParamVel, err); + joint->SetParameter(2 /*dParamVel*/, err); if (abs(err) > 0.00001) { - shared_ptr body = joint->GetBody(Joint::BI_FIRST); + boost::shared_ptr body = joint->GetBody(Joint::BI_FIRST); if (body && !body->IsEnabled()) { body->Enable(); diff -Nru rcssserver3d-0.6.3/plugin/soccer/hmdp_effector/hmdpeffector.h rcssserver3d-0.6.4/plugin/soccer/hmdp_effector/hmdpeffector.h --- rcssserver3d-0.6.3/plugin/soccer/hmdp_effector/hmdpeffector.h 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/hmdp_effector/hmdpeffector.h 2010-06-08 09:38:29.000000000 +0100 @@ -23,7 +23,7 @@ #define HMDPEFFECTOR_H #include -#include +#include #include "naospecific.h" //! make it possible to have a pointer to the perceptor @@ -112,7 +112,7 @@ protected: /** the reference to the parents body node */ - boost::shared_ptr mBody; + boost::shared_ptr mBody; }; DECLARE_CLASS(HMDPEffector) diff -Nru rcssserver3d-0.6.3/plugin/soccer/hmdp_effector/hmdpperceptor.cpp rcssserver3d-0.6.4/plugin/soccer/hmdp_effector/hmdpperceptor.cpp --- rcssserver3d-0.6.3/plugin/soccer/hmdp_effector/hmdpperceptor.cpp 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/hmdp_effector/hmdpperceptor.cpp 2010-06-08 09:38:29.000000000 +0100 @@ -23,7 +23,7 @@ #include "hmdpperceptor.h" #include #include -#include +#include #include using namespace oxygen; @@ -48,10 +48,10 @@ { messageOut = ""; - shared_ptr transformParent = shared_static_cast ( + boost::shared_ptr transformParent = shared_static_cast ( FindParentSupportingClass ().lock()); - mBody = shared_static_cast (transformParent->GetChildOfClass("Body")); + mBody = shared_static_cast (transformParent->GetChildOfClass("RigidBody")); } void HMDPPerceptor::OnUnlink() diff -Nru rcssserver3d-0.6.3/plugin/soccer/hmdp_effector/hmdpperceptor.h rcssserver3d-0.6.4/plugin/soccer/hmdp_effector/hmdpperceptor.h --- rcssserver3d-0.6.3/plugin/soccer/hmdp_effector/hmdpperceptor.h 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/hmdp_effector/hmdpperceptor.h 2010-06-08 09:38:29.000000000 +0100 @@ -24,7 +24,7 @@ #define HMDPPERCEPTOR_H #include -#include +#include class HMDPPerceptor: public oxygen::Perceptor { @@ -45,7 +45,7 @@ private: //! reference to the body of which the perceptor is measuring the angle change rate - boost::shared_ptr mBody; + boost::shared_ptr mBody; }; DECLARE_CLASS(HMDPPerceptor) diff -Nru rcssserver3d-0.6.3/plugin/soccer/initeffector/initeffector.cpp rcssserver3d-0.6.4/plugin/soccer/initeffector/initeffector.cpp --- rcssserver3d-0.6.3/plugin/soccer/initeffector/initeffector.cpp 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/initeffector/initeffector.cpp 2010-06-08 09:38:29.000000000 +0100 @@ -4,7 +4,7 @@ Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2004 RoboCup Soccer Server 3D Maintenance Group - $Id: initeffector.cpp 21 2009-01-14 14:38:57Z yxu $ + $Id: initeffector.cpp 181 2010-02-28 10:55:34Z marianbuchta $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include @@ -54,7 +54,7 @@ return; } - shared_ptr initAction = + boost::shared_ptr initAction = shared_dynamic_cast(mAction); mAction.reset(); @@ -66,7 +66,7 @@ } // search for the AgentState - shared_ptr state = shared_static_cast + boost::shared_ptr state = shared_static_cast (mAgentAspect->GetChildOfClass("AgentState", true)); if (state.get() == 0) @@ -95,7 +95,7 @@ // agents may be encapsulated in their own collision spaces, so we need // to get the parent of the parent of the agent aspect in this case - shared_ptr parent = shared_dynamic_cast + boost::shared_ptr parent = shared_dynamic_cast (mAgentAspect->GetParentSupportingClass("Transform").lock()); @@ -132,7 +132,7 @@ ++iter ) { - shared_ptr childBody = + boost::shared_ptr childBody = shared_dynamic_cast(*iter); Vector3f childPos = childBody->GetPosition(); @@ -148,14 +148,14 @@ #endif } -shared_ptr +boost::shared_ptr InitEffector::GetActionObject(const Predicate& predicate) { if (predicate.name != GetPredicate()) { GetLog()->Error() << "ERROR: (InitEffector) invalid predicate" << predicate.name << "\n"; - return shared_ptr(); + return boost::shared_ptr(); } std::string name; @@ -164,7 +164,7 @@ int unum = 0; predicate.GetValue(predicate.begin(),"unum",unum); - return shared_ptr(new InitAction(GetPredicate(),name,unum)); + return boost::shared_ptr(new InitAction(GetPredicate(),name,unum)); } void InitEffector::OnLink() diff -Nru rcssserver3d-0.6.3/plugin/soccer/initeffector/singlematiniteffector.cpp rcssserver3d-0.6.4/plugin/soccer/initeffector/singlematiniteffector.cpp --- rcssserver3d-0.6.3/plugin/soccer/initeffector/singlematiniteffector.cpp 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/initeffector/singlematiniteffector.cpp 2010-06-08 09:38:29.000000000 +0100 @@ -4,7 +4,7 @@ Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2004 RoboCup Soccer Server 3D Maintenance Group - $Id: singlematiniteffector.cpp 21 2009-01-14 14:38:57Z yxu $ + $Id: singlematiniteffector.cpp 181 2010-02-28 10:55:34Z marianbuchta $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -68,7 +68,7 @@ jersey.push_back("lowerTorso"); // search for the AgentState - shared_ptr state = shared_static_cast + boost::shared_ptr state = shared_static_cast (mAgentAspect->GetChildOfClass("AgentState",true)); if (state.get() == 0) @@ -102,7 +102,7 @@ // get parent of the agent aspect - shared_ptr parent = shared_dynamic_cast + boost::shared_ptr parent = shared_dynamic_cast (mAgentAspect->GetParent().lock()); if (parent.get() == 0) @@ -113,13 +113,13 @@ return; } - shared_ptr matNode; + boost::shared_ptr matNode; std::vector::const_iterator it; for (it = jersey.begin(); it != jersey.end(); ++it) { - shared_ptr child = parent->GetChild((*it),true); + boost::shared_ptr child = parent->GetChild((*it),true); if (child.get() != 0) { @@ -146,7 +146,7 @@ } // set the scene modified, the monitor will update - shared_ptr sceneServer = + boost::shared_ptr sceneServer = shared_dynamic_cast(GetCore()->Get("/sys/server/scene")); if (sceneServer.get() ==0) @@ -156,7 +156,7 @@ return; } - shared_ptr scene = sceneServer->GetActiveScene(); + boost::shared_ptr scene = sceneServer->GetActiveScene(); if (scene.get() == 0) { GetLog()->Error() diff -Nru rcssserver3d-0.6.3/plugin/soccer/initeffector/staticmeshiniteffector.cpp rcssserver3d-0.6.4/plugin/soccer/initeffector/staticmeshiniteffector.cpp --- rcssserver3d-0.6.3/plugin/soccer/initeffector/staticmeshiniteffector.cpp 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/initeffector/staticmeshiniteffector.cpp 2010-06-08 09:38:29.000000000 +0100 @@ -3,7 +3,7 @@ this file is part of rcssserver3D Copyright (C) 2002,2003 Koblenz University Copyright (C) 2004-2008 RoboCup Soccer Server 3D Maintenance Group - $Id: staticmeshiniteffector.cpp 21 2009-01-14 14:38:57Z yxu $ + $Id: staticmeshiniteffector.cpp 181 2010-02-28 10:55:34Z marianbuchta $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -58,7 +58,7 @@ InitEffector::PrePhysicsUpdateInternal(deltaTime); // search for the AgentState - shared_ptr state = shared_static_cast + boost::shared_ptr state = shared_static_cast (mAgentAspect->GetChildOfClass("AgentState",true)); if (state.get() == 0) @@ -86,7 +86,7 @@ string unumMat = "matNum" + lexical_cast(unum); // get parent of the agent aspect - shared_ptr parent = shared_dynamic_cast + boost::shared_ptr parent = shared_dynamic_cast (mAgentAspect->GetParent().lock()); if (parent.get() == 0) @@ -107,13 +107,13 @@ ++iter ) { - shared_ptr m = shared_static_cast(*iter); + boost::shared_ptr m = shared_static_cast(*iter); m->ChangeMaterial("matTeam",teamMat); m->ChangeMaterial("matNum",unumMat); } // set the scene modified, the monitor will update - shared_ptr sceneServer = + boost::shared_ptr sceneServer = shared_dynamic_cast(GetCore()->Get("/sys/server/scene")); if (sceneServer.get() ==0) @@ -123,7 +123,7 @@ return; } - shared_ptr scene = sceneServer->GetActiveScene(); + boost::shared_ptr scene = sceneServer->GetActiveScene(); if (scene.get() == 0) { GetLog()->Error() diff -Nru rcssserver3d-0.6.3/plugin/soccer/internalsoccermonitor/internalsoccerinput.cpp rcssserver3d-0.6.4/plugin/soccer/internalsoccermonitor/internalsoccerinput.cpp --- rcssserver3d-0.6.3/plugin/soccer/internalsoccermonitor/internalsoccerinput.cpp 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/internalsoccermonitor/internalsoccerinput.cpp 2010-06-08 09:38:29.000000000 +0100 @@ -2,7 +2,7 @@ this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2003 Koblenz University - $Id: internalsoccerinput.cpp 21 2009-01-14 14:38:57Z yxu $ + $Id: internalsoccerinput.cpp 181 2010-02-28 10:55:34Z marianbuchta $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include @@ -44,7 +44,7 @@ void InternalSoccerInput::OnLink() { - shared_ptr scriptServer = GetCore()->GetScriptServer(); + boost::shared_ptr scriptServer = GetCore()->GetScriptServer(); scriptServer->CreateVariable("Command.KickOff", CmdKickOff); scriptServer->CreateVariable("Command.KillAgentLeft", CmdKillAgentLeft); scriptServer->CreateVariable("Command.KillAgentRight", CmdKillAgentRight); @@ -93,7 +93,7 @@ } // get camera body - mCameraBody = shared_dynamic_cast + mCameraBody = shared_dynamic_cast (GetCore()->Get("/usr/scene/camera/physics")); if (mCameraBody.get() == 0) @@ -270,7 +270,7 @@ ) { // search for the first agent of the left/right side - shared_ptr agentState = + boost::shared_ptr agentState = shared_dynamic_cast((*iter)->GetChild("AgentState", true)); if (agentState.get() == 0) @@ -305,7 +305,7 @@ ) { // search for the first agent of the left/right side - shared_ptr agentState = + boost::shared_ptr agentState = shared_dynamic_cast((*iter)->GetChild("AgentState", true)); if (agentState.get() == 0) diff -Nru rcssserver3d-0.6.3/plugin/soccer/internalsoccermonitor/internalsoccerinput.h rcssserver3d-0.6.4/plugin/soccer/internalsoccermonitor/internalsoccerinput.h --- rcssserver3d-0.6.3/plugin/soccer/internalsoccermonitor/internalsoccerinput.h 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/internalsoccermonitor/internalsoccerinput.h 2010-06-08 09:38:29.000000000 +0100 @@ -2,7 +2,7 @@ this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2003 Koblenz University - $Id: internalsoccerinput.h 21 2009-01-14 14:38:57Z yxu $ + $Id: internalsoccerinput.h 176 2010-02-25 12:19:37Z a-held $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -28,7 +28,7 @@ namespace oxygen { class FPSController; - class Body; + class RigidBody; class GameControlServer; } @@ -88,7 +88,7 @@ boost::shared_ptr mSoccerRule; /** cached reference to the camera body */ - boost::shared_ptr mCameraBody; + boost::shared_ptr mCameraBody; /** cached reference to the camera body */ boost::shared_ptr mFPS; diff -Nru rcssserver3d-0.6.3/plugin/soccer/internalsoccermonitor/internalsoccerrender.cpp rcssserver3d-0.6.4/plugin/soccer/internalsoccermonitor/internalsoccerrender.cpp --- rcssserver3d-0.6.3/plugin/soccer/internalsoccermonitor/internalsoccerrender.cpp 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/internalsoccermonitor/internalsoccerrender.cpp 2010-06-08 09:38:29.000000000 +0100 @@ -199,7 +199,7 @@ #if 0 // get texture -- has to be square and power of 2 in size!!! - shared_ptr tex = shared_static_cast + boost::shared_ptr tex = shared_static_cast (mTextureServer->GetTexture("test.tga")); glEnable2D(); diff -Nru rcssserver3d-0.6.3/plugin/soccer/kickeffector/kickeffector.cpp rcssserver3d-0.6.4/plugin/soccer/kickeffector/kickeffector.cpp --- rcssserver3d-0.6.3/plugin/soccer/kickeffector/kickeffector.cpp 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/kickeffector/kickeffector.cpp 2010-06-08 09:38:29.000000000 +0100 @@ -4,7 +4,7 @@ Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group - $Id: kickeffector.cpp 21 2009-01-14 14:38:57Z yxu $ + $Id: kickeffector.cpp 181 2010-02-28 10:55:34Z marianbuchta $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -63,7 +63,7 @@ return; } - shared_ptr kickAction = + boost::shared_ptr kickAction = shared_dynamic_cast(mAction); mAction.reset(); @@ -136,7 +136,7 @@ } -shared_ptr +boost::shared_ptr KickEffector::GetActionObject(const Predicate& predicate) { do @@ -167,12 +167,12 @@ } // construct the KickAction object - return shared_ptr(new KickAction(GetPredicate(),angle,power)); + return boost::shared_ptr(new KickAction(GetPredicate(),angle,power)); } while (0); // some error happened - return shared_ptr(); + return boost::shared_ptr(); } void @@ -190,7 +190,7 @@ return; } - shared_ptr geom = + boost::shared_ptr geom = shared_dynamic_cast(mAgent->GetChild("geometry")); if (geom.get() == 0) { diff -Nru rcssserver3d-0.6.3/plugin/soccer/kickeffector/kickeffector.h rcssserver3d-0.6.4/plugin/soccer/kickeffector/kickeffector.h --- rcssserver3d-0.6.3/plugin/soccer/kickeffector/kickeffector.h 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/kickeffector/kickeffector.h 2010-06-08 09:38:29.000000000 +0100 @@ -4,7 +4,7 @@ Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group - $Id: kickeffector.h 21 2009-01-14 14:38:57Z yxu $ + $Id: kickeffector.h 176 2010-02-25 12:19:37Z a-held $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include @@ -104,7 +104,7 @@ typedef boost::shared_ptr > NormalRngPtr; /** reference to the body node of the ball */ - boost::shared_ptr mBallBody; + boost::shared_ptr mBallBody; /** reference to the body node of the ball */ boost::shared_ptr mBall; /** reference to the agent aspect */ diff -Nru rcssserver3d-0.6.3/plugin/soccer/line/line_c.cpp rcssserver3d-0.6.4/plugin/soccer/line/line_c.cpp --- rcssserver3d-0.6.3/plugin/soccer/line/line_c.cpp 1970-01-01 01:00:00.000000000 +0100 +++ rcssserver3d-0.6.4/plugin/soccer/line/line_c.cpp 2010-06-08 09:38:29.000000000 +0100 @@ -0,0 +1,65 @@ +/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- + + this file is part of rcssserver3D + Copyright (C) 2010 RoboCup Soccer Server 3D Maintenance Group + $Id$ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "line.h" + +using namespace boost; +using namespace oxygen; +using namespace std; + +FUNCTION(Line,setBeginPoint) +{ + salt::Vector3f& value = obj->BeginPoint(); + + if ( + (in.GetSize() != 3) || + (! in.GetValue(in[0], value[0])) || + (! in.GetValue(in[1], value[1])) || + (! in.GetValue(in[2], value[2])) + ) + { + return false; + } + return true; +} + +FUNCTION(Line,setEndPoint) +{ + salt::Vector3f& value = obj->EndPoint(); + + if ( + (in.GetSize() != 3) || + (! in.GetValue(in[0], value[0])) || + (! in.GetValue(in[1], value[1])) || + (! in.GetValue(in[2], value[2])) + ) + { + return false; + } + return true; +} + +void +CLASS(Line)::DefineClass() +{ + DEFINE_BASECLASS(SoccerNode); + DEFINE_FUNCTION(setBeginPoint); + DEFINE_FUNCTION(setEndPoint); +} diff -Nru rcssserver3d-0.6.3/plugin/soccer/line/line.cpp rcssserver3d-0.6.4/plugin/soccer/line/line.cpp --- rcssserver3d-0.6.3/plugin/soccer/line/line.cpp 1970-01-01 01:00:00.000000000 +0100 +++ rcssserver3d-0.6.4/plugin/soccer/line/line.cpp 2010-06-08 09:38:29.000000000 +0100 @@ -0,0 +1,31 @@ +/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- + + this file is part of rcssserver3D + Copyright (C) 2010 RoboCup Soccer Server 3D Maintenance Group + $Id$ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "line.h" + +Line::Line() +{ + +} + +Line::~Line() +{ + +} diff -Nru rcssserver3d-0.6.3/plugin/soccer/line/line.h rcssserver3d-0.6.4/plugin/soccer/line/line.h --- rcssserver3d-0.6.3/plugin/soccer/line/line.h 1970-01-01 01:00:00.000000000 +0100 +++ rcssserver3d-0.6.4/plugin/soccer/line/line.h 2010-06-08 09:38:29.000000000 +0100 @@ -0,0 +1,44 @@ +/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- + + this file is part of rcssserver3D + Copyright (C) 2010 RoboCup Soccer Server 3D Maintenance Group + $Id$ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ +#ifndef LINE_H +#define LINE_H + +#include "../soccernode/soccernode.h" + +class Line : public SoccerNode +{ +public: + Line(); + virtual ~Line(); + + salt::Vector3f& BeginPoint() { return mBeginPoint; } + salt::Vector3f& EndPoint() { return mEndPoint; } + const salt::Vector3f& BeginPoint() const { return mBeginPoint; } + const salt::Vector3f& EndPoint() const { return mEndPoint; } + +protected: + + salt::Vector3f mBeginPoint; + salt::Vector3f mEndPoint; +}; + +DECLARE_CLASS(Line); + +#endif // LINE_H diff -Nru rcssserver3d-0.6.3/plugin/soccer/pantilteffector/pantilteffector.cpp rcssserver3d-0.6.4/plugin/soccer/pantilteffector/pantilteffector.cpp --- rcssserver3d-0.6.3/plugin/soccer/pantilteffector/pantilteffector.cpp 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/pantilteffector/pantilteffector.cpp 2010-06-08 09:38:29.000000000 +0100 @@ -4,7 +4,7 @@ Mon May 9 2005 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group - $Id: pantilteffector.cpp 21 2009-01-14 14:38:57Z yxu $ + $Id: pantilteffector.cpp 181 2010-02-28 10:55:34Z marianbuchta $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -49,7 +49,7 @@ return; } - shared_ptr parent = + boost::shared_ptr parent = shared_dynamic_cast(GetParent().lock()); if (parent.get() == 0) @@ -59,7 +59,7 @@ return; } - shared_ptr panTiltAction = + boost::shared_ptr panTiltAction = shared_dynamic_cast(mAction); mAction.reset(); @@ -106,7 +106,7 @@ } // look for vision perceptor and apply change - shared_ptr rvp = + boost::shared_ptr rvp = parent->FindChildSupportingClass(false); if (rvp.get() == 0) { @@ -119,14 +119,14 @@ } -shared_ptr +boost::shared_ptr PanTiltEffector::GetActionObject(const Predicate& predicate) { if (predicate.name != GetPredicate()) { GetLog()->Error() << "ERROR: (PanTiltEffector) invalid predicate" << predicate.name << "\n"; - return shared_ptr(); + return boost::shared_ptr(); } Predicate::Iterator iter = predicate.begin(); @@ -135,15 +135,15 @@ if (! predicate.AdvanceValue(iter, pan)) { GetLog()->Error() << "ERROR: (PanTiltEffector) 2 float parameters expected\n"; - return shared_ptr(new ActionObject(GetPredicate())); + return boost::shared_ptr(new ActionObject(GetPredicate())); } float tilt; if (! predicate.AdvanceValue(iter, tilt)) { GetLog()->Error() << "ERROR: (PanTiltEffector) float parameter expected\n"; - return shared_ptr(new ActionObject(GetPredicate())); + return boost::shared_ptr(new ActionObject(GetPredicate())); } - return shared_ptr(new PanTiltAction(GetPredicate(),pan,tilt)); + return boost::shared_ptr(new PanTiltAction(GetPredicate(),pan,tilt)); } void diff -Nru rcssserver3d-0.6.3/plugin/soccer/pantilteffector/pantilteffector.h rcssserver3d-0.6.4/plugin/soccer/pantilteffector/pantilteffector.h --- rcssserver3d-0.6.3/plugin/soccer/pantilteffector/pantilteffector.h 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/pantilteffector/pantilteffector.h 2010-06-08 09:38:29.000000000 +0100 @@ -4,7 +4,7 @@ Mon May 9 2005 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group - $Id: pantilteffector.h 21 2009-01-14 14:38:57Z yxu $ + $Id: pantilteffector.h 176 2010-02-25 12:19:37Z a-held $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -24,7 +24,7 @@ #include #include -#include +#include #include class PanTiltEffector : public oxygen::Effector @@ -77,7 +77,7 @@ /** the reference to the parent transform node */ boost::shared_ptr mTransformParent; /** the reference to the parents body node */ - boost::shared_ptr mBody; + boost::shared_ptr mBody; //! a reference to the agent state boost::shared_ptr mAgentState; diff -Nru rcssserver3d-0.6.3/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor_c.cpp rcssserver3d-0.6.4/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor_c.cpp --- rcssserver3d-0.6.3/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor_c.cpp 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor_c.cpp 2010-06-08 09:38:29.000000000 +0100 @@ -4,7 +4,7 @@ Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group - $Id: restrictedvisionperceptor_c.cpp 9 2008-11-24 02:39:02Z hedayat $ + $Id: restrictedvisionperceptor_c.cpp 190 2010-03-30 11:33:03Z yxu $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -150,6 +150,22 @@ return true; } +FUNCTION(RestrictedVisionPerceptor,setSenseLine) +{ + bool inSenseLine; + + if ( + (in.GetSize() != 1) || + (! in.GetValue(in.begin(),inSenseLine)) + ) + { + return false; + } + + obj->SetSenseLine(inSenseLine); + return true; +} + void CLASS(RestrictedVisionPerceptor)::DefineClass() { DEFINE_BASECLASS(oxygen/Perceptor); @@ -160,4 +176,5 @@ DEFINE_FUNCTION(setViewCones); DEFINE_FUNCTION(setPanRange); DEFINE_FUNCTION(setTiltRange); + DEFINE_FUNCTION(setSenseLine); } diff -Nru rcssserver3d-0.6.3/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor.cpp rcssserver3d-0.6.4/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor.cpp --- rcssserver3d-0.6.3/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor.cpp 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor.cpp 2010-06-08 09:38:29.000000000 +0100 @@ -4,7 +4,7 @@ Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group - $Id: restrictedvisionperceptor.cpp 21 2009-01-14 14:38:57Z yxu $ + $Id: restrictedvisionperceptor.cpp 211 2010-06-06 22:39:29Z hedayat $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,6 +25,12 @@ #include #include #include +#include +#include +#include +#include +#include +#include using namespace zeitgeist; using namespace oxygen; @@ -34,7 +40,8 @@ RestrictedVisionPerceptor::RestrictedVisionPerceptor() : Perceptor(), mSenseMyPos(false), mAddNoise(true), - mStaticSenseAxis(true) + mStaticSenseAxis(true), + mSenseLine(false) { // set predicate name SetPredicateName("See"); @@ -154,7 +161,7 @@ // SoccerBase::GetAgentState(*this, mAgentState); SoccerBase::GetActiveScene(*this,mActiveScene); - shared_ptr agent_aspect = + boost::shared_ptr agent_aspect = FindParentSupportingClass().lock(); if (agent_aspect == 0) { @@ -235,12 +242,12 @@ od.mObj = shared_static_cast(*i); - shared_ptr node = shared_dynamic_cast(mActiveScene); - shared_ptr agent_aspect = + boost::shared_ptr node = shared_dynamic_cast(mActiveScene); + boost::shared_ptr agent_aspect = od.mObj->FindParentSupportingClass().lock(); if (agent_aspect != 0) { - shared_ptr aspect = + boost::shared_ptr aspect = agent_aspect->FindParentSupportingClass().lock(); if (aspect != 0) { @@ -264,7 +271,7 @@ continue; // this should never happen } - shared_ptr j = od.mObj->GetTransformParent(); + boost::shared_ptr j = od.mObj->GetTransformParent(); if (j.get() == 0) { @@ -280,7 +287,7 @@ void RestrictedVisionPerceptor::AddSense(Predicate& predicate, - shared_ptr node, + boost::shared_ptr node, TObjectList& objectList) const { if (objectList.empty()) @@ -288,18 +295,18 @@ return; } - shared_ptr agent_aspect = + boost::shared_ptr agent_aspect = shared_dynamic_cast(node); if (agent_aspect != 0) { - shared_ptr aspect = + boost::shared_ptr aspect = agent_aspect->FindParentSupportingClass().lock(); if (aspect != 0) { agent_aspect = aspect; } - shared_ptr agent_state = shared_static_cast + boost::shared_ptr agent_state = shared_static_cast (agent_aspect->GetChildOfClass("AgentState",true)); if (agent_state.get() == 0 || (agent_state->GetPerceptName(ObjectState::PT_Player).empty()) @@ -394,7 +401,7 @@ for (TNodeObjectsMap::iterator i = visibleNodes.begin(); i != visibleNodes.end(); ++i) { - shared_ptr node = (*i).first; + boost::shared_ptr node = (*i).first; TObjectList& visibleObjects = (*i).second; for (TObjectList::iterator j = visibleObjects.begin(); @@ -454,6 +461,11 @@ element.AddValue(sensedMyPos[2]); } + if (mSenseLine) + { + SenseLine(predicate); + } + return true; } @@ -476,7 +488,7 @@ for (TNodeObjectsMap::iterator i = visibleNodes.begin(); i != visibleNodes.end(); ++i) { - shared_ptr node = (*i).first; + boost::shared_ptr node = (*i).first; TObjectList& visibleObjects = (*i).second; for (TObjectList::iterator j = visibleObjects.begin(); @@ -551,6 +563,11 @@ element.AddValue(sensedMyPos[2]); } + if (mSenseLine) + { + SenseLine(predicate); + } + return true; } @@ -599,7 +616,7 @@ // dContactGeom contact; -// shared_ptr collider = shared_static_cast +// boost::shared_ptr collider = shared_static_cast // (i->mObj->GetChildSupportingClass("Collider")); // if (mRay->Intersects(collider)) @@ -616,3 +633,233 @@ { mSenseMyPos = sense; } + +bool RestrictedVisionPerceptor::CheckVisuable(RestrictedVisionPerceptor::ObjectData& od) const +{ + // theta is the angle in horizontal plane, with fwAngle as 0 degree + od.mTheta = gNormalizeDeg(gRadToDeg(gNormalizeRad( + gArcTan2(od.mRelPos[1], od.mRelPos[0]) + )) - 90); + + // latitude with fwPhi as 0 degreee + od.mPhi = gRadToDeg(gNormalizeRad( + gArcTan2(od.mRelPos[2], + Vector2f(od.mRelPos[0], od.mRelPos[1]).Length() + ) + ) + ); + + od.mDist = od.mRelPos.Length(); + if (od.mDist <= 0.1) + { + // object is too close + return false; + } + + const int hAngle_2 = mHViewCone >> 1; + if (gAbs(od.mTheta) > hAngle_2) + { + // object is out of view range + return false; + } + + const int vAngle_2 = mVViewCone >> 1; + if (gAbs(od.mPhi) > vAngle_2) + { + return false; + } + + return true; +} + +void RestrictedVisionPerceptor::SenseLine(Predicate& predicate) +{ + const float focalLength = 0.1f; + TLineList visibleLines; + SetupLines(visibleLines); + + // TODO: precalculate it + // visual range + Vector2f ru(tan(gDegToRad(mHViewCone*0.5))*focalLength, tan(gDegToRad(mVViewCone*0.5))*focalLength); + Vector2f rb(ru.x(), -ru.y()); + Vector2f lu(-ru.x(), ru.y()); + Vector2f lb(-ru.x(), -ru.y()); + LineSegment2f viewRangeLine[4]; + viewRangeLine[0] = LineSegment2f(lu, ru); + viewRangeLine[1] = LineSegment2f(lb, rb); + viewRangeLine[2] = LineSegment2f(lu, lb); + viewRangeLine[3] = LineSegment2f(ru, rb); + + for (TLineList::iterator i = visibleLines.begin(); i != visibleLines.end(); ) + { + LineData& ld = (*i); + + bool seeBeginPoint = CheckVisuable(ld.mBeginPoint); + bool seeEndPoint = CheckVisuable(ld.mEndPoint); + + if (!(seeBeginPoint && seeEndPoint)) + { + Vector3f bp3 = ld.mBeginPoint.mRelPos; + Vector3f ep3 = ld.mEndPoint.mRelPos; + + if ( bp3.y() < focalLength && ep3.y() >= focalLength ) + { + float t = ( focalLength - ep3.y() ) / ( bp3.y() - ep3.y() ); + bp3 = ep3 + ( bp3 - ep3 ) * t; + } + else if ( ep3.y() < focalLength && bp3.y() >= focalLength ) + { + float t = ( focalLength - bp3.y() ) / ( ep3.y() - bp3.y() ); + ep3 = bp3 + ( ep3 - bp3 ) * t; + } + + if ( bp3.y() > 0 && ep3.y() > 0 ) + { + Vector2f bp = Vector2f(bp3.x(), bp3.z()) * focalLength / bp3.y(); + Vector2f ep = Vector2f(ep3.x(), ep3.z()) * focalLength / ep3.y(); + LineSegment2f l(bp, ep); + + float CB = bp3.Length(); + float CE = ep3.Length(); + float BE = (bp3 - ep3).Length(); + float CEB = acos((BE * BE + CE * CE - CB * CB) / (2 * BE * CE)); + Vector3f Ef(ep.x(), focalLength, ep.y()); + float CEf = Ef.Length(); + + Vector3f X[2]; + int inum = 0; + for ( int i=0; i<4 && inum < 2; i++) + { + Vector2f ip; + if ( l.Intersection(viewRangeLine[i], ip) ) + { + Vector3f Xf(ip.x(), focalLength, ip.y()); + float CXf = Xf.Length(); + float XfEf = (Xf - Ef).Length(); + float XfCEf = acos((CXf * CXf + CEf * CEf - XfEf * XfEf) / (2 * CXf * CEf)); + float CXE = gPI - CEB - XfCEf; + float EX = CE / sin(CXE) * sin(XfCEf); + X[inum] = ep3 + (bp3 - ep3) * (EX / BE); + inum++; + } + } + + if ( inum == 2 ) + { + ld.mBeginPoint.mRelPos = X[0]; + CheckVisuable(ld.mBeginPoint); + seeBeginPoint = true; + + ld.mEndPoint.mRelPos = X[1]; + CheckVisuable(ld.mEndPoint); + seeEndPoint = true; + } + else if ( inum == 1 ) + { + if ( !seeBeginPoint ) + { + ld.mBeginPoint.mRelPos = X[0]; + CheckVisuable(ld.mBeginPoint); + seeBeginPoint = true; + } + else + { + ld.mEndPoint.mRelPos = X[0]; + CheckVisuable(ld.mEndPoint); + seeEndPoint = true; + } + } + } + } + + if (seeBeginPoint && seeEndPoint) + { + // make some noise + ApplyNoise(ld.mBeginPoint); + ApplyNoise(ld.mEndPoint); + + ++i; + } + else + { + i = visibleLines.erase(i); + } + } + + // generate a sense entry + AddSense(predicate, visibleLines); +} + +void +RestrictedVisionPerceptor::SetupLines(TLineList& visibleLines) +{ + TLeafList lineList; + mActiveScene->GetChildrenOfClass("Line", lineList, true); + + // determine position relative to the local reference frame + const Matrix& mat = mTransformParent->GetWorldTransform(); + + // get the transformation matrix describing the current orientation + Vector3f myPos = mat.Pos(); + if (mAddNoise) + { + myPos -= mError; + } + + + for (TLeafList::iterator i = lineList.begin(); i != lineList.end(); ++i) + { + LineData ld; + + ld.mLine = shared_static_cast (*i); + + if (ld.mLine.get() == 0) + { + GetLog()->Error() << "Error: (RestrictedVisionPerceptor) skipped line: " + << (*i)->GetName() << "\n"; + continue; // this should never happen + } + + boost::shared_ptr j = ld.mLine->GetTransformParent(); + + if (j.get() == 0) + { + GetLog()->Error() << "Error: (RestrictedVisionPerceptor) skipped line (2): " + << (*i)->GetName() << "\n"; + continue; // this should never happen + } + + const salt::Matrix& t = j->GetWorldTransform(); + ld.mBeginPoint.mRelPos = mat.InverseRotate( t * ld.mLine->BeginPoint() - myPos ); + ld.mEndPoint.mRelPos = mat.InverseRotate( t * ld.mLine->EndPoint() - myPos ); + + visibleLines.push_back(ld); + } +} + +void RestrictedVisionPerceptor::AddSense(Predicate& predicate, const TLineList& lineList) const +{ + for (TLineList::const_iterator i = lineList.begin(); i != lineList.end(); ++i) + { + const LineData& ld = (*i); + ParameterList& element = predicate.parameter.AddList(); + element.AddValue(std::string("L")); + + ParameterList& begPos = element.AddList(); + begPos.AddValue(std::string("pol")); + begPos.AddValue(ld.mBeginPoint.mDist); + begPos.AddValue(ld.mBeginPoint.mTheta); + begPos.AddValue(ld.mBeginPoint.mPhi); + + ParameterList& endPos = element.AddList(); + endPos.AddValue(std::string("pol")); + endPos.AddValue(ld.mEndPoint.mDist); + endPos.AddValue(ld.mEndPoint.mTheta); + endPos.AddValue(ld.mEndPoint.mPhi); + } +} + +void RestrictedVisionPerceptor::SetSenseLine(bool sense) +{ + mSenseLine = sense; +} \ No newline at end of file diff -Nru rcssserver3d-0.6.3/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor.h rcssserver3d-0.6.4/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor.h --- rcssserver3d-0.6.3/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor.h 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor.h 2010-06-08 09:38:29.000000000 +0100 @@ -4,7 +4,7 @@ Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group - $Id: restrictedvisionperceptor.h 59 2009-04-08 11:39:36Z hedayat $ + $Id: restrictedvisionperceptor.h 211 2010-06-06 22:39:29Z hedayat $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -29,6 +29,7 @@ #include #include #include +#include "../line/line.h" class RestrictedVisionPerceptor : public oxygen::Perceptor { @@ -67,6 +68,15 @@ typedef std::map, TObjectList> TNodeObjectsMap; + struct LineData + { + boost::shared_ptr mLine; + ObjectData mBeginPoint; + ObjectData mEndPoint; + }; + + typedef std::list TLineList; + public: RestrictedVisionPerceptor(); virtual ~RestrictedVisionPerceptor(); @@ -94,6 +104,9 @@ //! Turn sensing of agent position on/off void SetSenseMyPos(bool sense); + // turn sensing of lines on/off + void SetSenseLine(bool sense); + /** Turn noise off/on. \param add_noise flag if noise should be used at all. */ @@ -162,6 +175,13 @@ */ bool DynamicAxisPercept(boost::shared_ptr predList); + /** Percept lines in the world */ + void SenseLine(oxygen::Predicate& predicate); + + void SetupLines(TLineList& visibleLines); + + bool CheckVisuable(ObjectData& od) const; + /** Checks if the given object is occluded, seen from from my_pos */ bool CheckOcclusion(const salt::Vector3f& my_pos, const ObjectData& od) const; @@ -172,6 +192,9 @@ boost::shared_ptr node, TObjectList& objectList) const; + void AddSense(oxygen::Predicate& predicate, + const TLineList& lineList) const; + /** applies noise to the setup ObjectData */ void ApplyNoise(ObjectData& od) const; @@ -201,6 +224,9 @@ */ bool mStaticSenseAxis; + /** flag if the lines can be sensed */ + bool mSenseLine; + //! horizontal opening of the vision cone unsigned int mHViewCone; //! vertical opening of the vision cone diff -Nru rcssserver3d-0.6.3/plugin/soccer/sayeffector/sayeffector.cpp rcssserver3d-0.6.4/plugin/soccer/sayeffector/sayeffector.cpp --- rcssserver3d-0.6.3/plugin/soccer/sayeffector/sayeffector.cpp 2010-01-18 21:17:05.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/sayeffector/sayeffector.cpp 2010-06-08 09:38:29.000000000 +0100 @@ -41,7 +41,7 @@ } bool -SayEffector::Realize(shared_ptr action) +SayEffector::Realize(boost::shared_ptr action) { if (mSoccerRule.get() == 0) { @@ -63,7 +63,7 @@ return false; } - shared_ptr sayAction = + boost::shared_ptr sayAction = shared_dynamic_cast(action); if (sayAction.get() == 0) @@ -107,7 +107,7 @@ return ifText; } -shared_ptr +boost::shared_ptr SayEffector::GetActionObject(const Predicate& predicate) { if (predicate.name != GetPredicate()) @@ -116,7 +116,7 @@ << predicate.name << "\n"; // some error happened - return shared_ptr(); + return boost::shared_ptr(); } Predicate::Iterator iter = predicate.begin(); @@ -128,11 +128,11 @@ << "ERROR: (SayEffector) said message expected\n"; // some error happened - return shared_ptr(); + return boost::shared_ptr(); } // construct the SayAction object - return shared_ptr(new SayAction(GetPredicate(), message)); + return boost::shared_ptr(new SayAction(GetPredicate(), message)); } diff -Nru rcssserver3d-0.6.3/plugin/soccer/sexpmonitor/sexpmonitor.cpp rcssserver3d-0.6.4/plugin/soccer/sexpmonitor/sexpmonitor.cpp --- rcssserver3d-0.6.3/plugin/soccer/sexpmonitor/sexpmonitor.cpp 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/sexpmonitor/sexpmonitor.cpp 2010-06-08 09:38:29.000000000 +0100 @@ -4,7 +4,7 @@ Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group - $Id: sexpmonitor.cpp 21 2009-01-14 14:38:57Z yxu $ + $Id: sexpmonitor.cpp 181 2010-02-28 10:55:34Z marianbuchta $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -112,22 +112,22 @@ } void -SexpMonitor::AddAgents(shared_ptr activeScene, std::ostringstream& ss) const +SexpMonitor::AddAgents(boost::shared_ptr activeScene, std::ostringstream& ss) const { TLeafList nodes; activeScene->ListChildrenSupportingClass(nodes, true); for (TLeafList::iterator i = nodes.begin(); i != nodes.end(); ++i) { - shared_ptr aspect = shared_static_cast(*i); + boost::shared_ptr aspect = shared_static_cast(*i); const salt::Vector3f& pos = aspect->GetWorldTransform().Pos(); ss << "(P "; - shared_ptr state = shared_static_cast + boost::shared_ptr state = shared_static_cast (aspect->GetChildOfClass("AgentState")); - shared_ptr sayEff = shared_static_cast + boost::shared_ptr sayEff = shared_static_cast (aspect->GetChildOfClass("SayEffector")); if (state.get() != 0) @@ -154,7 +154,7 @@ } // extra field if the agent was the last colliding with the ball - shared_ptr agent; + boost::shared_ptr agent; TTime time; mBallState->GetLastCollidingAgent(agent,time); if (agent == aspect) @@ -170,7 +170,7 @@ } void -SexpMonitor::AddFlags(shared_ptr activeScene, std::ostringstream& ss) +SexpMonitor::AddFlags(boost::shared_ptr activeScene, std::ostringstream& ss) { // the flags don't change, so we need to send them only once if (mSentFlags) @@ -184,9 +184,9 @@ for (TLeafList::iterator i = nodes.begin(); i != nodes.end(); ++i) { - shared_ptr flag = shared_static_cast(*i); + boost::shared_ptr flag = shared_static_cast(*i); const salt::Vector3f& pos = flag->GetWorldTransform().Pos(); - shared_ptr state = shared_dynamic_cast + boost::shared_ptr state = shared_dynamic_cast (flag->GetChildOfClass("ObjectState")); if (state.get() == 0) continue; @@ -202,9 +202,9 @@ } void -SexpMonitor::AddBall(shared_ptr activeScene, std::ostringstream& ss) const +SexpMonitor::AddBall(boost::shared_ptr activeScene, std::ostringstream& ss) const { - shared_ptr ball = shared_static_cast(activeScene->GetChild("Ball")); + boost::shared_ptr ball = shared_static_cast(activeScene->GetChild("Ball")); const salt::Vector3f& pos = ball->GetWorldTransform().Pos(); ss << "(B "; // pos @@ -220,7 +220,7 @@ return "(Die)\n"; } - shared_ptr sceneServer = + boost::shared_ptr sceneServer = shared_dynamic_cast(GetCore()->Get("/sys/server/scene")); if (sceneServer.get() == 0) @@ -228,7 +228,7 @@ GetLog()->Error() << "(SexpMonitor) cannot get SceneServer\n"; return ""; } - shared_ptr activeScene = sceneServer->GetActiveScene(); + boost::shared_ptr activeScene = sceneServer->GetActiveScene(); ostringstream expression; expression << "(Info "; diff -Nru rcssserver3d-0.6.3/plugin/soccer/soccerbase/soccerbase.cpp rcssserver3d-0.6.4/plugin/soccer/soccerbase/soccerbase.cpp --- rcssserver3d-0.6.3/plugin/soccer/soccerbase/soccerbase.cpp 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/soccerbase/soccerbase.cpp 2010-06-08 09:38:29.000000000 +0100 @@ -4,7 +4,7 @@ Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group - $Id: soccerbase.cpp 59 2009-04-08 11:39:36Z hedayat $ + $Id: soccerbase.cpp 181 2010-02-28 10:55:34Z marianbuchta $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,7 +20,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "soccerbase.h" -#include +#include #include #include #include @@ -44,7 +44,7 @@ bool SoccerBase::GetSceneServer(const Leaf& base, - shared_ptr& scene_server) + boost::shared_ptr& scene_server) { scene_server = shared_static_cast (base.GetCore()->Get("/sys/server/scene")); @@ -62,7 +62,7 @@ bool SoccerBase::GetTransformParent(const Leaf& base, - shared_ptr& transform_parent) + boost::shared_ptr& transform_parent) { transform_parent = shared_dynamic_cast ((base.FindParentSupportingClass()).lock()); @@ -78,8 +78,8 @@ } bool -SoccerBase::GetAgentState(const shared_ptr transform, - shared_ptr& agent_state) +SoccerBase::GetAgentState(const boost::shared_ptr transform, + boost::shared_ptr& agent_state) { agent_state = shared_dynamic_cast(transform->GetChild("AgentState", true)); @@ -93,11 +93,11 @@ } bool -SoccerBase::GetAgentBody(const shared_ptr transform, - shared_ptr& agent_body) +SoccerBase::GetAgentBody(const boost::shared_ptr transform, + boost::shared_ptr& agent_body) { - agent_body = transform->FindChildSupportingClass(true); + agent_body = transform->FindChildSupportingClass(true); if (agent_body.get() == 0) { @@ -112,10 +112,10 @@ bool SoccerBase::GetAgentBody(const Leaf& base, TTeamIndex idx, - int unum, shared_ptr& agent_body) + int unum, boost::shared_ptr& agent_body) { - shared_ptr agentState; - shared_ptr parent; + boost::shared_ptr agentState; + boost::shared_ptr parent; // get matching AgentState if (!GetAgentState(base, idx, unum, agentState)) @@ -131,9 +131,9 @@ bool SoccerBase::GetAgentState(const Leaf& base, - shared_ptr& agent_state) + boost::shared_ptr& agent_state) { - shared_ptr parent; + boost::shared_ptr parent; if (! GetTransformParent(base,parent)) { return false; @@ -144,7 +144,7 @@ bool SoccerBase::GetAgentState(const Leaf& base, TTeamIndex idx, - int unum, shared_ptr& agentState) + int unum, boost::shared_ptr& agentState) { static TAgentStateMap mAgentStateMapLeft; static TAgentStateMap mAgentStateMapRight; @@ -241,7 +241,7 @@ TAgentStateList& agentStates, TTeamIndex idx) { - static shared_ptr gameCtrl; + static boost::shared_ptr gameCtrl; if (gameCtrl.get() == 0) { @@ -259,7 +259,7 @@ gameCtrl->GetAgentAspectList(aspectList); GameControlServer::TAgentAspectList::iterator iter; - shared_ptr agentState; + boost::shared_ptr agentState; for ( iter = aspectList.begin(); @@ -286,7 +286,7 @@ bool SoccerBase::GetGameState(const Leaf& base, - shared_ptr& game_state) + boost::shared_ptr& game_state) { game_state = shared_dynamic_cast (base.GetCore()->Get("/sys/server/gamecontrol/GameStateAspect")); @@ -304,7 +304,7 @@ bool SoccerBase::GetSoccerRuleAspect(const Leaf& base, - shared_ptr & soccer_rule_aspect) + boost::shared_ptr & soccer_rule_aspect) { soccer_rule_aspect = shared_dynamic_cast (base.GetCore()->Get("/sys/server/gamecontrol/SoccerRuleAspect")); @@ -323,9 +323,9 @@ bool SoccerBase::GetGameControlServer(const Leaf& base, - shared_ptr & game_control_server) + boost::shared_ptr & game_control_server) { - static shared_ptr gameControlServer; + static boost::shared_ptr gameControlServer; if (gameControlServer.get() == 0) { @@ -349,9 +349,9 @@ bool SoccerBase::GetActiveScene(const Leaf& base, - shared_ptr& active_scene) + boost::shared_ptr& active_scene) { - static shared_ptr sceneServer; + static boost::shared_ptr sceneServer; if (sceneServer.get() == 0) { @@ -380,9 +380,9 @@ } bool -SoccerBase::GetBody(const Leaf& base, shared_ptr& body) +SoccerBase::GetBody(const Leaf& base, boost::shared_ptr& body) { - shared_ptr parent; + boost::shared_ptr parent; if (! GetTransformParent(base,parent)) { base.GetLog()->Error() << "(SoccerBase) ERROR: no transform parent " @@ -390,7 +390,7 @@ return false; } - body = shared_dynamic_cast(parent->FindChildSupportingClass()); + body = shared_dynamic_cast(parent->FindChildSupportingClass()); if (body.get() == 0) { @@ -405,10 +405,10 @@ } bool -SoccerBase::GetBall(const Leaf& base, shared_ptr& ball) +SoccerBase::GetBall(const Leaf& base, boost::shared_ptr& ball) { - static shared_ptr scene; - static shared_ptr ballRef; + static boost::shared_ptr scene; + static boost::shared_ptr ballRef; if (scene.get() == 0) { @@ -443,10 +443,10 @@ } bool -SoccerBase::GetBallBody(const Leaf& base, shared_ptr& body) +SoccerBase::GetBallBody(const Leaf& base, boost::shared_ptr& body) { - static shared_ptr scene; - static shared_ptr bodyRef; + static boost::shared_ptr scene; + static boost::shared_ptr bodyRef; if (scene.get() == 0) { @@ -462,7 +462,7 @@ if (bodyRef.get() == 0) { - bodyRef = shared_dynamic_cast + bodyRef = shared_dynamic_cast (base.GetCore()->Get(scene->GetFullPath() + "Ball/physics")); if (bodyRef.get() == 0) @@ -484,8 +484,8 @@ SoccerBase::GetBallCollider(const zeitgeist::Leaf& base, boost::shared_ptr& sphere) { - static shared_ptr scene; - static shared_ptr sphereRef; + static boost::shared_ptr scene; + static boost::shared_ptr sphereRef; if (scene.get() == 0) { @@ -613,12 +613,12 @@ }; } -shared_ptr +boost::shared_ptr SoccerBase::GetControlAspect(const zeitgeist::Leaf& base,const string& name) { static const string gcsPath = "/sys/server/gamecontrol/"; - shared_ptr aspect = shared_dynamic_cast + boost::shared_ptr aspect = shared_dynamic_cast (base.GetCore()->Get(gcsPath + name)); if (aspect.get() == 0) @@ -632,11 +632,11 @@ } bool -SoccerBase::MoveAgent(shared_ptr agent_aspect, const Vector3f& pos) +SoccerBase::MoveAgent(boost::shared_ptr agent_aspect, const Vector3f& pos) { Vector3f agentPos = agent_aspect->GetWorldTransform().Pos(); - shared_ptr parent = shared_dynamic_cast + boost::shared_ptr parent = shared_dynamic_cast (agent_aspect->FindParentSupportingClass().lock()); if (parent.get() == 0) @@ -647,7 +647,7 @@ Leaf::TLeafList leafList; - parent->ListChildrenSupportingClass(leafList, true); + parent->ListChildrenSupportingClass(leafList, true); if (leafList.size() == 0) { @@ -663,8 +663,8 @@ // move all child bodies for (; iter != leafList.end(); ++iter) { - shared_ptr childBody = - shared_dynamic_cast(*iter); + boost::shared_ptr childBody = + shared_dynamic_cast(*iter); Vector3f childPos = childBody->GetPosition(); @@ -677,11 +677,11 @@ } bool -SoccerBase::MoveAndRotateAgent(shared_ptr agent_aspect, const Vector3f& pos, float angle) +SoccerBase::MoveAndRotateAgent(boost::shared_ptr agent_aspect, const Vector3f& pos, float angle) { Vector3f agentPos = agent_aspect->GetWorldTransform().Pos(); - shared_ptr parent = shared_dynamic_cast + boost::shared_ptr parent = shared_dynamic_cast (agent_aspect->FindParentSupportingClass().lock()); if (parent.get() == 0) @@ -692,7 +692,7 @@ Leaf::TLeafList leafList; - parent->ListChildrenSupportingClass(leafList, true); + parent->ListChildrenSupportingClass(leafList, true); if (leafList.size() == 0) { @@ -703,7 +703,7 @@ return false; } - shared_ptr body; + boost::shared_ptr body; GetAgentBody(agent_aspect, body); Matrix bodyR = body->GetRotation(); @@ -720,8 +720,8 @@ ++iter ) { - shared_ptr childBody = - shared_dynamic_cast(*iter); + boost::shared_ptr childBody = + shared_dynamic_cast(*iter); Vector3f childPos = childBody->GetPosition(); Matrix childR = childBody->GetRotation(); @@ -739,7 +739,7 @@ { AABB3 boundingBox; - shared_ptr parent = base.FindParentSupportingClass().lock(); + boost::shared_ptr parent = base.FindParentSupportingClass().lock(); if (!parent) { @@ -766,7 +766,7 @@ for (Leaf::TLeafList::iterator i = baseNodes.begin(); i!= baseNodes.end(); ++i) { - shared_ptr node = shared_static_cast(*i); + boost::shared_ptr node = shared_static_cast(*i); boundingBox.Encapsulate(node->GetWorldBoundingBox()); } @@ -777,7 +777,7 @@ { AABB2 boundingRect; - shared_ptr parent = base.FindParentSupportingClass().lock(); + boost::shared_ptr parent = base.FindParentSupportingClass().lock(); if (!parent) { @@ -804,7 +804,7 @@ for (Leaf::TLeafList::iterator i = baseNodes.begin(); i!= baseNodes.end(); ++i) { - shared_ptr node = shared_static_cast(*i); + boost::shared_ptr node = shared_static_cast(*i); const AABB3 &box = node->GetWorldBoundingBox(); boundingRect.Encapsulate(box.minVec.x(), box.minVec.y()); boundingRect.Encapsulate(box.maxVec.x(), box.maxVec.y()); diff -Nru rcssserver3d-0.6.3/plugin/soccer/soccerbase/soccerbase.h rcssserver3d-0.6.4/plugin/soccer/soccerbase/soccerbase.h --- rcssserver3d-0.6.3/plugin/soccer/soccerbase/soccerbase.h 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/soccerbase/soccerbase.h 2010-06-08 09:38:29.000000000 +0100 @@ -4,7 +4,7 @@ Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group - $Id: soccerbase.h 21 2009-01-14 14:38:57Z yxu $ + $Id: soccerbase.h 176 2010-02-25 12:19:37Z a-held $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -40,7 +40,7 @@ class Scene; class Transform; class Perceptor; - class Body; + class RigidBody; class SphereCollider; class ControlAspect; class AgentAspect; @@ -84,19 +84,19 @@ /** returns a reference to the Body node below the closest transform parent */ static bool - GetBody(const zeitgeist::Leaf& base, boost::shared_ptr& body); + GetBody(const zeitgeist::Leaf& base, boost::shared_ptr& body); /** returns a reference to the Body node below the given Transform node */ static bool GetAgentBody(const boost::shared_ptr transform, - boost::shared_ptr& agent_body); + boost::shared_ptr& agent_body); /** returns a reference to the Body node below the given Transform node based on parameters team index and uniform number */ static bool GetAgentBody(const zeitgeist::Leaf& base, TTeamIndex idx, - int unum, boost::shared_ptr& agent_body); + int unum, boost::shared_ptr& agent_body); /** returns a reference to the AgentState node below the closest Transform parent */ @@ -148,7 +148,7 @@ /** returns a reference to the Body node below the Ball */ static bool GetBallBody(const zeitgeist::Leaf& base, - boost::shared_ptr& body); + boost::shared_ptr& body); /** returns a reference to the Body SphereCollider node below the Ball */ static bool diff -Nru rcssserver3d-0.6.3/plugin/soccer/soccercontrolaspect/soccercontrolaspect.cpp rcssserver3d-0.6.4/plugin/soccer/soccercontrolaspect/soccercontrolaspect.cpp --- rcssserver3d-0.6.3/plugin/soccer/soccercontrolaspect/soccercontrolaspect.cpp 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/soccercontrolaspect/soccercontrolaspect.cpp 2010-06-08 09:38:29.000000000 +0100 @@ -4,7 +4,7 @@ Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group - $Id: soccercontrolaspect.cpp 21 2009-01-14 14:38:57Z yxu $ + $Id: soccercontrolaspect.cpp 181 2010-02-28 10:55:34Z marianbuchta $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -43,7 +43,7 @@ void SoccerControlAspect::OnLink() { - shared_ptr scene = GetActiveScene(); + boost::shared_ptr scene = GetActiveScene(); if (scene.get() == 0) { GetLog()->Error() @@ -54,11 +54,11 @@ mScenePath = scene->GetFullPath(); } -shared_ptr SoccerControlAspect::GetBallRecorder() +boost::shared_ptr SoccerControlAspect::GetBallRecorder() { string ballRecorder; SoccerBase::GetSoccerVar(*this,"BallRecorder",ballRecorder); - shared_ptr node = shared_dynamic_cast + boost::shared_ptr node = shared_dynamic_cast (GetCore()->Get(mScenePath + ballRecorder)); if (node.get() == 0) @@ -70,11 +70,11 @@ return node; } -shared_ptr SoccerControlAspect::GetLeftGoalRecorder() +boost::shared_ptr SoccerControlAspect::GetLeftGoalRecorder() { string goalRecorder; SoccerBase::GetSoccerVar(*this,"LeftGoalRecorder",goalRecorder); - shared_ptr node = shared_dynamic_cast + boost::shared_ptr node = shared_dynamic_cast (GetCore()->Get(mScenePath + goalRecorder)); if (node.get() == 0) @@ -86,11 +86,11 @@ return node; } -shared_ptr SoccerControlAspect::GetRightGoalRecorder() +boost::shared_ptr SoccerControlAspect::GetRightGoalRecorder() { string goalRecorder; SoccerBase::GetSoccerVar(*this,"RightGoalRecorder",goalRecorder); - shared_ptr node = shared_dynamic_cast + boost::shared_ptr node = shared_dynamic_cast (GetCore()->Get(mScenePath + goalRecorder)); if (node.get() == 0) diff -Nru rcssserver3d-0.6.3/plugin/soccer/soccercontrolaspect/soccercontrolaspect.h rcssserver3d-0.6.4/plugin/soccer/soccercontrolaspect/soccercontrolaspect.h --- rcssserver3d-0.6.3/plugin/soccer/soccercontrolaspect/soccercontrolaspect.h 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/soccercontrolaspect/soccercontrolaspect.h 2010-06-08 09:38:29.000000000 +0100 @@ -4,7 +4,7 @@ Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group - $Id: soccercontrolaspect.h 21 2009-01-14 14:38:57Z yxu $ + $Id: soccercontrolaspect.h 176 2010-02-25 12:19:37Z a-held $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -32,7 +32,7 @@ namespace oxygen { class RecorderHandler; - class Body; + class RigidBody; } /** \class SoccerControlAspect is the base class for all diff -Nru rcssserver3d-0.6.3/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp rcssserver3d-0.6.4/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp --- rcssserver3d-0.6.3/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2010-06-08 09:38:29.000000000 +0100 @@ -4,7 +4,7 @@ Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group - $Id: soccerruleaspect.cpp 59 2009-04-08 11:39:36Z hedayat $ + $Id: soccerruleaspect.cpp 207 2010-06-01 13:04:58Z sgvandijk $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include @@ -53,10 +53,19 @@ mFirstCollidingAgent(true), mNotOffside(false), mLastModeWasPlayOn(false), - mUseOffside(true) + mUseOffside(true), + mDropBallTime(15), + mNotStandingMaxTime(1000), // max time player may be sitted or laying down before being repositioned + mGoalieNotStandingMaxTime(1000), // max time goalie may be sitted or laying down before being repositioned + mGroundMaxTime(1000), // max time player may be on the ground before being repositioned + mGoalieGroundMaxTime(1000), // max time goalie (pl number 1) may be on the ground before being repositioned + mMaxPlayersInsideOwnArea(1000), // maximum number of players of the defending team that may be inside own penalty area + mMinOppDistance(0), // min dist for closest Opponent to ball in order to use repositions for 2nd, 3rd player + mMin2PlDistance(0), // min dist for second closest of team before being repositioned + mMin3PlDistance(0), // min dist for third closest of team before being repositioned + mMaxFaultTime(0.0) // maximum time allowed for a player to commit a positional fault before being repositioned { mFreeKickPos = Vector3f(0.0,0.0,mBallRadius); - } SoccerRuleAspect::~SoccerRuleAspect() @@ -72,6 +81,271 @@ mBallBody->Enable(); } +/* Uses only Ball and Players positions and detects overcrowind near ball and areas and +players innappropriate behavior (laying on the ground or not walking for too much time) */ +void +SoccerRuleAspect::AutomaticSimpleReferee(TPlayMode playMode) +{ + if (playMode != PM_PlayOn) { + ResetFaultCounter(TI_LEFT); ResetFaultCounter(TI_RIGHT); //only using automatic refereing in PlayOn + } + else { + CalculateDistanceArrays(TI_LEFT); // Calculates distance arrays for left team + CalculateDistanceArrays(TI_RIGHT); // Calculates distance arrays for right team + AnalyseFaults(TI_LEFT); // Analyses simple faults for the left team + AnalyseFaults(TI_RIGHT); // Analyses simple faults for the right team + ClearPlayersAutomatic(TI_LEFT); // enforce standing and not overcrowding rules for left team + ClearPlayersAutomatic(TI_RIGHT); // enforce standing and not overcrowding rules for right team + } +} + + +void +SoccerRuleAspect::ResetFaultCounterPlayer(int unum, TTeamIndex idx) +{ + playerGround[unum][idx] = 0; + playerNotStanding[unum][idx] = 0; + playerStanding[unum][idx] = 5/0.02; // Considers player has been standing for some time in playoff + prevPlayerInsideOwnArea[unum][idx] = 0; + playerInsideOwnArea[unum][idx] = 0; + playerFaultTime[unum][idx] = 0; +} + +void +SoccerRuleAspect::ResetFaultCounter(TTeamIndex idx) +{ + for(int t=1; t<=11; t++) { + ResetFaultCounterPlayer(t,idx); + } +} + +// Process agent state: standing, sitted, laying down, ... +void +SoccerRuleAspect::processAgentState(salt::Vector3f pos, int unum, TTeamIndex idx) +{ + float groundZVal = 0.15; //bellow this player is on the ground + float middleZVal = 0.25; //abovce this player is standing (or trying...) + + //increase player not standing if it is not in upward position and inside of field + if (pos.z() < middleZVal && fabs(pos.y())< mFieldWidth/2 + 0.1) { + playerNotStanding[unum][idx]++; + playerStanding[unum][idx]=0; //player not standing + } + + //increase player near ground if it is very low and inside of field + if (pos.z() < groundZVal && fabs(pos.y())< mFieldWidth/2 + 0.1) { + playerGround[unum][idx]++; + } + + //increase player standing or at least trying... Reset ground + if (pos.z() >= middleZVal) { + playerStanding[unum][idx]++; + playerGround[unum][idx]=0; + } + + //Player standing for some cycles (0.5 seconds) reset not standing count + if (playerStanding[unum][idx] > 0.5/0.02) { + playerNotStanding[unum][idx]=0; + } + +// if (playerGround[unum][idx] > 0/0.02) +// cout << "On the Ground Unum" << unum << " Team: " << idx << " Time: " << playerGround[unum][idx] << +// " z= " << pos.z() << endl; //debug +} + +// Calculates ordering on a distance vector +void SoccerRuleAspect::SimpleOrder(float dArr[][3], int oArr[][3], TTeamIndex idx) +{ + for(int t1=1; t1<=10; t1++) + for(int t2=t1+1; t2<=11; t2++) + if (dArr[t1][idx] >= dArr[t2][idx]) oArr[t1][idx]++; else oArr[t2][idx]++; + +// DEBUG +// if (dArr[1][idx]<1000.0) { +// cout << "Team: " << idx << " --> "; +// for(int t1=1; t1<=6; t1++) +// if (dArr[t1][idx]<5.0) cout << t1 << " o:" << oArr[t1][idx] << " d: " << dArr[t1][idx] << " | "; +// cout << endl; +// } +} + +// Calculate Distance arrays and ordering to the ball and own goal +void SoccerRuleAspect::CalculateDistanceArrays(TTeamIndex idx) +{ + if (idx == TI_NONE || mBallState.get() == 0) return; + std::list > agent_states; + if (! SoccerBase::GetAgentStates(*mBallState.get(), agent_states, idx)) return; + + salt::Vector3f ballPos = mBallBody->GetPosition(); + salt::Vector3f ownGoalPos = Vector3f(-mFieldLength/2.0, 0.0, 0.0); + if (idx==TI_RIGHT) ownGoalPos = Vector3f(mFieldLength/2.0, 0.0, 0.0); //own goal position + boost::shared_ptr agent_aspect; + std::list >::const_iterator i; + + numPlInsideOwnArea[idx] = 0; closestPlayer[idx]=1; closestPlayerDist[idx]=1000.0; + for(int t=1; t<=11; t++) { + distArr[t][idx]=1000.0; ordArr[t][idx]=1; distGArr[t][idx]=1000.0; ordGArr[t][idx]=1; + } + + for (i = agent_states.begin(); i != agent_states.end(); ++i) { + SoccerBase::GetTransformParent(**i, agent_aspect); + Vector3f agentPos = agent_aspect->GetWorldTransform().Pos(); + int unum = (*i)->GetUniformNumber(); + distArr[unum][idx] = sqrt((agentPos.x()-ballPos.x())*(agentPos.x()-ballPos.x()) + + (agentPos.y()-ballPos.y())*(agentPos.y()-ballPos.y())); + distGArr[unum][idx] = sqrt((agentPos.x()-ownGoalPos.x())*(agentPos.x()-ownGoalPos.x()) + + (agentPos.y()-ownGoalPos.y())*(agentPos.y()-ownGoalPos.y())); + + // determine closest player + if (distArr[unum][idx] < closestPlayerDist[idx]) { + closestPlayerDist[idx] = distArr[unum][idx]; closestPlayer[idx] = unum; + } + + // save player inside area state in previous cycle + prevPlayerInsideOwnArea[unum][idx] = playerInsideOwnArea[unum][idx]; + + // determine number of players inside area and set inside area state of player + if (idx == TI_LEFT && mLeftPenaltyArea.Contains(Vector2f(agentPos.x(), agentPos.y())) || + idx == TI_RIGHT && mRightPenaltyArea.Contains(Vector2f(agentPos.x(), agentPos.y()))) { + numPlInsideOwnArea[idx]++; + playerInsideOwnArea[unum][idx] = 1; + + //goalie is not repositioned when inside own area... + if (unum == 1) { + distGArr[unum][idx] = 0.0; + } + } + else playerInsideOwnArea[unum][idx] = 0; + + // Process agent state: standing, sitted, laying down, ... + processAgentState(agentPos, unum, idx); + } + + // compute rank of distance to ball + SimpleOrder(distArr, ordArr, idx); + // compute rank of distance to own goal + SimpleOrder(distGArr, ordGArr, idx); +} + +// Analyse Faults and Creates Fault Time Array +void SoccerRuleAspect::AnalyseFaults(TTeamIndex idx) +{ + TTeamIndex idx2; if (idx == TI_LEFT) idx2 = TI_RIGHT; else idx2 = TI_LEFT; //Other team + for(int unum=1; unum<=11; unum++) { + + //I am the third closest player but i am too near the ball (and not the goalie) + if ( unum!=1 && closestPlayerDist[idx2] < mMinOppDistance && + (distArr[unum][idx] <= mMin3PlDistance+0.01 && ordArr[unum][idx] == 3)) + { + playerFaultTime[unum][idx]++; //increase player fault time + //cout << "Min3Dist " << mMin3PlDistance << " activated - player " << unum << " to be repositioned \n"; + } + else + //I am the second closest player but i am too near the ball (and not the goalie) + if( unum!=1 && closestPlayerDist[idx2] < mMinOppDistance && + distArr[unum][idx] <= mMin2PlDistance+0.01 && ordArr[unum][idx] == 2 ) + { + playerFaultTime[unum][idx]++; //increase player fault time + //cout << "Min2Dist " << mMin2PlDistance << " activated - player " << unum << " to be repositioned \n"; + } + else + // too many players inside my own penalty area and Im am the last one to enter or + // the last one to enter was the goalie and I am the one further away from own goal + if( (numPlInsideOwnArea[idx] > mMaxPlayersInsideOwnArea && unum !=1 && playerInsideOwnArea[unum][idx] == 1 && + (prevPlayerInsideOwnArea[unum][idx] == 0 || + prevPlayerInsideOwnArea[1][idx] == 0 && + playerInsideOwnArea[1][idx] == 1 && + mMaxPlayersInsideOwnArea + 1 == ordGArr[unum][idx]))) + { + playerFaultTime[unum][idx]++; //increase player fault time + //cout << "MaxPlInPenalty " << mMaxPlayersInsideOwnArea << " activated - player " + // << unum << " to be repositioned " << " ord " << ordGArr[unum][idx] << "\n"; + } + else + //I am a field player and on the ground for too much time + if ( unum!=1 && playerGround[unum][idx] > mGroundMaxTime/0.02 ) + { + playerFaultTime[unum][idx]++; //increase player fault time + //cout << "GroundMaxTime " << mGroundMaxTime << " activated - player " + // << unum << " to be repositioned " << "\n"; + } + else + // I am a field player and I am not standing for too much time + if( unum!=1 && playerNotStanding[unum][idx] > mNotStandingMaxTime/0.02 ) + { + playerFaultTime[unum][idx]++; //increase player fault time + //cout << "StandMaxTime " << mNotStandingMaxTime << " activated - player " + // << unum << " to be repositioned " << "\n"; + } + + else + //I am the goalie and I am on the ground for too much time + if ( unum==1 && + playerGround[unum][idx] > mGoalieGroundMaxTime/0.02 ) + { + playerFaultTime[unum][idx]++; //increase player fault time + //cout << "GoalieGroundMaxTime " << mGoalieGroundMaxTime << " activated - player " + // << unum << " to be repositioned " << "\n"; + } + else + //I am the goalie and I and not standing for too much time + if ( unum == 1 && playerNotStanding[unum][idx] > mGoalieNotStandingMaxTime/0.02) + { + playerFaultTime[unum][idx]++; //increase player fault time + //cout << "GoalieStandMaxTime " << mGoalieNotStandingMaxTime << " activated - player " + // << unum << " to be repositioned " << "\n"; + } + else { + playerFaultTime[unum][idx]=0; //reset player fault time + } + + } +} + + +salt::Vector3f SoccerRuleAspect::RepositionOutsidePos(salt::Vector3f posIni, int unum, TTeamIndex idx) +{ + salt::Vector3f pos; + float fac=1.0; + if (unum > 6) unum = 7 -unum; //because of teams that use numbers 7-11 + if (posIni.y()<1.5) fac = 1.0; else fac = -1.0; //for visualization purposes + if (idx==TI_LEFT) pos = Vector3f(-(7-unum)*0.6, 6.5*fac, 1.0); + else pos = Vector3f((7-unum)*0.6, 6.5*fac, 1.0); + //cout << "*********Player Repos Num: " << unum << " Team: " << idx << " Pos: " << pos << endl; + return pos; +} + + +// Clear Players that are violating the rules +void +SoccerRuleAspect::ClearPlayersAutomatic(TTeamIndex idx) +{ + if (idx == TI_NONE || mBallState.get() == 0) return; + + std::list > agent_states; + if (! SoccerBase::GetAgentStates(*mBallState.get(), agent_states, idx)) return; + + salt::Vector3f ballPos = mBallBody->GetPosition(); + + boost::shared_ptr agent_aspect; + std::list >::const_iterator i; + + for (i = agent_states.begin(); i != agent_states.end(); ++i) { + SoccerBase::GetTransformParent(**i, agent_aspect); + Vector3f agentPos = agent_aspect->GetWorldTransform().Pos(); + int unum = (*i)->GetUniformNumber(); + if (playerFaultTime[unum][idx] > mMaxFaultTime/0.02) { + // I am not a very good soccer player... I am violating the rules... + salt::Vector3f new_pos = RepositionOutsidePos(ballPos, unum, idx); + //Calculate my Reposition pos outside of the field + SoccerBase::MoveAgent(agent_aspect, new_pos); + //Oh my God!! I am flying!! I am going outside of the field + ResetFaultCounterPlayer(unum, idx); + //cout << "*********Player Repos Num: " << unum << " Team: " << team << " Pos: " << new_pos << endl; + } + } +} + void SoccerRuleAspect::ClearPlayers(const salt::Vector3f& pos, float radius, float min_dist, TTeamIndex idx) @@ -212,6 +486,48 @@ } void +SoccerRuleAspect::ClearSelectedPlayers() +{ + float min_dist = mFreeKickMoveDist; + std::list > agent_states; + if (! SoccerBase::GetAgentStates(*mBallState.get(), agent_states, TI_NONE)) + return; + + boost::shared_ptr agent_aspect; + std::list >::const_iterator i; + for (i = agent_states.begin(); i != agent_states.end(); ++i) + { + SoccerBase::GetTransformParent(**i, agent_aspect); + + // if agent is selected, move it away + Vector3f new_pos = agent_aspect->GetWorldTransform().Pos(); + + if ((*i)->IsSelected()) + { + float dist = salt::UniformRNG<>(min_dist, min_dist + 2.0)(); + + if ((*i)->GetTeamIndex() == TI_LEFT) + { + if (new_pos[0] - dist < -mFieldLength/2.0) + { + new_pos[1] = new_pos[1] < 0 ? new_pos[1] + dist : new_pos[1] - dist; + } else { + new_pos[0] = new_pos[0] - dist; + } + } else { + if (new_pos[0] + dist > mFieldLength/2.0) + { + new_pos[1] = new_pos[1] < 0 ? new_pos[1] + dist : new_pos[1] - dist; + } else { + new_pos[0] = new_pos[0] + dist; + } + } + SoccerBase::MoveAgent(agent_aspect, new_pos); + } + } +} + +void SoccerRuleAspect::DropBall() { DropBall(mBallBody->GetPosition()); @@ -258,7 +574,7 @@ SoccerRuleAspect::UpdateBeforeKickOff() { // get game control server to check agent count - static shared_ptr game_control; + static boost::shared_ptr game_control; if (game_control.get() == 0) { @@ -314,7 +630,7 @@ } // after the first agent touches the ball move to PM_PLAYON - shared_ptr agent; + boost::shared_ptr agent; TTime time; if (! mBallState->GetLastCollidingAgent(agent,time)) { @@ -350,7 +666,7 @@ // after the first agent touches the ball move to PM_PLAY_ON. the // time when the agent last touches the ball must be after the // change to the KickIn mode - shared_ptr agent; + boost::shared_ptr agent; TTime time; if (! mBallState->GetLastCollidingAgent(agent,time)) { @@ -420,7 +736,7 @@ // after the first agent touches the ball move to PM_PLAY_ON. the // time when the agent last touches the ball must be after the // change to the KickIn mode - shared_ptr agent; + boost::shared_ptr agent; TTime time; if (! mBallState->GetLastCollidingAgent(agent,time)) { @@ -468,7 +784,7 @@ // after the first agent touches the ball, we do nothing until // the ball leaves the penalty area. - shared_ptr agent; + boost::shared_ptr agent; TTime time; if (! mBallState->GetLastCollidingAgent(agent,time)) { @@ -525,7 +841,7 @@ // after the first agent touches the ball move to PM_PLAY_ON. the // time when the agent last touches the ball must be after the // change to the KickIn mode - shared_ptr agent; + boost::shared_ptr agent; TTime time; if (! mBallState->GetLastCollidingAgent(agent,time)) { @@ -558,8 +874,8 @@ // get the team of the last agent touching the ball and set the // correct kick in playmode - shared_ptr agent; - shared_ptr agentState; + boost::shared_ptr agent; + boost::shared_ptr agentState; TTime time; if (mBallState->GetLastCollidingAgent(agent,time) && @@ -855,6 +1171,9 @@ << playMode << "\n"; break; } + + // Simple Referee + AutomaticSimpleReferee(playMode); } void @@ -912,7 +1231,20 @@ float penaltyLength, penaltyWidth; SoccerBase::GetSoccerVar(*this,"PenaltyLength",penaltyLength); SoccerBase::GetSoccerVar(*this,"PenaltyWidth",penaltyWidth); + + // auto ref parameters + SoccerBase::GetSoccerVar(*this,"NotStandingMaxTime",mNotStandingMaxTime); + SoccerBase::GetSoccerVar(*this,"GoalieNotStandingMaxTime",mGoalieNotStandingMaxTime); + SoccerBase::GetSoccerVar(*this,"GroundMaxTime",mGroundMaxTime); + SoccerBase::GetSoccerVar(*this,"GoalieGroundMaxTime",mGoalieGroundMaxTime); + SoccerBase::GetSoccerVar(*this,"MaxPlayersInsideOwnArea",mMaxPlayersInsideOwnArea); + SoccerBase::GetSoccerVar(*this,"MinOppDistance",mMinOppDistance); + SoccerBase::GetSoccerVar(*this,"Min2PlDistance",mMin2PlDistance); + SoccerBase::GetSoccerVar(*this,"Min3PlDistance",mMin3PlDistance); + //SoccerBase::GetSoccerVar(*this,"MaxFaultTime",mMaxFaultTime); + + // cout << "MaxInside " << mMaxPlayersInsideOwnArea << endl << endl; // set up bounding boxes for halfs and goal areas // the right and the left half are intentionally oversized towards the sides and @@ -957,8 +1289,8 @@ salt::BoundingSphere sphere(pos, mAudioCutDist); - shared_ptr transform_parent; - shared_ptr agent_body; + boost::shared_ptr transform_parent; + boost::shared_ptr agent_body; for ( TAgentStateList::const_iterator it = agent_states.begin(); @@ -1016,10 +1348,10 @@ return true; #if 0 - shared_ptr collidingAgent; - shared_ptr kickingAgent; - shared_ptr agent; - shared_ptr agentState; + boost::shared_ptr collidingAgent; + boost::shared_ptr kickingAgent; + boost::shared_ptr agent; + boost::shared_ptr agentState; TTime collidingTime; TTime kickingTime; TTime time; @@ -1090,7 +1422,7 @@ TTeamIndex idx = agentState->GetTeamIndex(); - list > opp_agent_states; + list > opp_agent_states; if (! SoccerBase::GetAgentStates(*mBallState, opp_agent_states, SoccerBase::OpponentTeam(idx))) { @@ -1103,10 +1435,10 @@ opp_goalkeeper_pos = 0.0; opp_defender_pos = 0.0; - shared_ptr transform_parent; - shared_ptr agent_body; + boost::shared_ptr transform_parent; + boost::shared_ptr agent_body; - list >::const_iterator it; + list >::const_iterator it; for (it = opp_agent_states.begin(); it != opp_agent_states.end(); it++) { SoccerBase::GetTransformParent(*(*it), transform_parent); @@ -1208,7 +1540,7 @@ mFreeKickPos = mBallState->GetLastValidBallPosition(); mFreeKickPos[2] = mBallRadius; - list > agent_states; + list > agent_states; if (! SoccerBase::GetAgentStates(*mBallState, agent_states, idx)) { return false; @@ -1270,8 +1602,8 @@ // after the first agent touches the ball move to PM_PLAY_ON. the // time when the agent last touches the ball must be after the // change to the OffsideKick mode - shared_ptr agent; - shared_ptr agentState; + boost::shared_ptr agent; + boost::shared_ptr agentState; TTime time; if (! mBallState->GetLastCollidingAgent(agent,time)) { @@ -1303,7 +1635,7 @@ void SoccerRuleAspect::ClearPlayersWithException(const salt::Vector3f& pos, float radius, float min_dist, TTeamIndex idx, - shared_ptr agentState) + boost::shared_ptr agentState) { if (idx == TI_NONE || mBallState.get() == 0) return; std::list > agent_states; @@ -1348,7 +1680,51 @@ } } -Vector2f SoccerRuleAspect::GetFieldSize() const +Vector2f +SoccerRuleAspect::GetFieldSize() const { return Vector2f(mFieldLength,mFieldWidth); } + +void +SoccerRuleAspect::ResetAgentSelection() +{ + std::list > agent_states; + if (SoccerBase::GetAgentStates(*mBallState.get(), agent_states, TI_NONE)) + { + + std::list >::const_iterator i; + for (i = agent_states.begin(); i != agent_states.end(); ++i) + (*i)->UnSelect(); + } +} + +void +SoccerRuleAspect::SelectNextAgent() +{ + std::list > agent_states; + bool selectNext = false; + if (SoccerBase::GetAgentStates(*mBallState.get(), agent_states, TI_NONE) && agent_states.size() > 0) + { + boost::shared_ptr first = agent_states.front(); + + std::list >::const_iterator i; + for (i = agent_states.begin(); i != agent_states.end(); ++i) + { + if ((*i)->IsSelected()) + { + (*i)->UnSelect(); + selectNext = true; + continue; + } + else if (selectNext) + { + (*i)->Select(); + return; + } + } + + // No agent selected, select first + first->Select(); + } +} diff -Nru rcssserver3d-0.6.3/plugin/soccer/soccerruleaspect/soccerruleaspect.h rcssserver3d-0.6.4/plugin/soccer/soccerruleaspect/soccerruleaspect.h --- rcssserver3d-0.6.3/plugin/soccer/soccerruleaspect/soccerruleaspect.h 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/soccerruleaspect/soccerruleaspect.h 2010-06-08 09:38:29.000000000 +0100 @@ -4,7 +4,7 @@ Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group - $Id: soccerruleaspect.h 21 2009-01-14 14:38:57Z yxu $ + $Id: soccerruleaspect.h 207 2010-06-01 13:04:58Z sgvandijk $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -36,7 +36,7 @@ namespace oxygen { - class Body; + class RigidBody; class AgentAspect; class Transform; } @@ -45,7 +45,7 @@ { public: typedef std::list > TAgentStateList; - + public: SoccerRuleAspect(); virtual ~SoccerRuleAspect(); @@ -64,6 +64,48 @@ \param pos position where the ball should be dropped- */ void DropBall(salt::Vector3f pos); + + /** Calculates the out of the field reposition pos for a given agent with unum and team idx + Agents are repositioned outside of the field near the mid field line on the opposite yy side + regarding the ball position + */ + salt::Vector3f RepositionOutsidePos(salt::Vector3f initPos, int unum, TTeamIndex idx); + + /** Calculates the inside field reposition pos for a given agent with unum and team idx + Agents are repositioned at distance from the ball, that is, at: plpos + (plpos-ballpos).normalize()*dist + */ + //salt::Vector3f RepositionInsidePos(salt::Vector3f initPos, int unum, TTeamIndex idx, float distance); + + /** New rules for repositioning players that commit faults + */ + void ClearPlayersAutomatic(TTeamIndex idx); + + /** Calculates distance arrays needed for repositioning players + */ + void CalculateDistanceArrays(TTeamIndex idx); + + /** Calculates ordering on a distance vector */ + void SimpleOrder(float dArr[][3], int oArr[][3], TTeamIndex idx); + + /** Agent state concerining standing, laying down on the ground are processed + */ + void processAgentState(salt::Vector3f pos, int unum, TTeamIndex idx); + + /** Reset the fault time counter for all players and also other counters + */ + void ResetFaultCounter(TTeamIndex idx); + + /** Reset the fault time counter for a given player + */ + void ResetFaultCounterPlayer(int unum, TTeamIndex idx); + + /**Analyse Faults from players and increase fault counter of offending players + */ + void AnalyseFaults(TTeamIndex idx); + + /** Automatic Referee that clears players that violate the rules + */ + void AutomaticSimpleReferee(TPlayMode playMode); /** broadcast a said message to all players \param message said message- @@ -95,7 +137,14 @@ * @return the length and width */ salt::Vector2f GetFieldSize() const; + + + void ResetAgentSelection(); + void SelectNextAgent(); + + void ClearSelectedPlayers(); + protected: /** rereads the current soccer script values */ virtual void UpdateCachedInternal(); @@ -190,10 +239,10 @@ * @param idx the team which kick off */ void ClearPlayersBeforeKickOff(TTeamIndex idx); - + protected: /** reference to the body node of the Ball */ - boost::shared_ptr mBallBody; + boost::shared_ptr mBallBody; /** reference to the GameStateAspect */ CachedPath mGameState; @@ -203,21 +252,15 @@ /** the radius of the Ball */ float mBallRadius; - /** the length of the pause after a goal */ float mGoalPauseTime; - /** the length of the pause after the ball left the field */ float mKickInPauseTime; - /** the length of one game half */ float mHalfTime; - /** the time we wait before dropping the ball in play modes where only - one team can touch the ball - */ + one team can touch the ball */ float mDropBallTime; - /** the point above the ground, where the ball left the field */ salt::Vector3f mLastValidBallPos; /** the field length (in meters) */ @@ -241,6 +284,43 @@ float mWaitBeforeKickOff; /** flag if we want to play only one half of the match */ bool mSingleHalfTime; + + //FCP 2010 - New Parameters (added by FCPortugal for Singapure 2010) + /** max time player may be sitted or laying down before being repositioned */ + int mNotStandingMaxTime; + /** max time player may be on the ground before being repositioned */ + int mGroundMaxTime; + /** max time goalie may be sitted or laying down before being repositioned */ + int mGoalieNotStandingMaxTime; + /** max time goalie (player number 1) may be on the ground before being repositioned */ + int mGoalieGroundMaxTime; + /** min dist for second closest of team before being repositioned */ + float mMin2PlDistance; + /** min dist for third closest of team before being repositioned */ + float mMin3PlDistance; + /** min dist for closest Opponent to ball in order to use repositions for the second and third player*/ + float mMinOppDistance; + /** maximum number of players of the defending team that may be inside own penalty area */ + int mMaxPlayersInsideOwnArea; + /** maximum time allowed for a player to commit a positional fault before being repositioned */ + int mMaxFaultTime; + /* Useful arrays for dealing with agent state an faults */ + salt::Vector3f playerPos[12][3]; //Players Positions - not used + int playerGround[12][3]; //Time Players are on the ground + int playerNotStanding[12][3]; //Time Players are not standing (head up for more than 0.5s) + int playerInsideOwnArea[12][3]; //Player is inside own area + int prevPlayerInsideOwnArea[12][3]; //Player was inside own area last cycle + int playerStanding[12][3]; //Time Players are standing + float distArr[12][3]; //Distance array to ball (left/right team) + int ordArr[12][3]; //Distance order of players (left/right team) + float distGArr[12][3]; //Distance array to own goal (left/right team) + int ordGArr[12][3]; //Distance order of players to own goal (left/right team) + int playerFaultTime[12][3]; //Time player is commiting a positional fault + int numPlInsideOwnArea[3]; //Number of players inside own area + int closestPlayer[3]; //Closest Player from each team + float closestPlayerDist[3]; //Closest Player distance to ball from each team + /* FCP 2010 - New Parameters */ + // areas where opponents are not allowed in certain play modes /** bounding box for the right half of the field */ salt::AABB2 mRightHalf; diff -Nru rcssserver3d-0.6.3/plugin/soccer/trainercommandparser/trainercommandparser.cpp rcssserver3d-0.6.4/plugin/soccer/trainercommandparser/trainercommandparser.cpp --- rcssserver3d-0.6.3/plugin/soccer/trainercommandparser/trainercommandparser.cpp 2010-01-18 21:17:05.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/trainercommandparser/trainercommandparser.cpp 2010-06-08 09:38:29.000000000 +0100 @@ -23,16 +23,18 @@ */ -#include +#include #include #include #include #include #include +#include #include "trainercommandparser.h" using namespace std; using namespace boost; +using namespace salt; using namespace zeitgeist; using namespace oxygen; @@ -45,7 +47,10 @@ mCommandMap["dropBall"] = CT_DROP_BALL; mCommandMap["kickOff"] = CT_KICK_OFF; mCommandMap["getAck"] = CT_ACK; - + mCommandMap["select"] = CT_SELECT; + mCommandMap["kill"] = CT_KILL; + mCommandMap["repos"] = CT_REPOS; + // setup team index map // Originally team sides were "L","R" and "N" // But this seems to be unused @@ -106,6 +111,15 @@ GetLog()->Error() << "ERROR: (TrainerCommnadParser) failed to create SexpParser\n"; return; } + + mGameControl = shared_dynamic_cast + (GetCore()->Get("/sys/server/gamecontrol")); + + if (mGameControl.get() == 0) + { + GetLog()->Error() << "ERROR: (TrainerCommandParser) Unable to get GameControlServer\n"; + } + } void TrainerCommandParser::OnUnlink() @@ -121,7 +135,7 @@ return; } - shared_ptr predList = mSexpParser->Parse(data); + boost::shared_ptr predList = mSexpParser->Parse(data); ParsePredicates(*predList); } @@ -189,6 +203,15 @@ break; } + case CT_SELECT: + ParseSelectCommand(predicate); + break; + case CT_KILL: + ParseKillCommand(predicate); + break; + case CT_REPOS: + ParseReposCommand(predicate); + break; default: return false; } @@ -200,17 +223,17 @@ { Predicate::Iterator unumParam(predicate); int unum; + bool specified = true; // extract unum if (predicate.FindParameter(unumParam, "unum")) { if (! predicate.GetValue(unumParam, unum)) - { - GetLog()->Error() << "(TrainerCommandParser) ERROR: can't get unum\n"; - return; - } + specified = false; } - + else + specified = false; + string team; TTeamIndex idx; Predicate::Iterator teamParam(predicate); @@ -219,26 +242,29 @@ if (predicate.FindParameter(teamParam, "team")) { if (! predicate.GetValue(teamParam, team)) - { - GetLog()->Error() << "(TrainerCommandParser) ERROR: can't get team name\n"; - return; - } - - idx = mTeamIndexMap[team]; + specified = false; + else + idx = mTeamIndexMap[team]; } + else + specified = false; + if (!specified) + { + mSoccerRule->ClearSelectedPlayers(); + return; + } SoccerBase::TAgentStateList agentStates; - SoccerBase::GetAgentStates(*this, agentStates, idx); + SoccerBase::GetAgentStates(*this, agentStates, (specified ? idx : TI_NONE)); SoccerBase::TAgentStateList::iterator iter = agentStates.begin(); bool found = false; while (iter != agentStates.end() && !found) { - if ((*iter)->GetUniformNumber() == unum) - { - found = true; - } + if ((specified && (*iter)->GetUniformNumber() == unum && (*iter)->GetTeamIndex() == idx) || + (!specified && (*iter)->IsSelected())) + found = true; else ++iter; } @@ -250,7 +276,6 @@ } Predicate::Iterator posParam(predicate); - if (predicate.FindParameter(posParam, "pos")) { salt::Vector3f pos; @@ -262,7 +287,7 @@ return; } - shared_ptr agent_aspect; + boost::shared_ptr agent_aspect; if (SoccerBase::GetTransformParent(*(*iter), agent_aspect)) { @@ -295,7 +320,7 @@ return; } - shared_ptr agent_aspect; + boost::shared_ptr agent_aspect; if (SoccerBase::GetTransformParent(*(*iter), agent_aspect)) { @@ -365,7 +390,7 @@ return; } - shared_ptr body; + boost::shared_ptr body; if (SoccerBase::GetBallBody(*this, body)) { @@ -394,7 +419,7 @@ return; } - shared_ptr body; + boost::shared_ptr body; if (SoccerBase::GetBallBody(*this, body)) { @@ -477,3 +502,200 @@ } } +void TrainerCommandParser::ParseSelectCommand(const oxygen::Predicate & predicate) +{ + Predicate::Iterator unumParam(predicate); + int unum; + bool specified = true; + + shared_ptr soccerRuleAspect; + if (!SoccerBase::GetSoccerRuleAspect(*this, soccerRuleAspect)) + { + GetLog()->Error() << "(TrainerCommandParser) ERROR: can't get soccer rule aspect\n"; + return; + } + + // extract unum + if (predicate.FindParameter(unumParam, "unum")) + { + if (! predicate.GetValue(unumParam, unum)) + specified = false; + } + else + specified = false; + + if (specified && unum == -1) + { + soccerRuleAspect->ResetAgentSelection(); + return; + } + + string team; + TTeamIndex idx; + Predicate::Iterator teamParam(predicate); + + // extract side + if (predicate.FindParameter(teamParam, "team")) + { + if (! predicate.GetValue(teamParam, team)) + specified = false; + else + idx = mTeamIndexMap[team]; + } + else + specified = false; + + if (!specified) + { + soccerRuleAspect->SelectNextAgent(); + return; + } + + SoccerBase::TAgentStateList agentStates; + SoccerBase::GetAgentStates(*this, agentStates, idx); + SoccerBase::TAgentStateList::iterator iter = agentStates.begin(); + bool found = false; + + while (iter != agentStates.end() && !found) + { + if ((*iter)->GetUniformNumber() == unum) + { + found = true; + } + else + ++iter; + } + + if (!found) + { + GetLog()->Error() << "(TrainerCommandParser) ERROR: can't get correct AgentState\n"; + return; + } + + soccerRuleAspect->ResetAgentSelection(); + (*iter)->Select(); +} + +void TrainerCommandParser::ParseKillCommand(const oxygen::Predicate & predicate) +{ + Predicate::Iterator unumParam(predicate); + int unum; + bool specified = true; + + shared_ptr soccerRuleAspect; + if (!SoccerBase::GetSoccerRuleAspect(*this, soccerRuleAspect)) + { + GetLog()->Error() << "(TrainerCommandParser) ERROR: can't get soccer rule aspect\n"; + return; + } + + // extract unum + if (predicate.FindParameter(unumParam, "unum")) + { + if (! predicate.GetValue(unumParam, unum)) + specified = false; + } + else + specified = false; + + string team; + TTeamIndex idx; + Predicate::Iterator teamParam(predicate); + + // extract side + if (predicate.FindParameter(teamParam, "team")) + { + if (! predicate.GetValue(teamParam, team)) + specified = false; + else + idx = mTeamIndexMap[team]; + } + else + specified = false; + + GameControlServer::TAgentAspectList agentAspects; + mGameControl->GetAgentAspectList(agentAspects); + GameControlServer::TAgentAspectList::iterator aaiter; + for ( + aaiter = agentAspects.begin(); + aaiter != agentAspects.end(); + ++aaiter + ) + { + // search for the first agent of the left/right side + boost::shared_ptr agentState = + shared_dynamic_cast((*aaiter)->GetChild("AgentState", true)); + + if ((specified && agentState->GetUniformNumber() == unum && agentState->GetTeamIndex() == idx) || + (!specified && agentState->IsSelected())) + { + mGameControl->pushDisappearedAgent((*aaiter)->ID()); + break; + } + } +} + +void TrainerCommandParser::ParseReposCommand(const oxygen::Predicate & predicate) +{ + cerr << "repos 2" << endl; + + Predicate::Iterator unumParam(predicate); + int unum; + bool specified = true; + + shared_ptr soccerRuleAspect; + if (!SoccerBase::GetSoccerRuleAspect(*this, soccerRuleAspect)) + { + GetLog()->Error() << "(TrainerCommandParser) ERROR: can't get soccer rule aspect\n"; + return; + } + + // extract unum + if (predicate.FindParameter(unumParam, "unum")) + { + if (! predicate.GetValue(unumParam, unum)) + specified = false; + } + else + specified = false; + + string team; + TTeamIndex idx; + Predicate::Iterator teamParam(predicate); + + // extract side + if (predicate.FindParameter(teamParam, "team")) + { + if (! predicate.GetValue(teamParam, team)) + specified = false; + else + idx = mTeamIndexMap[team]; + } + else + specified = false; + + SoccerBase::TAgentStateList agentStates; + SoccerBase::GetAgentStates(*this, agentStates, TI_NONE); + SoccerBase::TAgentStateList::iterator iter = agentStates.begin(); + boost::shared_ptr agent_aspect; + for (;iter != agentStates.end(); ++iter) + { + if ((specified && (*iter)->GetUniformNumber() == unum && (*iter)->GetTeamIndex() == idx) || + (!specified && (*iter)->IsSelected())) + { + Vector3f ballPos(0,0,0); + boost::shared_ptr ballBody; + + if (SoccerBase::GetBallBody(*this, ballBody)) + ballPos = ballBody->GetPosition(); + + SoccerBase::GetTransformParent(**iter, agent_aspect); + cerr << "repos 3" << endl; + Vector3f new_pos = mSoccerRule->RepositionOutsidePos(ballPos, (*iter)->GetUniformNumber(), (*iter)->GetTeamIndex()); + SoccerBase::MoveAgent(agent_aspect, new_pos); + + break; + } + } +} + diff -Nru rcssserver3d-0.6.3/plugin/soccer/trainercommandparser/trainercommandparser.h rcssserver3d-0.6.4/plugin/soccer/trainercommandparser/trainercommandparser.h --- rcssserver3d-0.6.3/plugin/soccer/trainercommandparser/trainercommandparser.h 2010-01-18 21:17:05.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/trainercommandparser/trainercommandparser.h 2010-06-08 09:38:29.000000000 +0100 @@ -33,6 +33,11 @@ #include #include +namespace oxygen +{ + class GameControlServer; +} + class TrainerCommandParser : public oxygen::MonitorCmdParser { public: @@ -44,7 +49,10 @@ CT_PLAYMODE, CT_DROP_BALL, CT_KICK_OFF, - CT_ACK + CT_ACK, + CT_SELECT, + CT_KILL, + CT_REPOS }; typedef std::map TCommandMap; @@ -100,7 +108,21 @@ predicate */ void ParseKickOffCommand(const oxygen::Predicate & predicate); + + /** parses and executes the select command contained in the given + predicate + */ + void ParseSelectCommand(const oxygen::Predicate & predicate); + /** parses and executes the kill command contained in the given + predicate + */ + void ParseKillCommand(const oxygen::Predicate & predicate); + + /** parses and executes the reposition command contained in the given + predicate + */ + void ParseReposCommand(const oxygen::Predicate & predicate); protected: TCommandMap mCommandMap; @@ -114,6 +136,8 @@ boost::shared_ptr mSoccerRule; //! the parser used to create the PredicateList boost::shared_ptr mSexpParser; + //! cached reference to the game control server + boost::shared_ptr mGameControl; bool mGetAck; std::string mAckString; diff -Nru rcssserver3d-0.6.3/plugin/soccer/visionperceptor/visionperceptor.cpp rcssserver3d-0.6.4/plugin/soccer/visionperceptor/visionperceptor.cpp --- rcssserver3d-0.6.3/plugin/soccer/visionperceptor/visionperceptor.cpp 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccer/visionperceptor/visionperceptor.cpp 2010-06-08 09:38:29.000000000 +0100 @@ -4,7 +4,7 @@ Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group - $Id: visionperceptor.cpp 21 2009-01-14 14:38:57Z yxu $ + $Id: visionperceptor.cpp 181 2010-02-28 10:55:34Z marianbuchta $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -76,7 +76,7 @@ // SoccerBase::GetAgentState(*this, mAgentState); SoccerBase::GetActiveScene(*this,mActiveScene); - shared_ptr agent_aspect = + boost::shared_ptr agent_aspect = FindParentSupportingClass().lock(); if (agent_aspect == 0) { @@ -168,7 +168,7 @@ continue; // this should never happen } - shared_ptr j = od.mObj->GetTransformParent(); + boost::shared_ptr j = od.mObj->GetTransformParent(); if (j.get() == 0) { @@ -411,7 +411,7 @@ // dContactGeom contact; -// shared_ptr collider = shared_static_cast +// boost::shared_ptr collider = shared_static_cast // (i->mObj->GetChildSupportingClass("Collider")); // if (mRay->Intersects(collider)) diff -Nru rcssserver3d-0.6.3/plugin/soccermonitor/soccerinput.cpp rcssserver3d-0.6.4/plugin/soccermonitor/soccerinput.cpp --- rcssserver3d-0.6.3/plugin/soccermonitor/soccerinput.cpp 2010-01-18 21:17:05.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccermonitor/soccerinput.cpp 2010-06-08 09:38:29.000000000 +0100 @@ -2,7 +2,7 @@ this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2003 Koblenz University - $Id: soccerinput.cpp 69 2009-06-16 09:53:55Z sgvandijk $ + $Id: soccerinput.cpp 207 2010-06-01 13:04:58Z sgvandijk $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -21,16 +21,18 @@ #include #include #include "soccermonitor.h" -#include +#include #include using namespace boost; using namespace zeitgeist; using namespace oxygen; using namespace kerosin; +using namespace std; SoccerInput::SoccerInput() - : InputItem() + : InputItem(), + mCmdMode(CmdModeDefault) { } @@ -40,7 +42,7 @@ void SoccerInput::OnLink() { - shared_ptr scriptServer = GetCore()->GetScriptServer(); + boost::shared_ptr scriptServer = GetCore()->GetScriptServer(); scriptServer->CreateVariable("Command.KickOff", CmdKickOff); scriptServer->CreateVariable("Command.KickOffRight", CmdKickOffRight); scriptServer->CreateVariable("Command.MoveAgent", CmdMoveAgent); @@ -55,9 +57,25 @@ scriptServer->CreateVariable("Command.CameraRightCorner", CmdCameraRightCorner); scriptServer->CreateVariable("Command.CameraRightGoal", CmdCameraRightGoal); //JAN - scriptServer->CreateVariable("Command.FreeKickLeft", CmdFreeKickLeft); - scriptServer->CreateVariable("Command.FreeKickRight", CmdFreeKickRight); - + scriptServer->CreateVariable("Command.One", CmdOne); + scriptServer->CreateVariable("Command.Two", CmdTwo); + scriptServer->CreateVariable("Command.Three", CmdThree); + scriptServer->CreateVariable("Command.Four", CmdFour); + scriptServer->CreateVariable("Command.Five", CmdFive); + scriptServer->CreateVariable("Command.Six", CmdSix); + scriptServer->CreateVariable("Command.Seven", CmdSeven); + scriptServer->CreateVariable("Command.Eight", CmdEight); + scriptServer->CreateVariable("Command.Nine", CmdNine); + scriptServer->CreateVariable("Command.Zero", CmdZero); + scriptServer->CreateVariable("Command.Left", CmdLeft); + scriptServer->CreateVariable("Command.Right", CmdRight); + + scriptServer->CreateVariable("Command.PlayerSelectMode", CmdPlayerSelectMode); + scriptServer->CreateVariable("Command.SelectNextAgent", CmdSelectNextAgent); + scriptServer->CreateVariable("Command.ResetSelection", CmdResetSelection); + scriptServer->CreateVariable("Command.KillSelection", CmdKillSelection); + scriptServer->CreateVariable("Command.ReposSelection", CmdReposSelection); + mMonitorClient = shared_dynamic_cast (GetCore()->Get("/sys/server/simulation/SparkMonitorClient")); @@ -68,7 +86,7 @@ } // get camera body - mCameraBody = shared_dynamic_cast + mCameraBody = shared_dynamic_cast (GetCore()->Get("/usr/scene/camera/physics")); if (mCameraBody.get() == 0) @@ -107,143 +125,213 @@ void SoccerInput::ProcessInput(const Input& input) { - // get list of registered SoccerMonitor objects - TLeafList soccerMonitorList; - mMonitorClient->ListChildrenSupportingClass(soccerMonitorList); - - if (soccerMonitorList.empty()) - { - GetLog()->Error() - << "ERROR: (SoccerInput) Unable to get SoccerMonitor\n"; - return; - } - - shared_ptr soccerMonitor = - shared_static_cast(soccerMonitorList.front()); - switch (input.mId) { default: return; - case CmdKickOff: + case CmdPlayerSelectMode: if (input.GetKeyPress()) - { - SendCommand("(kickOff Left)"); - } + { + mCmdMode = CmdModePlayerSelect; + } break; - case CmdKickOffRight: + + case CmdSelectNextAgent: if (input.GetKeyPress()) { - SendCommand("(kickOff Right)"); + SendCommand("(select)"); } break; - - case CmdMoveAgent: + + case CmdResetSelection: if (input.GetKeyPress()) { - //SendCommand("(agent (team Left)(unum 1)(pos -2.0 1.0 3.5))"); + SendCommand("(select (unum -1))"); } break; - case CmdDropBall: + + case CmdKillSelection: if (input.GetKeyPress()) { - SendCommand("(dropBall)"); + SendCommand("(kill)"); } break; - case CmdShootBall: + + case CmdReposSelection: if (input.GetKeyPress()) { - //SendCommand("(ball (vel -4.0 0.0 2.0))"); + SendCommand("(repos)"); } break; - case CmdMoveBall: - if (input.GetKeyPress()) - { - //SendCommand("(ball (pos -42.0 0.0 0.3))"); - } - break; - case CmdCameraLeftGoal: - if (input.GetKeyPress()) - { - salt::Vector2f fieldSize = soccerMonitor->GetFieldSize(); - salt::Vector3f pos(-fieldSize.x()*0.8, 0.0, fieldSize.x()*0.4); - mCameraBody->SetPosition(pos); - mFPS->SetHAngleDeg(90); - mFPS->SetVAngleDeg(35); - } - break; - case CmdCameraLeftCorner: - if (input.GetKeyPress()) - { - salt::Vector2f fieldSize = soccerMonitor->GetFieldSize(); - salt::Vector3f pos(-fieldSize.x()*0.8, -fieldSize.y(), fieldSize.x()*0.4); - mCameraBody->SetPosition(pos); - mFPS->SetHAngleDeg(50); - mFPS->SetVAngleDeg(30); - } - break; - case CmdCameraMiddleLeft: + + case CmdKickOff: if (input.GetKeyPress()) { - salt::Vector2f fieldSize = soccerMonitor->GetFieldSize(); - salt::Vector3f pos(0, -fieldSize.y(), fieldSize.x()*0.4); - mCameraBody->SetPosition(pos); - mFPS->SetHAngleDeg(salt::gRadToDeg(-0.625)); - mFPS->SetVAngleDeg(40); + SendCommand("(kickOff Left)"); } break; - case CmdCameraMiddleRight: + case CmdKickOffRight: if (input.GetKeyPress()) { - salt::Vector2f fieldSize = soccerMonitor->GetFieldSize(); - salt::Vector3f pos(0, -fieldSize.y(), fieldSize.x()*0.4); - mCameraBody->SetPosition(pos); - mFPS->SetHAngleDeg(salt::gRadToDeg(0.625)); - mFPS->SetVAngleDeg(40); + SendCommand("(kickOff Right)"); } break; - case CmdCameraMiddle: + + case CmdMoveAgent: if (input.GetKeyPress()) { - salt::Vector2f fieldSize = soccerMonitor->GetFieldSize(); - salt::Vector3f pos(0, -fieldSize.y()*1.1, fieldSize.x()*0.6); - mCameraBody->SetPosition(pos); - mFPS->SetHAngleDeg(0); - mFPS->SetVAngleDeg(45); + SendCommand("(agent)"); } break; - case CmdCameraRightCorner: + case CmdDropBall: if (input.GetKeyPress()) { - salt::Vector2f fieldSize = soccerMonitor->GetFieldSize(); - salt::Vector3f pos(fieldSize.x()*0.8, -fieldSize.y(), fieldSize.x()*0.4); - mCameraBody->SetPosition(pos); - mFPS->SetHAngleDeg(-50); - mFPS->SetVAngleDeg(30); + SendCommand("(dropBall)"); } break; - case CmdCameraRightGoal: + case CmdShootBall: if (input.GetKeyPress()) { - salt::Vector2f fieldSize = soccerMonitor->GetFieldSize(); - salt::Vector3f pos(fieldSize.x()*0.8, 0.0, fieldSize.x()*0.4); - mCameraBody->SetPosition(pos); - mFPS->SetHAngleDeg(-90); - mFPS->SetVAngleDeg(35); + //SendCommand("(ball (vel -4.0 0.0 2.0))"); } break; - case CmdFreeKickLeft: + case CmdMoveBall: if (input.GetKeyPress()) { - SendCommand("(playMode free_kick_left)"); + //SendCommand("(ball (pos -42.0 0.0 0.3))"); } break; - case CmdFreeKickRight: - if (input.GetKeyPress()) - { - SendCommand("(playMode free_kick_right)"); + + case CmdOne: + case CmdTwo: + case CmdThree: + case CmdFour: + case CmdFive: + case CmdSix: + case CmdSeven: + case CmdEight: + case CmdNine: + case CmdZero: + if (input.GetKeyPress()) + { + if (mCmdMode == CmdModeDefault) + SelectCamera(input.mId - CmdOne); + else + { + ostringstream u_ss; + u_ss << "(select (unum " << (input.mId - CmdOne + 1) << ") "; + if (mCmdMode == CmdModeLeftPlayerSelect) + { + u_ss << "(team Left))"; + SendCommand(u_ss.str()); + mCmdMode = CmdModeDefault; + } + else if (mCmdMode == CmdModeRightPlayerSelect) + { + u_ss << "(team Right))"; + SendCommand(u_ss.str()); + mCmdMode = CmdModeDefault; + } + } + } + break; + case CmdLeft: + if (input.GetKeyPress()) + { + if (mCmdMode == CmdModeDefault) + SendCommand("(playMode free_kick_left)"); + else if (mCmdMode == CmdModePlayerSelect || mCmdMode == CmdModeRightPlayerSelect) + mCmdMode = CmdModeLeftPlayerSelect; + } + break; + case CmdRight: + if (input.GetKeyPress()) + { + if (mCmdMode == CmdModeDefault) + SendCommand("(playMode free_kick_right)"); + else if (mCmdMode == CmdModePlayerSelect || mCmdMode == CmdModeLeftPlayerSelect) + mCmdMode = CmdModeRightPlayerSelect; } break; }; } + +void SoccerInput::SelectCamera(int idx) +{ + // get list of registered SoccerMonitor objects + TLeafList soccerMonitorList; + mMonitorClient->ListChildrenSupportingClass(soccerMonitorList); + + if (soccerMonitorList.empty()) + { + GetLog()->Error() + << "ERROR: (SoccerInput) Unable to get SoccerMonitor\n"; + return; + } + + boost::shared_ptr soccerMonitor = + shared_static_cast(soccerMonitorList.front()); + + salt::Vector2f fieldSize = soccerMonitor->GetFieldSize(); + + switch (idx) + { + case 0: + { + salt::Vector3f pos(-fieldSize.x()*0.8, 0.0, fieldSize.x()*0.4); + mCameraBody->SetPosition(pos); + mFPS->SetHAngleDeg(90); + mFPS->SetVAngleDeg(35); + } + break; + case 1: + { + salt::Vector3f pos(-fieldSize.x()*0.8, -fieldSize.y(), fieldSize.x()*0.4); + mCameraBody->SetPosition(pos); + mFPS->SetHAngleDeg(50); + mFPS->SetVAngleDeg(30); + } + break; + case 2: + { + salt::Vector3f pos(0, -fieldSize.y(), fieldSize.x()*0.4); + mCameraBody->SetPosition(pos); + mFPS->SetHAngleDeg(salt::gRadToDeg(-0.625)); + mFPS->SetVAngleDeg(40); + } + break; + case 3: + { + salt::Vector3f pos(0, -fieldSize.y()*1.1, fieldSize.x()*0.6); + mCameraBody->SetPosition(pos); + mFPS->SetHAngleDeg(0); + mFPS->SetVAngleDeg(45); + } + break; + case 4: + { + salt::Vector3f pos(0, -fieldSize.y(), fieldSize.x()*0.4); + mCameraBody->SetPosition(pos); + mFPS->SetHAngleDeg(salt::gRadToDeg(0.625)); + mFPS->SetVAngleDeg(40); + } + break; + case 5: + { + salt::Vector3f pos(fieldSize.x()*0.8, -fieldSize.y(), fieldSize.x()*0.4); + mCameraBody->SetPosition(pos); + mFPS->SetHAngleDeg(-50); + mFPS->SetVAngleDeg(30); + } + break; + case 6: + { + salt::Vector3f pos(fieldSize.x()*0.8, 0.0, fieldSize.x()*0.4); + mCameraBody->SetPosition(pos); + mFPS->SetHAngleDeg(-90); + mFPS->SetVAngleDeg(35); + } + break; + } +} diff -Nru rcssserver3d-0.6.3/plugin/soccermonitor/soccerinput.h rcssserver3d-0.6.4/plugin/soccermonitor/soccerinput.h --- rcssserver3d-0.6.3/plugin/soccermonitor/soccerinput.h 2010-01-18 21:17:05.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccermonitor/soccerinput.h 2010-06-08 09:38:29.000000000 +0100 @@ -2,7 +2,7 @@ this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2003 Koblenz University - $Id: soccerinput.h 69 2009-06-16 09:53:55Z sgvandijk $ + $Id: soccerinput.h 207 2010-06-01 13:04:58Z sgvandijk $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -27,7 +27,7 @@ namespace oxygen { class FPSController; - class Body; + class RigidBody; } class SoccerInput : public kerosin::InputItem @@ -49,9 +49,36 @@ CmdCameraMiddle = CmdCameraMiddleRight + 1, CmdCameraRightCorner = CmdCameraMiddle + 1, CmdCameraRightGoal = CmdCameraRightCorner + 1, + + CmdOne = CmdCameraRightGoal + 1, + CmdTwo = CmdOne + 1, + CmdThree = CmdTwo + 1, + CmdFour = CmdThree + 1, + CmdFive = CmdFour + 1, + CmdSix = CmdFive + 1, + CmdSeven = CmdSix + 1, + CmdEight = CmdSeven + 1, + CmdNine = CmdEight + 1, + CmdZero = CmdNine + 1, + //JAN - CmdFreeKickLeft = CmdCameraRightGoal + 1, - CmdFreeKickRight = CmdFreeKickLeft + 1 + CmdLeft = CmdZero + 1, + CmdRight = CmdLeft + 1, + + CmdPlayerSelectMode = CmdRight + 1, + CmdSelectNextAgent = CmdPlayerSelectMode + 1, + CmdResetSelection = CmdSelectNextAgent + 1, + CmdKillSelection = CmdResetSelection + 1, + CmdReposSelection = CmdKillSelection + 1 + }; + + enum ECmdMode + { + CmdModeDefault = 1, + CmdModePlayerSelect, + CmdModeLeftPlayerSelect, + CmdModeRightPlayerSelect, + CmdModeNone }; public: @@ -71,17 +98,22 @@ /** reset SparkMonitorClient reference */ virtual void OnUnlink(); + ECmdMode GetCmdMode() const { return mCmdMode; } + protected: void SendCommand(const std::string& cmd); + void SelectCamera(int idx); protected: /** cached reference to the monitor client */ boost::shared_ptr mMonitorClient; /** cached reference to the camera body */ - boost::shared_ptr mCameraBody; + boost::shared_ptr mCameraBody; boost::shared_ptr mFPS; + + ECmdMode mCmdMode; }; DECLARE_CLASS(SoccerInput); diff -Nru rcssserver3d-0.6.3/plugin/soccermonitor/soccerinputlogplayer.cpp rcssserver3d-0.6.4/plugin/soccermonitor/soccerinputlogplayer.cpp --- rcssserver3d-0.6.3/plugin/soccermonitor/soccerinputlogplayer.cpp 2010-01-18 21:17:05.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccermonitor/soccerinputlogplayer.cpp 2010-06-08 09:38:29.000000000 +0100 @@ -2,7 +2,7 @@ this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2003 Koblenz University - $Id: soccerinputlogplayer.cpp 62 2009-04-30 16:03:43Z sgvandijk $ + $Id: soccerinputlogplayer.cpp 176 2010-02-25 12:19:37Z a-held $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,7 +20,7 @@ #include "soccerinputlogplayer.h" #include #include -#include +#include using namespace boost; using namespace zeitgeist; @@ -71,7 +71,7 @@ } // get camera body - mCameraBody = shared_dynamic_cast + mCameraBody = shared_dynamic_cast (GetCore()->Get("/usr/scene/camera/physics")); if (mCameraBody.get() == 0) diff -Nru rcssserver3d-0.6.3/plugin/soccermonitor/soccerinputlogplayer.h rcssserver3d-0.6.4/plugin/soccermonitor/soccerinputlogplayer.h --- rcssserver3d-0.6.3/plugin/soccermonitor/soccerinputlogplayer.h 2010-01-18 21:17:05.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccermonitor/soccerinputlogplayer.h 2010-06-08 09:38:29.000000000 +0100 @@ -2,7 +2,7 @@ this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2003 Koblenz University - $Id: soccerinputlogplayer.h 62 2009-04-30 16:03:43Z sgvandijk $ + $Id: soccerinputlogplayer.h 176 2010-02-25 12:19:37Z a-held $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -72,7 +72,7 @@ boost::shared_ptr mScriptServer; /** cached reference to the camera body */ - boost::shared_ptr mCameraBody; + boost::shared_ptr mCameraBody; /** cached reference to the camera body */ boost::shared_ptr mFPS; diff -Nru rcssserver3d-0.6.3/plugin/soccermonitor/soccerrender.cpp rcssserver3d-0.6.4/plugin/soccermonitor/soccerrender.cpp --- rcssserver3d-0.6.3/plugin/soccermonitor/soccerrender.cpp 2010-01-18 21:17:05.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccermonitor/soccerrender.cpp 2010-06-08 09:38:29.000000000 +0100 @@ -3,7 +3,7 @@ Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group - $Id: soccerrender.cpp 9 2008-11-24 02:39:02Z hedayat $ + $Id: soccerrender.cpp 207 2010-06-01 13:04:58Z sgvandijk $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -23,6 +23,7 @@ #include #include "soccerrender.h" #include "soccermonitor.h" +#include "soccerinput.h" #include #include #include @@ -69,6 +70,13 @@ { GetLog()->Error() << "ERROR: (SoccerRender) Unable to get SoccerMonitor\n"; } + mInput = shared_static_cast + (GetCore()->Get("/sys/server/simulation/InputControl/SoccerInput")); + + if (mInput.get() == 0) + { + GetLog()->Error() << "ERROR: (SoccerRender) Unable to get SoccerInput\n"; + } } void SoccerRender::OnUnlink() @@ -90,7 +98,7 @@ return; } - stringstream ss_l, ss_c, ss_r; + stringstream ss_l, ss_c, ss_r, ss_m; ss_c.setf(ios_base::fixed,ios_base::floatfield); ss_c.precision(2); @@ -141,5 +149,8 @@ xPos = int((1024-(mFont->GetStringWidth(ss_c.str().c_str())))/2); mFont->DrawString(xPos, 0, ss_c.str().c_str()); + //ss_m << mInput->GetCmdMode(); + //mFont->DrawString(10, 30, ss_m.str().c_str()); + mFontServer->End(); } diff -Nru rcssserver3d-0.6.3/plugin/soccermonitor/soccerrender.h rcssserver3d-0.6.4/plugin/soccermonitor/soccerrender.h --- rcssserver3d-0.6.3/plugin/soccermonitor/soccerrender.h 2010-01-18 21:17:05.000000000 +0000 +++ rcssserver3d-0.6.4/plugin/soccermonitor/soccerrender.h 2010-06-08 09:38:29.000000000 +0100 @@ -3,7 +3,7 @@ Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group - $Id: soccerrender.h 9 2008-11-24 02:39:02Z hedayat $ + $Id: soccerrender.h 207 2010-06-01 13:04:58Z sgvandijk $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -32,6 +32,7 @@ } class SoccerMonitor; +class SoccerInput; class SoccerRender : public kerosin::CustomRender { @@ -51,6 +52,7 @@ boost::shared_ptr mMonitor; boost::shared_ptr mFontServer; boost::shared_ptr mFont; + boost::shared_ptr mInput; }; DECLARE_CLASS(SoccerRender); diff -Nru rcssserver3d-0.6.3/rcssagent3d/hoap2behavior.cpp rcssserver3d-0.6.4/rcssagent3d/hoap2behavior.cpp --- rcssserver3d-0.6.3/rcssagent3d/hoap2behavior.cpp 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/rcssagent3d/hoap2behavior.cpp 2010-06-08 09:38:29.000000000 +0100 @@ -175,7 +175,7 @@ // parse message and extract joint angles //cout << "(Hoap2Behavior) received message " << message << endl; - shared_ptr predList = + boost::shared_ptr predList = mParser->Parse(message); if (predList.get() != 0) diff -Nru rcssserver3d-0.6.3/rcssagent3d/naobehavior.cpp rcssserver3d-0.6.4/rcssagent3d/naobehavior.cpp --- rcssserver3d-0.6.3/rcssagent3d/naobehavior.cpp 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/rcssagent3d/naobehavior.cpp 2010-06-08 09:38:29.000000000 +0100 @@ -251,7 +251,7 @@ } // parse message and extract joint angles - shared_ptr predList = mParser->Parse(message); + boost::shared_ptr predList = mParser->Parse(message); if (predList.get() != 0) { diff -Nru rcssserver3d-0.6.3/rcssagent3d/soccerbehavior.cpp rcssserver3d-0.6.4/rcssagent3d/soccerbehavior.cpp --- rcssserver3d-0.6.3/rcssagent3d/soccerbehavior.cpp 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/rcssagent3d/soccerbehavior.cpp 2010-06-08 09:38:29.000000000 +0100 @@ -2,7 +2,7 @@ this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2003 Koblenz University - $Id: soccerbehavior.cpp 9 2008-11-24 02:39:02Z hedayat $ + $Id: soccerbehavior.cpp 181 2010-02-28 10:55:34Z marianbuchta $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -236,7 +236,7 @@ string SoccerBehavior::Think(const std::string& message) { - shared_ptr predList = + boost::shared_ptr predList = mParser->Parse(message); if (predList.get() != 0) diff -Nru rcssserver3d-0.6.3/rcssagent3d/soccerbotbehavior.cpp rcssserver3d-0.6.4/rcssagent3d/soccerbotbehavior.cpp --- rcssserver3d-0.6.3/rcssagent3d/soccerbotbehavior.cpp 2010-01-18 21:17:06.000000000 +0000 +++ rcssserver3d-0.6.4/rcssagent3d/soccerbotbehavior.cpp 2010-06-08 09:38:29.000000000 +0100 @@ -234,7 +234,7 @@ // parse message and extract joint angles //cout << "(SoccerbotBehavior) received message " << message << endl; - shared_ptr predList = + boost::shared_ptr predList = mParser->Parse(message); if (predList.get() != 0) diff -Nru rcssserver3d-0.6.3/rcssmonitor3d/main.cpp rcssserver3d-0.6.4/rcssmonitor3d/main.cpp --- rcssserver3d-0.6.3/rcssmonitor3d/main.cpp 2010-01-18 21:17:07.000000000 +0000 +++ rcssserver3d-0.6.4/rcssmonitor3d/main.cpp 2010-06-08 09:38:29.000000000 +0100 @@ -2,7 +2,7 @@ this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2003 Koblenz University - $Id: main.cpp 133 2010-01-03 17:34:56Z hedayat $ + $Id: main.cpp 181 2010-02-28 10:55:34Z marianbuchta $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -31,7 +31,7 @@ #endif #if __APPLE__ -#include +#include #endif using namespace spark; @@ -142,7 +142,7 @@ GetScriptServer()->Run("rcssmonitor3d.rb"); // tell the inputControl node the loaction of our camera - shared_ptr inputCtr = GetInputControl(); + boost::shared_ptr inputCtr = GetInputControl(); if (inputCtr.get() != 0) { inputCtr->SetFPSController("/usr/scene/camera/physics/controller"); @@ -163,7 +163,7 @@ spark.GetSimulationServer()->Run(argc,argv); - shared_ptr renderCtr = spark.GetRenderControl(); + boost::shared_ptr renderCtr = spark.GetRenderControl(); if (renderCtr.get() != 0) { spark.GetLog()->Normal() diff -Nru rcssserver3d-0.6.3/rcssmonitor3d/soccerbindings.rb rcssserver3d-0.6.4/rcssmonitor3d/soccerbindings.rb --- rcssserver3d-0.6.3/rcssmonitor3d/soccerbindings.rb 2010-01-18 21:17:07.000000000 +0000 +++ rcssserver3d-0.6.4/rcssmonitor3d/soccerbindings.rb 2010-06-08 09:38:29.000000000 +0100 @@ -28,16 +28,33 @@ inputServer.bindCommand('j', Command.KickOffRight); inputServer.bindCommand('b', Command.DropBall); inputServer.bindCommand('m', Command.MoveAgent); - inputServer.bindCommand('n', Command.ShootBall); - inputServer.bindCommand('x', Command.MoveBall); - inputServer.bindCommand('1', Command.CameraLeftGoal); - inputServer.bindCommand('2', Command.CameraLeftCorner); - inputServer.bindCommand('3', Command.CameraMiddleLeft); - inputServer.bindCommand('4', Command.CameraMiddle); - inputServer.bindCommand('5', Command.CameraMiddleRight); - inputServer.bindCommand('6', Command.CameraRightCorner); - inputServer.bindCommand('7', Command.CameraRightGoal); - inputServer.bindCommand('l', Command.FreeKickLeft); - inputServer.bindCommand('r', Command.FreeKickRight); + #inputServer.bindCommand('n', Command.ShootBall); + #inputServer.bindCommand('x', Command.MoveBall); + + #inputServer.bindCommand('1', Command.CameraLeftGoal); + #inputServer.bindCommand('2', Command.CameraLeftCorner); + #inputServer.bindCommand('3', Command.CameraMiddleLeft); + #inputServer.bindCommand('4', Command.CameraMiddle); + #inputServer.bindCommand('5', Command.CameraMiddleRight); + #inputServer.bindCommand('6', Command.CameraRightCorner); + #inputServer.bindCommand('7', Command.CameraRightGoal); + inputServer.bindCommand('1', Command.One); + inputServer.bindCommand('2', Command.Two); + inputServer.bindCommand('3', Command.Three); + inputServer.bindCommand('4', Command.Four); + inputServer.bindCommand('5', Command.Five); + inputServer.bindCommand('6', Command.Six); + inputServer.bindCommand('7', Command.Seven); + inputServer.bindCommand('8', Command.Eight); + inputServer.bindCommand('9', Command.Nine); + inputServer.bindCommand('0', Command.Zero); + + inputServer.bindCommand('l', Command.Left); + inputServer.bindCommand('r', Command.Right); + inputServer.bindCommand('lctrl s', Command.PlayerSelectMode); + inputServer.bindCommand('n', Command.SelectNextAgent); + inputServer.bindCommand('e', Command.ResetSelection); + inputServer.bindCommand('x', Command.KillSelection); + inputServer.bindCommand('p', Command.ReposSelection); end end diff -Nru rcssserver3d-0.6.3/rcssmonitor3d/soccersim-monitor.rb rcssserver3d-0.6.4/rcssmonitor3d/soccersim-monitor.rb --- rcssserver3d-0.6.3/rcssmonitor3d/soccersim-monitor.rb 2010-01-18 21:17:07.000000000 +0000 +++ rcssserver3d-0.6.4/rcssmonitor3d/soccersim-monitor.rb 2010-06-08 09:38:29.000000000 +0100 @@ -13,10 +13,6 @@ # state sparkRegisterCustomMonitor 'SoccerMonitor' -# register the soccer render plugin to draw the game state on the -# screen -sparkRegisterCustomRender 'SoccerRender' - if ($logPlayerMode == true) # register the soccer input logplayer plugin for playback # specific keys @@ -29,3 +25,7 @@ # bind keys to soccer commands run "soccerbindings.rb" +# register the soccer render plugin to draw the game state on the +# screen +sparkRegisterCustomRender 'SoccerRender' + diff -Nru rcssserver3d-0.6.3/rcssserver3d/CMakeLists.txt rcssserver3d-0.6.4/rcssserver3d/CMakeLists.txt --- rcssserver3d-0.6.3/rcssserver3d/CMakeLists.txt 2010-06-08 19:24:17.000000000 +0100 +++ rcssserver3d-0.6.4/rcssserver3d/CMakeLists.txt 2010-06-08 09:38:29.000000000 +0100 @@ -23,8 +23,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/rcsoccersim3d) execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink - ${CMAKE_INSTALL_PREFIX}/${BINDIR}/rcssserver3d - ${CMAKE_CURRENT_BINARY_DIR}/simspark) + rcssserver3d ${CMAKE_CURRENT_BINARY_DIR}/simspark) ########### install files ############### @@ -32,9 +31,7 @@ internalsoccermonitor.rb internalsoccerbindings.rb DESTINATION ${DATADIR}/${CMAKE_PROJECT_NAME}) -if (NOT WIN32) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/rcsoccersim3d +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/rcsoccersim3d ${CMAKE_CURRENT_BINARY_DIR}/simspark DESTINATION ${BINDIR} PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_READ WORLD_EXECUTE) -endif (NOT WIN32) diff -Nru rcssserver3d-0.6.3/rcssserver3d/main.cpp rcssserver3d-0.6.4/rcssserver3d/main.cpp --- rcssserver3d-0.6.3/rcssserver3d/main.cpp 2010-01-18 21:17:07.000000000 +0000 +++ rcssserver3d-0.6.4/rcssserver3d/main.cpp 2010-06-08 09:38:29.000000000 +0100 @@ -2,7 +2,7 @@ this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2003 Koblenz University - $Id: main.cpp 140 2010-01-10 23:45:10Z hedayat $ + $Id: main.cpp 181 2010-02-28 10:55:34Z marianbuchta $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -128,7 +128,7 @@ GetScriptServer()->Run(mScriptPath); // tell the inputControl node the loaction of our camera - shared_ptr inputCtr = GetInputControl(); + boost::shared_ptr inputCtr = GetInputControl(); if (inputCtr.get() != 0) { inputCtr->SetFPSController("/usr/scene/camera/physics/controller"); @@ -149,7 +149,7 @@ spark.GetSimulationServer()->Run(argc,argv); - shared_ptr renderCtr = spark.GetRenderControl(); + boost::shared_ptr renderCtr = spark.GetRenderControl(); if (renderCtr.get() != 0) { spark.GetLog()->Normal() diff -Nru rcssserver3d-0.6.3/rcssserver3d/naosoccersim.rb rcssserver3d-0.6.4/rcssserver3d/naosoccersim.rb --- rcssserver3d-0.6.3/rcssserver3d/naosoccersim.rb 2010-01-18 21:17:07.000000000 +0000 +++ rcssserver3d-0.6.4/rcssserver3d/naosoccersim.rb 2010-06-08 09:38:29.000000000 +0100 @@ -62,10 +62,30 @@ addSoccerVar('RuleGoalPauseTime',3.0) addSoccerVar('RuleKickInPauseTime',1.0) addSoccerVar('RuleHalfTime',5.0 * 60) -addSoccerVar('RuleDropBallTime',30) +addSoccerVar('RuleDropBallTime',15) addSoccerVar('SingleHalfTime', false) addSoccerVar('UseOffside',false) +# auto ref parameters FCP 2010 +addSoccerVar('NotStandingMaxTime',30) +addSoccerVar('GoalieNotStandingMaxTime',60) +addSoccerVar('GroundMaxTime',15) +addSoccerVar('GoalieGroundMaxTime', 30) +addSoccerVar('MaxPlayersInsideOwnArea',3) +addSoccerVar('MinOppDistance',0.8) +addSoccerVar('Min2PlDistance',0.4) +addSoccerVar('Min3PlDistance',1.0) + +# auto ref parameters for testing (not for use in competition...) +#addSoccerVar('NotStandingMaxTime',10) +#addSoccerVar('GoalieNotStandingMaxTime',30) +#addSoccerVar('GroundMaxTime', 5) +#addSoccerVar('GoalieGroundMaxTime', 5) +#addSoccerVar('MaxPlayersInsideOwnArea',2) +#addSoccerVar('MinOppDistance',1.0) +#addSoccerVar('Min2PlDistance',0.6) +#addSoccerVar('Min3PlDistance',1.5) + # recorders addSoccerVar('BallRecorder',"Ball/geometry/recorder") addSoccerVar('LeftGoalRecorder',"leftgoal/GoalBox/BoxCollider/recorder")