From: <he...@us...> - 2011-01-13 16:49:55
|
Revision: 242 http://simspark.svn.sourceforge.net/simspark/?rev=242&view=rev Author: hedayat Date: 2011-01-13 16:49:48 +0000 (Thu, 13 Jan 2011) Log Message: ----------- Updated UseLATEX Fixed a compile issue on Mac (Thanks to Luca Giuliani) Modified Paths: -------------- trunk/rcssserver3d/ChangeLog trunk/rcssserver3d/cmake/UseLATEX.cmake trunk/rcssserver3d/plugin/soccermonitor/CMakeLists.txt Modified: trunk/rcssserver3d/ChangeLog =================================================================== --- trunk/rcssserver3d/ChangeLog 2010-12-19 19:18:59 UTC (rev 241) +++ trunk/rcssserver3d/ChangeLog 2011-01-13 16:49:48 UTC (rev 242) @@ -1,3 +1,11 @@ +2011-01-13 Hedayat Vatankhah <hed...@gm...> + + * cmake/UseLATEX.cmake: + - Updated to version 1.7.2 + + * plugin/soccermonitor/CMakeLists.txt: + - Link OpenGL libraries to fix MacOSX compile issue(Thanks to Giuliani) + 2010-12-14 Yuan Xu <xu...@in...> * rcssserver3d/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor.cpp * rcssserver3d/plugin/soccer/trainercommandparser/trainercommandparser.cpp Modified: trunk/rcssserver3d/cmake/UseLATEX.cmake =================================================================== --- trunk/rcssserver3d/cmake/UseLATEX.cmake 2010-12-19 19:18:59 UTC (rev 241) +++ trunk/rcssserver3d/cmake/UseLATEX.cmake 2011-01-13 16:49:48 UTC (rev 242) @@ -1,6 +1,6 @@ # File: UseLATEX.cmake # CMAKE commands to actually use the LaTeX compiler -# Version: 1.7.0 +# Version: 1.7.2 # Author: Kenneth Moreland (kmorel at sandia dot gov) # # Copyright 2004 Sandia Corporation. @@ -49,6 +49,10 @@ # auxclean: Deletes <name>.aux. This is sometimes necessary # if a LaTeX error occurs and writes a bad aux file. # +# The dvi target is added to the ALL. That is, it will be the target +# built by default. If the DEFAULT_PDF argument is given, then the +# pdf target will be the default instead of dvi. +# # If the argument MANGLE_TARGET_NAMES is given, then each of the # target names above will be mangled with the <tex_file> name. This # is to make the targets unique if ADD_LATEX_DOCUMENT is called for @@ -58,8 +62,15 @@ # # History: # -# 1.7.0 Added DEPENDS options (thanks to Theodore Papadopoulp). +# 1.7.2.1 (By Hedayat) Do not add anything to default ALL target # +# 1.7.2 Use ps2pdf to convert eps to pdf to get around the problem with +# ImageMagick dropping the bounding box (thanks to Lukasz Lis). +# +# 1.7.1 Fixed some dependency issues. +# +# 1.7.0 Added DEPENDS options (thanks to Theodore Papadopoulo). +# # 1.6.1 Ported the makeglossaries command to CMake and embedded the port # into UseLATEX.cmake. # @@ -71,16 +82,16 @@ # specify tex files without the .tex extension is removed. The removed # function is of dubious value anyway. # -# When copying input files, skip over any file that exists in the -# binary directory but does not exist in the source directory with the -# assumption that these files were added by some other mechanism. I -# find this useful when creating large documents with multiple -# chapters that I want to build separately (for speed) as I work on -# them. I use the same boilerplate as the starting point for all -# and just copy it with different configurations. This was what the -# separate ADD_LATEX_DOCUMENT method was supposed to originally be for. -# Since its external use is pretty much deprecated, I removed that -# documentation. +# When copying input files, skip over any file that exists in the +# binary directory but does not exist in the source directory with the +# assumption that these files were added by some other mechanism. I +# find this useful when creating large documents with multiple +# chapters that I want to build separately (for speed) as I work on +# them. I use the same boilerplate as the starting point for all +# and just copy it with different configurations. This was what the +# separate ADD_LATEX_DOCUMENT method was supposed to originally be for. +# Since its external use is pretty much deprecated, I removed that +# documentation. # # 1.4.1 Copy .sty files along with the other class and package files. # @@ -375,6 +386,30 @@ ENDIF (LATEX_OUTPUT_PATH) ENDMACRO(LATEX_GET_OUTPUT_PATH) +MACRO(LATEX_ADD_CONVERT_COMMAND output_path input_path output_extension + input_extension flags) + SET (converter ${IMAGEMAGICK_CONVERT}) + SET (convert_flags "") + # ImageMagick has broken eps to pdf conversion + # use ps2pdf instead + IF (${input_extension} STREQUAL ".eps" AND ${output_extension} STREQUAL ".pdf") + IF (PS2PDF_CONVERTER) + SET (converter ${PS2PDF_CONVERTER}) + SET (convert_flags "-dEPSCrop ${flags}") + ELSE (PS2PDF_CONVERTER) + MESSAGE(SEND_ERROR "Using postscript files with pdflatex requires ps2pdf for conversion.") + ENDIF (PS2PDF_CONVERTER) + ELSE (${input_extension} STREQUAL ".eps" AND ${output_extension} STREQUAL ".pdf") + SET (convert_flags ${flags}) + ENDIF (${input_extension} STREQUAL ".eps" AND ${output_extension} STREQUAL ".pdf") + + ADD_CUSTOM_COMMAND(OUTPUT ${output_path} + COMMAND ${converter} + ARGS ${convert_flags} ${input_path} ${output_path} + DEPENDS ${input_path} + ) +ENDMACRO(LATEX_ADD_CONVERT_COMMAND) + # Makes custom commands to convert a file to a particular type. MACRO(LATEX_CONVERT_IMAGE output_files input_file output_extension convert_flags output_extensions other_files) @@ -389,12 +424,9 @@ LATEX_LIST_CONTAINS(is_type ${extension} ${output_extensions}) IF (is_type) IF (convert_flags) - ADD_CUSTOM_COMMAND(OUTPUT ${output_dir}/${output_file} - COMMAND ${IMAGEMAGICK_CONVERT} - ARGS ${input_dir}/${input_file} ${convert_flags} - ${output_dir}/${output_file} - DEPENDS ${input_dir}/${input_file} - ) + LATEX_ADD_CONVERT_COMMAND(${output_dir}/${output_file} + ${input_dir}/${input_file} ${output_extension} ${extension} + "${convert_flags}") SET(${output_files} ${${output_files}} ${output_dir}/${output_file}) ELSE (convert_flags) # As a shortcut, we can just copy the file. @@ -419,12 +451,9 @@ # If we still need to convert, do it. IF (do_convert) - ADD_CUSTOM_COMMAND(OUTPUT ${output_dir}/${output_file} - COMMAND ${IMAGEMAGICK_CONVERT} - ARGS ${input_dir}/${input_file} ${convert_flags} - ${output_dir}/${output_file} - DEPENDS ${input_dir}/${input_file} - ) + LATEX_ADD_CONVERT_COMMAND(${output_dir}/${output_file} + ${input_dir}/${input_file} ${output_extension} ${extension} + "${convert_flags}") SET(${output_files} ${${output_files}} ${output_dir}/${output_file}) ENDIF (do_convert) ENDIF (is_type) @@ -493,20 +522,20 @@ LATEX_LIST_CONTAINS(use_config ${file} ${LATEX_CONFIGURE}) IF (use_config) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file} - ${output_dir}/${file} - @ONLY - ) + ${output_dir}/${file} + @ONLY + ) ADD_CUSTOM_COMMAND(OUTPUT ${output_dir}/${file} - COMMAND ${CMAKE_COMMAND} - ARGS ${CMAKE_BINARY_DIR} - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${file} - ) + COMMAND ${CMAKE_COMMAND} + ARGS ${CMAKE_BINARY_DIR} + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${file} + ) ELSE (use_config) ADD_CUSTOM_COMMAND(OUTPUT ${output_dir}/${file} - COMMAND ${CMAKE_COMMAND} - ARGS -E copy ${CMAKE_CURRENT_SOURCE_DIR}/${file} ${output_dir}/${file} - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${file} - ) + COMMAND ${CMAKE_COMMAND} + ARGS -E copy ${CMAKE_CURRENT_SOURCE_DIR}/${file} ${output_dir}/${file} + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${file} + ) ENDIF (use_config) ELSE (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file}) IF (EXISTS ${output_dir}/${file}) @@ -671,31 +700,45 @@ COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} ${PDFLATEX_COMPILER} ${PDFLATEX_COMPILER_FLAGS} ${LATEX_MAIN_INPUT}) + # Add commands and targets for building dvi outputs. + ADD_CUSTOM_COMMAND(OUTPUT ${output_dir}/${LATEX_TARGET}.dvi + COMMAND ${make_dvi_command} + DEPENDS ${make_dvi_depends} + ) IF (LATEX_DEFAULT_PDF) - ADD_CUSTOM_TARGET(${dvi_target} ${make_dvi_command} - DEPENDS ${make_dvi_depends}) + ADD_CUSTOM_TARGET(${dvi_target} + DEPENDS ${output_dir}/${LATEX_TARGET}.dvi) ELSE (LATEX_DEFAULT_PDF) - ADD_CUSTOM_TARGET(${dvi_target} ALL ${make_dvi_command} - DEPENDS ${make_dvi_depends}) + ADD_CUSTOM_TARGET(${dvi_target} + DEPENDS ${output_dir}/${LATEX_TARGET}.dvi) ENDIF (LATEX_DEFAULT_PDF) + # Add commands and targets for building pdf outputs (with pdflatex). IF (PDFLATEX_COMPILER) + ADD_CUSTOM_COMMAND(OUTPUT ${output_dir}/${LATEX_TARGET}.pdf + COMMAND ${make_pdf_command} + DEPENDS ${make_pdf_depends} + ) IF (LATEX_DEFAULT_PDF) - ADD_CUSTOM_TARGET(${pdf_target} ${make_pdf_command} - DEPENDS ${make_pdf_depends}) + ADD_CUSTOM_TARGET(${pdf_target} + DEPENDS ${output_dir}/${LATEX_TARGET}.pdf) ELSE (LATEX_DEFAULT_PDF) - ADD_CUSTOM_TARGET(${pdf_target} ${make_pdf_command} - DEPENDS ${make_pdf_depends}) + ADD_CUSTOM_TARGET(${pdf_target} + DEPENDS ${output_dir}/${LATEX_TARGET}.pdf) ENDIF (LATEX_DEFAULT_PDF) ENDIF (PDFLATEX_COMPILER) IF (DVIPS_CONVERTER) + ADD_CUSTOM_COMMAND(OUTPUT ${output_dir}/${LATEX_TARGET}.ps + COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} + ${DVIPS_CONVERTER} ${DVIPS_CONVERTER_FLAGS} -o ${LATEX_TARGET}.ps ${LATEX_TARGET}.dvi + DEPENDS ${output_dir}/${LATEX_TARGET}.dvi) ADD_CUSTOM_TARGET(${ps_target} - ${CMAKE_COMMAND} -E chdir ${output_dir} - ${DVIPS_CONVERTER} ${DVIPS_CONVERTER_FLAGS} -o ${LATEX_TARGET}.ps ${LATEX_TARGET}.dvi - ) - ADD_DEPENDENCIES(${ps_target} ${dvi_target}) + DEPENDS ${output_dir}/${LATEX_TARGET}.ps) IF (PS2PDF_CONVERTER) + # Since both the pdf and safepdf targets have the same output, we + # cannot properly do the dependencies for both. When selecting safepdf, + # simply force a recompile every time. ADD_CUSTOM_TARGET(${safepdf_target} ${CMAKE_COMMAND} -E chdir ${output_dir} ${PS2PDF_CONVERTER} ${PS2PDF_CONVERTER_FLAGS} ${LATEX_TARGET}.ps ${LATEX_TARGET}.pdf Modified: trunk/rcssserver3d/plugin/soccermonitor/CMakeLists.txt =================================================================== --- trunk/rcssserver3d/plugin/soccermonitor/CMakeLists.txt 2010-12-19 19:18:59 UTC (rev 241) +++ trunk/rcssserver3d/plugin/soccermonitor/CMakeLists.txt 2011-01-13 16:49:48 UTC (rev 242) @@ -24,7 +24,7 @@ add_library(soccermonitor MODULE ${soccermonitor_LIB_SRCS} ${soccermonitor_LIB_HDRS}) -target_link_libraries(soccermonitor ${spark_libs}) +target_link_libraries(soccermonitor ${spark_libs} ${OPENGL_LIBRARIES}) if (NOT APPLE) set_target_properties(soccermonitor PROPERTIES VERSION 1.0.0 SOVERSION 1) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sgv...@us...> - 2011-02-10 18:37:25
|
Revision: 243 http://simspark.svn.sourceforge.net/simspark/?rev=243&view=rev Author: sgvandijk Date: 2011-02-10 18:37:19 +0000 (Thu, 10 Feb 2011) Log Message: ----------- - Set different agent and monitor ports with --agent-posrt and --server-port - New field texture Modified Paths: -------------- trunk/rcssserver3d/data/textures/rcs-naofield.png trunk/rcssserver3d/rcssserver3d/main.cpp Modified: trunk/rcssserver3d/data/textures/rcs-naofield.png =================================================================== (Binary files differ) Modified: trunk/rcssserver3d/rcssserver3d/main.cpp =================================================================== --- trunk/rcssserver3d/rcssserver3d/main.cpp 2011-01-13 16:49:48 UTC (rev 242) +++ trunk/rcssserver3d/rcssserver3d/main.cpp 2011-02-10 18:37:19 UTC (rev 243) @@ -84,6 +84,8 @@ << "\noptions:\n" << " --help\t\t\t print this message.\n" << " --script-path PATH\t set the script path (simspark.rb path).\n" + << "--agent-port PORTNUM\t port for agents to connect to.\n" + << "--server-port PORTNUM\t port for monitors to connect to.\n" << "\n"; } @@ -91,7 +93,7 @@ { for( int i = 1; i < argc; i++) { - if(strcmp( argv[1], "--help" ) == 0) + if(strcmp( argv[i], "--help" ) == 0) { PrintHelp(); return false; @@ -107,6 +109,29 @@ return false; } } + else if (strcmp(argv[i], "--agent-port") == 0) + { + i++; + if (i < argc) + GetScriptServer()->Eval(string("$agentPort = ") + argv[i]); + else + { + PrintHelp(); + return false; + } + } + else if (strcmp(argv[i], "--server-port") == 0) + { + i++; + if (i < argc) + GetScriptServer()->Eval(string("$serverPort = ") + argv[i]); + else + { + PrintHelp(); + return false; + } + } + } return true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sgv...@us...> - 2011-03-14 23:17:04
|
Revision: 252 http://simspark.svn.sourceforge.net/simspark/?rev=252&view=rev Author: sgvandijk Date: 2011-03-14 23:16:57 +0000 (Mon, 14 Mar 2011) Log Message: ----------- - New field size - Players thrown out of panelty area, and wrong kickin side switch bug should be fixed Modified Paths: -------------- trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp trunk/rcssserver3d/rcssserver3d/naosoccersim.rb Modified: trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2011-03-04 00:46:44 UTC (rev 251) +++ trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2011-03-14 23:16:57 UTC (rev 252) @@ -86,17 +86,25 @@ 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 + // Reset counters before kickoff + if (playMode == PM_BeforeKickOff) + { + ResetFaultCounter(TI_LEFT); + ResetFaultCounter(TI_RIGHT); } + 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 + // Only apply rules during play-on + if (playMode == PM_PlayOn) + { + ClearPlayersAutomatic(TI_LEFT); // enforce standing and not overcrowding rules for left team + ClearPlayersAutomatic(TI_RIGHT); // enforce standing and not overcrowding rules for right team + } + } } @@ -123,42 +131,44 @@ 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...) + 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 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 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; - } + //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 + //Player standing for some cycles (0.5 seconds) reset not standing count + if (playerStanding[unum][idx] > 0.5 / 0.02) { + playerNotStanding[unum][idx] = 0; + } } // 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]++; + 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) { @@ -172,53 +182,71 @@ // Calculate Distance arrays and ordering to the ball and own goal void SoccerRuleAspect::CalculateDistanceArrays(TTeamIndex idx) { - if (idx == TI_NONE || mBallState.get() == 0) return; + if (idx == TI_NONE || mBallState.get() == 0) + return; std::list<boost::shared_ptr<AgentState> > agent_states; - if (! SoccerBase::GetAgentStates(*mBallState.get(), agent_states, idx)) return; + 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 + salt::Vector3f ownGoalPos; + if (idx == TI_LEFT) + ownGoalPos = Vector3f(-mFieldLength/2.0, 0.0, 0.0); + else + ownGoalPos = Vector3f(mFieldLength/2.0, 0.0, 0.0); + boost::shared_ptr<oxygen::Transform> agent_aspect; std::list<boost::shared_ptr<AgentState> >::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; + 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) { + 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())); + 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; - } + 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]; + 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; + 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; + //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); + processAgentState(agentPos, unum, idx); } // compute rank of distance to ball @@ -230,75 +258,58 @@ // 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"; - } + TTeamIndex idx2; + if (idx == TI_LEFT) + idx2 = TI_RIGHT; + else + idx2 = TI_LEFT; //Other team - 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 - } - + 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]++; + } + // I am the second closest player but i am too near the ball (and not the goalie) + else if(unum != 1 && closestPlayerDist[idx2] < mMinOppDistance && + distArr[unum][idx] <= mMin2PlDistance + 0.01 && ordArr[unum][idx] == 2 ) + { + playerFaultTime[unum][idx]++; + } + // 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 + else 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]++; + } + // I am a field player and on the ground for too much time + else if (unum != 1 && playerGround[unum][idx] > mGroundMaxTime / 0.02) + { + playerFaultTime[unum][idx]++; + } + // I am a field player and I am not standing for too much time + else if(unum!=1 && playerNotStanding[unum][idx] > mNotStandingMaxTime / 0.02) + { + playerFaultTime[unum][idx]++; + } + // I am the goalie and I am on the ground for too much time + else if (unum == 1 && playerGround[unum][idx] > mGoalieGroundMaxTime / 0.02) + { + playerFaultTime[unum][idx]++; + } + // I am the goalie and I and not standing for too much time + else if (unum == 1 && playerNotStanding[unum][idx] > mGoalieNotStandingMaxTime / 0.02) + { + playerFaultTime[unum][idx]++; + } + else + { + playerFaultTime[unum][idx]=0; + } } } @@ -320,28 +331,32 @@ void SoccerRuleAspect::ClearPlayersAutomatic(TTeamIndex idx) { - if (idx == TI_NONE || mBallState.get() == 0) return; + if (idx == TI_NONE || mBallState.get() == 0) + return; std::list<boost::shared_ptr<AgentState> > agent_states; - if (! SoccerBase::GetAgentStates(*mBallState.get(), agent_states, idx)) return; + if (! SoccerBase::GetAgentStates(*mBallState.get(), agent_states, idx)) + return; salt::Vector3f ballPos = mBallBody->GetPosition(); boost::shared_ptr<oxygen::Transform> agent_aspect; std::list<boost::shared_ptr<AgentState> >::const_iterator i; - for (i = agent_states.begin(); i != agent_states.end(); ++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... + 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 + //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; + //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; } } } @@ -665,7 +680,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 + // change to the KickIn mode *plus* pause time boost::shared_ptr<AgentAspect> agent; TTime time; if (! mBallState->GetLastCollidingAgent(agent,time)) @@ -675,7 +690,7 @@ } TTime lastChange = mGameState->GetLastModeChange(); - if (time > lastChange) + if (time > lastChange + mKickInPauseTime) { mGameState->SetPlayMode(PM_PlayOn); GetLog()->Error() << "ERROR: (SoccerRuleAspect) " << "Set Playmode to playon\n"; @@ -745,7 +760,7 @@ } TTime lastChange = mGameState->GetLastModeChange(); - if (time > lastChange) + if (time > lastChange + mKickInPauseTime) { mGameState->SetPlayMode(PM_PlayOn); GetLog()->Error() << "ERROR: (SoccerRuleAspect) " << "Set Playmode to playon\n"; @@ -794,7 +809,7 @@ TTime lastChange = mGameState->GetLastModeChange(); // if the team with the goal kick touched the ball and the ball is // outside the penalty area, we switch to play on. - if (time > lastChange) + if (time > lastChange + mKickInPauseTime) { Vector2f pos(mBallBody->GetPosition().x(), mBallBody->GetPosition().y()); @@ -840,7 +855,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 + // change to the KickIn mode *plus* pause time boost::shared_ptr<AgentAspect> agent; TTime time; if (! mBallState->GetLastCollidingAgent(agent,time)) @@ -849,7 +864,7 @@ } TTime lastChange = mGameState->GetLastModeChange(); - if (time > lastChange) + if (time > lastChange + mKickInPauseTime) { mGameState->SetPlayMode(PM_PlayOn); } else Modified: trunk/rcssserver3d/rcssserver3d/naosoccersim.rb =================================================================== --- trunk/rcssserver3d/rcssserver3d/naosoccersim.rb 2011-03-04 00:46:44 UTC (rev 251) +++ trunk/rcssserver3d/rcssserver3d/naosoccersim.rb 2011-03-14 23:16:57 UTC (rev 252) @@ -37,8 +37,8 @@ end # the soccer field dimensions in meters -addSoccerVar('FieldLength', 18.0) -addSoccerVar('FieldWidth', 12.0) +addSoccerVar('FieldLength', 21.0) +addSoccerVar('FieldWidth', 14.0) addSoccerVar('FieldHeight', 40.0) addSoccerVar('GoalWidth', 2.1) addSoccerVar('GoalDepth', 0.6) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sgv...@us...> - 2011-03-21 22:27:52
|
Revision: 253 http://simspark.svn.sourceforge.net/simspark/?rev=253&view=rev Author: sgvandijk Date: 2011-03-21 22:27:45 +0000 (Mon, 21 Mar 2011) Log Message: ----------- - New touch rules Modified Paths: -------------- trunk/rcssserver3d/data/rsg/agent/nao/contactjointhandler.rsg trunk/rcssserver3d/plugin/soccer/CMakeLists.txt trunk/rcssserver3d/plugin/soccer/agentstate/agentstate.cpp trunk/rcssserver3d/plugin/soccer/agentstate/agentstate.h trunk/rcssserver3d/plugin/soccer/export.cpp trunk/rcssserver3d/plugin/soccer/soccerbase/soccerbase.h trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.h Added Paths: ----------- trunk/rcssserver3d/plugin/soccer/agentcollisionhandler/ trunk/rcssserver3d/plugin/soccer/agentcollisionhandler/agentcollisionhandler.cpp trunk/rcssserver3d/plugin/soccer/agentcollisionhandler/agentcollisionhandler.h trunk/rcssserver3d/plugin/soccer/agentcollisionhandler/agentcollisionhandler_c.cpp Modified: trunk/rcssserver3d/data/rsg/agent/nao/contactjointhandler.rsg =================================================================== --- trunk/rcssserver3d/data/rsg/agent/nao/contactjointhandler.rsg 2011-03-14 23:16:57 UTC (rev 252) +++ trunk/rcssserver3d/data/rsg/agent/nao/contactjointhandler.rsg 2011-03-21 22:27:45 UTC (rev 253) @@ -16,4 +16,8 @@ (setContactSlipMode true) (setContactSlip 5e-3) ) -) \ No newline at end of file + (nd AgentCollisionHandler + (setName handler) + ) + +) Modified: trunk/rcssserver3d/plugin/soccer/CMakeLists.txt =================================================================== --- trunk/rcssserver3d/plugin/soccer/CMakeLists.txt 2011-03-14 23:16:57 UTC (rev 252) +++ trunk/rcssserver3d/plugin/soccer/CMakeLists.txt 2011-03-21 22:27:45 UTC (rev 253) @@ -46,6 +46,7 @@ hmdp_effector/hmdpperceptor.h hmdp_effector/naospecific.h line/line.h + agentcollisionhandler/agentcollisionhandler.h ) set(soccer_LIB_SRCS @@ -120,6 +121,8 @@ hmdp_effector/naospecific.cpp line/line.cpp line/line_c.cpp + agentcollisionhandler/agentcollisionhandler.cpp + agentcollisionhandler/agentcollisionhandler_c.cpp ) include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${FREETYPE_INCLUDE_DIRS} Added: trunk/rcssserver3d/plugin/soccer/agentcollisionhandler/agentcollisionhandler.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/agentcollisionhandler/agentcollisionhandler.cpp (rev 0) +++ trunk/rcssserver3d/plugin/soccer/agentcollisionhandler/agentcollisionhandler.cpp 2011-03-21 22:27:45 UTC (rev 253) @@ -0,0 +1,60 @@ +#include "agentcollisionhandler.h" +#include <oxygen/agentaspect/agentaspect.h> + +using namespace oxygen; + +void AgentCollisionHandler::OnLink() +{ +} + +void AgentCollisionHandler::HandleCollision(boost::shared_ptr<Collider> collidee, GenericContact& contact) +{ + if (!mAgentState.get()) + { + mAgentState = FindAgentState(this); + if (!mAgentState.get()) + { + GetLog()->Error() << + "(AgentCollisionHandler) Could not find own AgentState\n"; + return; + } + } + + boost::shared_ptr<AgentState> other = FindAgentState(collidee.get()); + if (other.get()) + { + boost::shared_ptr<TouchGroup> myGroup = mAgentState->GetTouchGroup(); + boost::shared_ptr<TouchGroup> otherGroup = other->GetTouchGroup(); + + // Check if not already in same group + if (myGroup == otherGroup) + return; + + // Insert agents into group with lowest index + // This ensures assignment uniqueness + if (myGroup < otherGroup) + { + myGroup->insert(otherGroup->begin(), otherGroup->end()); + otherGroup->clear(); + other->SetTouchGroup(myGroup); + } + else + { + otherGroup->insert(myGroup->begin(), myGroup->end()); + myGroup->clear(); + mAgentState->SetTouchGroup(otherGroup); + } + } +} + +boost::shared_ptr<AgentState> AgentCollisionHandler::FindAgentState(BaseNode* node) +{ + boost::shared_ptr<AgentAspect> agentAspect + = node->FindParentSupportingClass<AgentAspect>().lock(); + if (!agentAspect.get()) + { + return boost::shared_ptr<AgentState>(); + } + + return boost::shared_static_cast<AgentState>(agentAspect->FindChildSupportingClass<AgentState>(true)); +} Added: trunk/rcssserver3d/plugin/soccer/agentcollisionhandler/agentcollisionhandler.h =================================================================== --- trunk/rcssserver3d/plugin/soccer/agentcollisionhandler/agentcollisionhandler.h (rev 0) +++ trunk/rcssserver3d/plugin/soccer/agentcollisionhandler/agentcollisionhandler.h 2011-03-21 22:27:45 UTC (rev 253) @@ -0,0 +1,62 @@ +/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- + + this file is part of rcssserver3D + Fri May 9 2003 + Copyright (C) 2002,2003 Koblenz University + Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group + $Id: recorderhandler.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 + 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 AGENTCOLLISIONHANDLER_H +#define AGENTCOLLISIONHANDLER_H + +#include <oxygen/oxygen_defines.h> +#include <oxygen/physicsserver/collisionhandler.h> +#include <oxygen/physicsserver/collider.h> +#include <agentstate/agentstate.h> +#include <boost/enable_shared_from_this.hpp> + +/** \class AgentCollisionHandler is a CollisionHandler that passes + collision information of the Collider it belongs to to the owning + AgentState. +*/ +class AgentCollisionHandler : public oxygen::CollisionHandler +{ +public: + AgentCollisionHandler() : oxygen::CollisionHandler() {}; + virtual ~AgentCollisionHandler() {}; + + virtual void OnLink(); + + /** Adds to collision list if \collidee is part of another agent + + \param collidee is the geom ID of the colliders collision + partner + + \param holds the contact points between the two affected geoms + as returned from the ODE dCollide function + */ + virtual void HandleCollision + (boost::shared_ptr<oxygen::Collider> collidee, oxygen::GenericContact& contact); + +private: + boost::shared_ptr<AgentState> FindAgentState(BaseNode* node); + + boost::shared_ptr<AgentState> mAgentState; +}; + + DECLARE_CLASS(AgentCollisionHandler); + +#endif // AGENTCOLLISIONHANDLER_H Added: trunk/rcssserver3d/plugin/soccer/agentcollisionhandler/agentcollisionhandler_c.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/agentcollisionhandler/agentcollisionhandler_c.cpp (rev 0) +++ trunk/rcssserver3d/plugin/soccer/agentcollisionhandler/agentcollisionhandler_c.cpp 2011-03-21 22:27:45 UTC (rev 253) @@ -0,0 +1,30 @@ +/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- + + this file is part of rcssserver3D + Fri May 9 2003 + Copyright (C) 2002,2003 Koblenz University + Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group + $Id: recorderhandler_c.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 + 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 "agentcollisionhandler.h" + +void CLASS(AgentCollisionHandler)::DefineClass() +{ + DEFINE_BASECLASS(oxygen/CollisionHandler); +} + + Modified: trunk/rcssserver3d/plugin/soccer/agentstate/agentstate.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/agentstate/agentstate.cpp 2011-03-14 23:16:57 UTC (rev 252) +++ trunk/rcssserver3d/plugin/soccer/agentstate/agentstate.cpp 2011-03-21 22:27:45 UTC (rev 253) @@ -36,7 +36,8 @@ mHearDecay(2), mHearMateCap(2), mHearOppCap(2), mIfSelfMsg(false), mIfMateMsg(false), mIfOppMsg(false), - mSelected(false) + mSelected(false), + mOldTouchGroup(new TouchGroup), mTouchGroup(new TouchGroup) { // set mID and mUniformNumber into a joint state SetUniformNumber(0); @@ -258,3 +259,28 @@ { mSelected = false; } + +void +AgentState::NewTouchGroup() +{ + mOldTouchGroup = mTouchGroup; + mTouchGroup = boost::shared_ptr<TouchGroup>(new TouchGroup()); +} + +boost::shared_ptr<TouchGroup> +AgentState::GetOldTouchGroup() +{ + return mOldTouchGroup; +} + +void +AgentState::SetTouchGroup(boost::shared_ptr<TouchGroup> group) +{ + mTouchGroup = group; +} + +boost::shared_ptr<TouchGroup> +AgentState::GetTouchGroup() +{ + return mTouchGroup; +} Modified: trunk/rcssserver3d/plugin/soccer/agentstate/agentstate.h =================================================================== --- trunk/rcssserver3d/plugin/soccer/agentstate/agentstate.h 2011-03-14 23:16:57 UTC (rev 252) +++ trunk/rcssserver3d/plugin/soccer/agentstate/agentstate.h 2011-03-21 22:27:45 UTC (rev 253) @@ -30,6 +30,10 @@ class RigidBody; } +class AgentState; + +typedef std::set<boost::shared_ptr<AgentState> > TouchGroup; + class AgentState : public ObjectState { // @@ -91,10 +95,27 @@ bool GetMessage(std::string& msg, float& direction, bool teamMate); bool GetSelfMessage(std::string& msg); + /** Whether agent is selected */ bool IsSelected() const; + + /** Select agent */ void Select(bool s = true); + + /** Unselect agent */ void UnSelect(); + /** Backup old touch group and create new empty one */ + void NewTouchGroup(); + + /** Get the touch group of the previous step */ + boost::shared_ptr<TouchGroup> GetOldTouchGroup(); + + /** Get the current touch group */ + boost::shared_ptr<TouchGroup> GetTouchGroup(); + + /** Set the current touch group */ + void SetTouchGroup(boost::shared_ptr<TouchGroup> group); + protected: /** team index */ TTeamIndex mTeamIndex; @@ -138,7 +159,12 @@ /** is there any message from oponnent */ bool mIfOppMsg; + /** is this agent selected */ bool mSelected; + + boost::shared_ptr<TouchGroup> mOldTouchGroup; + boost::shared_ptr<TouchGroup> mTouchGroup; + protected: virtual void UpdateHierarchyInternal(); virtual void OnUnlink(); Modified: trunk/rcssserver3d/plugin/soccer/export.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/export.cpp 2011-03-14 23:16:57 UTC (rev 252) +++ trunk/rcssserver3d/plugin/soccer/export.cpp 2011-03-21 22:27:45 UTC (rev 253) @@ -54,6 +54,7 @@ #include "hmdp_effector/hmdpeffector.h" #include "hmdp_effector/hmdpperceptor.h" #include "line/line.h" +#include "agentcollisionhandler/agentcollisionhandler.h" ZEITGEIST_EXPORT_BEGIN() ZEITGEIST_EXPORT(SoccerControlAspect); @@ -90,5 +91,6 @@ ZEITGEIST_EXPORT(HMDPPerceptor); ZEITGEIST_EXPORT(HMDPEffector); ZEITGEIST_EXPORT(Line); + ZEITGEIST_EXPORT(AgentCollisionHandler); ZEITGEIST_EXPORT_END() Modified: trunk/rcssserver3d/plugin/soccer/soccerbase/soccerbase.h =================================================================== --- trunk/rcssserver3d/plugin/soccer/soccerbase/soccerbase.h 2011-03-14 23:16:57 UTC (rev 252) +++ trunk/rcssserver3d/plugin/soccer/soccerbase/soccerbase.h 2011-03-21 22:27:45 UTC (rev 253) @@ -62,7 +62,7 @@ class SoccerBase { public: - typedef std::list<boost::shared_ptr<AgentState> > TAgentStateList; + typedef std::vector<boost::shared_ptr<AgentState> > TAgentStateList; typedef std::map<int, boost::shared_ptr<AgentState> > TAgentStateMap; public: Modified: trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2011-03-14 23:16:57 UTC (rev 252) +++ trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2011-03-21 22:27:45 UTC (rev 253) @@ -30,6 +30,7 @@ #include <gamestateaspect/gamestateaspect.h> #include <ballstateaspect/ballstateaspect.h> #include <agentstate/agentstate.h> +#include <algorithm> using namespace oxygen; using namespace boost; @@ -63,6 +64,7 @@ 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 + mMaxTouchGroupSize(1000), mMaxFaultTime(0.0) // maximum time allowed for a player to commit a positional fault before being repositioned { mFreeKickPos = Vector3f(0.0,0.0,mBallRadius); @@ -98,12 +100,18 @@ 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 + AnalyseTouchGroups(TI_LEFT); + AnalyseTouchGroups(TI_RIGHT); // Only apply rules during play-on if (playMode == PM_PlayOn) { ClearPlayersAutomatic(TI_LEFT); // enforce standing and not overcrowding rules for left team ClearPlayersAutomatic(TI_RIGHT); // enforce standing and not overcrowding rules for right team } + + // Reset touch groups + ResetTouchGroups(TI_LEFT); + ResetTouchGroups(TI_RIGHT); } } @@ -129,7 +137,7 @@ // Process agent state: standing, sitted, laying down, ... void -SoccerRuleAspect::processAgentState(salt::Vector3f pos, int unum, TTeamIndex idx) +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...) @@ -184,7 +192,7 @@ { if (idx == TI_NONE || mBallState.get() == 0) return; - std::list<boost::shared_ptr<AgentState> > agent_states; + SoccerBase::TAgentStateList agent_states; if (! SoccerBase::GetAgentStates(*mBallState.get(), agent_states, idx)) return; @@ -196,7 +204,7 @@ ownGoalPos = Vector3f(mFieldLength/2.0, 0.0, 0.0); boost::shared_ptr<oxygen::Transform> agent_aspect; - std::list<boost::shared_ptr<AgentState> >::const_iterator i; + SoccerBase::TAgentStateList::const_iterator i; numPlInsideOwnArea[idx] = 0; closestPlayer[idx] = 1; @@ -246,7 +254,7 @@ playerInsideOwnArea[unum][idx] = 0; // Process agent state: standing, sitted, laying down, ... - processAgentState(agentPos, unum, idx); + ProcessAgentState(agentPos, unum, idx); } // compute rank of distance to ball @@ -255,6 +263,42 @@ SimpleOrder(distGArr, ordGArr, idx); } +void SoccerRuleAspect::AnalyseTouchGroups(TTeamIndex idx) +{ + if (idx == TI_NONE || mBallState.get() == 0) + return; + SoccerBase::TAgentStateList agent_states; + if (! SoccerBase::GetAgentStates(*mBallState.get(), agent_states, idx)) + return; + + random_shuffle(agent_states.begin(), agent_states.end()); + SoccerBase::TAgentStateList::iterator i = agent_states.begin(); + for (; i != agent_states.end(); ++i) + { + // Wasn't touching before, joined group making group too large + if ((*i)->GetOldTouchGroup()->size() == 1 && (*i)->GetTouchGroup()->size() > mMaxTouchGroupSize) + { + playerFaultTime[(*i)->GetUniformNumber()][idx]++; + // Remove player from touch group so no more agents are replaced + (*i)->GetTouchGroup()->erase(*i); + } + } +} + +void SoccerRuleAspect::ResetTouchGroups(TTeamIndex idx) +{ + SoccerBase::TAgentStateList agent_states; + if (! SoccerBase::GetAgentStates(*mBallState.get(), agent_states, idx)) + return; + + SoccerBase::TAgentStateList::const_iterator i; + for (i = agent_states.begin(); i != agent_states.end(); i++) + { + (*i)->NewTouchGroup(); + (*i)->GetTouchGroup()->insert(*i); + } +} + // Analyse Faults and Creates Fault Time Array void SoccerRuleAspect::AnalyseFaults(TTeamIndex idx) { @@ -316,14 +360,15 @@ 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; + salt::Vector3f pos; + // Choose x side based on team + float xFac = idx == TI_LEFT ? -0.6 : 0.6; + // Choose side on oppisite side of field + float yFac = posIni.y() < 0 ? 1.0 : -1.0; + + pos = Vector3f(xFac * (7 - unum), (mFieldWidth / 2 + 0.5) * yFac, 1.0); + + return pos; } @@ -334,20 +379,20 @@ if (idx == TI_NONE || mBallState.get() == 0) return; - std::list<boost::shared_ptr<AgentState> > agent_states; + SoccerBase::TAgentStateList agent_states; if (! SoccerBase::GetAgentStates(*mBallState.get(), agent_states, idx)) return; salt::Vector3f ballPos = mBallBody->GetPosition(); boost::shared_ptr<oxygen::Transform> agent_aspect; - std::list<boost::shared_ptr<AgentState> >::const_iterator i; + SoccerBase::TAgentStateList::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(); + int unum = (*i)->GetUniformNumber(); if (playerFaultTime[unum][idx] > mMaxFaultTime / 0.02) { // I am not a very good soccer player... I am violating the rules... @@ -367,13 +412,13 @@ { if (idx == TI_NONE || mBallState.get() == 0) return; - std::list<boost::shared_ptr<AgentState> > agent_states; + SoccerBase::TAgentStateList agent_states; if (! SoccerBase::GetAgentStates(*mBallState.get(), agent_states, idx)) return; salt::BoundingSphere sphere(pos, radius); boost::shared_ptr<oxygen::Transform> agent_aspect; - std::list<boost::shared_ptr<AgentState> >::const_iterator i; + SoccerBase::TAgentStateList::const_iterator i; for (i = agent_states.begin(); i != agent_states.end(); ++i) { SoccerBase::GetTransformParent(**i, agent_aspect); @@ -412,12 +457,12 @@ float min_dist, TTeamIndex idx) { if (idx == TI_NONE || mBallState.get() == 0) return; - std::list<boost::shared_ptr<AgentState> > agent_states; + SoccerBase::TAgentStateList agent_states; if (! SoccerBase::GetAgentStates(*mBallState.get(), agent_states, idx)) return; boost::shared_ptr<oxygen::Transform> agent_aspect; - std::list<boost::shared_ptr<AgentState> >::const_iterator i; + SoccerBase::TAgentStateList::const_iterator i; for (i = agent_states.begin(); i != agent_states.end(); ++i) { SoccerBase::GetTransformParent(**i, agent_aspect); @@ -457,7 +502,7 @@ ClearPlayers(Vector3f(0,0,0), mFreeKickDist, mFreeKickMoveDist,opp); // move the kick off team to own half field and the center circle - std::list<boost::shared_ptr<AgentState> > agent_states; + SoccerBase::TAgentStateList agent_states; if (! SoccerBase::GetAgentStates(*mBallState.get(), agent_states, idx)) return; @@ -470,7 +515,7 @@ } boost::shared_ptr<oxygen::Transform> agent_aspect; - std::list<boost::shared_ptr<AgentState> >::const_iterator i; + SoccerBase::TAgentStateList::const_iterator i; float freeKickDist2 = mFreeKickDist*mFreeKickDist; for (i = agent_states.begin(); i != agent_states.end(); ++i) { @@ -504,12 +549,12 @@ SoccerRuleAspect::ClearSelectedPlayers() { float min_dist = mFreeKickMoveDist; - std::list<boost::shared_ptr<AgentState> > agent_states; + SoccerBase::TAgentStateList agent_states; if (! SoccerBase::GetAgentStates(*mBallState.get(), agent_states, TI_NONE)) return; boost::shared_ptr<oxygen::Transform> agent_aspect; - std::list<boost::shared_ptr<AgentState> >::const_iterator i; + SoccerBase::TAgentStateList::const_iterator i; for (i = agent_states.begin(); i != agent_states.end(); ++i) { SoccerBase::GetTransformParent(**i, agent_aspect); @@ -1256,6 +1301,7 @@ SoccerBase::GetSoccerVar(*this,"MinOppDistance",mMinOppDistance); SoccerBase::GetSoccerVar(*this,"Min2PlDistance",mMin2PlDistance); SoccerBase::GetSoccerVar(*this,"Min3PlDistance",mMin3PlDistance); + SoccerBase::GetSoccerVar(*this,"MaxTouchGroupSize",mMaxTouchGroupSize); //SoccerBase::GetSoccerVar(*this,"MaxFaultTime",mMaxFaultTime); @@ -1284,13 +1330,13 @@ SoccerRuleAspect::Broadcast(const string& message, const Vector3f& pos, int number, TTeamIndex idx) { - TAgentStateList agent_states; + SoccerBase::TAgentStateList agent_states; if (! SoccerBase::GetAgentStates(*mBallState.get(), agent_states, idx)) { return; } - TAgentStateList opponent_agent_states; + SoccerBase::TAgentStateList opponent_agent_states; if (! SoccerBase::GetAgentStates(*mBallState.get(), opponent_agent_states, SoccerBase::OpponentTeam(idx))) { @@ -1308,7 +1354,7 @@ boost::shared_ptr<RigidBody> agent_body; for ( - TAgentStateList::const_iterator it = agent_states.begin(); + SoccerBase::TAgentStateList::const_iterator it = agent_states.begin(); it != agent_states.end(); it++ ) @@ -1653,13 +1699,13 @@ boost::shared_ptr<AgentState> agentState) { if (idx == TI_NONE || mBallState.get() == 0) return; - std::list<boost::shared_ptr<AgentState> > agent_states; + SoccerBase::TAgentStateList agent_states; if (! SoccerBase::GetAgentStates(*mBallState.get(), agent_states, idx)) return; salt::BoundingSphere sphere(pos, radius); boost::shared_ptr<oxygen::Transform> agent_aspect; - std::list<boost::shared_ptr<AgentState> >::const_iterator i; + SoccerBase::TAgentStateList::const_iterator i; for (i = agent_states.begin(); i != agent_states.end(); ++i) { if (agentState == (*i)) @@ -1704,11 +1750,11 @@ void SoccerRuleAspect::ResetAgentSelection() { - std::list<boost::shared_ptr<AgentState> > agent_states; + SoccerBase::TAgentStateList agent_states; if (SoccerBase::GetAgentStates(*mBallState.get(), agent_states, TI_NONE)) { - std::list<boost::shared_ptr<AgentState> >::const_iterator i; + SoccerBase::TAgentStateList::const_iterator i; for (i = agent_states.begin(); i != agent_states.end(); ++i) (*i)->UnSelect(); } @@ -1717,13 +1763,13 @@ void SoccerRuleAspect::SelectNextAgent() { - std::list<boost::shared_ptr<AgentState> > agent_states; + SoccerBase::TAgentStateList agent_states; bool selectNext = false; if (SoccerBase::GetAgentStates(*mBallState.get(), agent_states, TI_NONE) && agent_states.size() > 0) { boost::shared_ptr<AgentState> first = agent_states.front(); - std::list<boost::shared_ptr<AgentState> >::const_iterator i; + SoccerBase::TAgentStateList::const_iterator i; for (i = agent_states.begin(); i != agent_states.end(); ++i) { if ((*i)->IsSelected()) Modified: trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.h =================================================================== --- trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.h 2011-03-14 23:16:57 UTC (rev 252) +++ trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.h 2011-03-21 22:27:45 UTC (rev 253) @@ -76,36 +76,44 @@ */ //salt::Vector3f RepositionInsidePos(salt::Vector3f initPos, int unum, TTeamIndex idx, float distance); - /** New rules for repositioning players that commit faults - */ - void ClearPlayersAutomatic(TTeamIndex idx); + /** New rules for repositioning players that commit faults + */ + void ClearPlayersAutomatic(TTeamIndex idx); - /** Calculates distance arrays needed for repositioning players - */ - void CalculateDistanceArrays(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); + /** 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); + /** 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 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); + /** 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); + /**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); + /** Check whether too many agents are touching + */ + void AnalyseTouchGroups(TTeamIndex idx); + + /** Reset the touch groups + */ + void ResetTouchGroups(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- @@ -302,6 +310,8 @@ float mMinOppDistance; /** maximum number of players of the defending team that may be inside own penalty area */ int mMaxPlayersInsideOwnArea; + /** maximum number of players that may be in a single touch group */ + int mMaxTouchGroupSize; /** 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 */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <he...@us...> - 2011-03-23 09:12:33
|
Revision: 254 http://simspark.svn.sourceforge.net/simspark/?rev=254&view=rev Author: hedayat Date: 2011-03-23 09:12:27 +0000 (Wed, 23 Mar 2011) Log Message: ----------- Enable sensing field lines in RestrictedVisionPerceptor Update release notes for the next release Modified Paths: -------------- trunk/rcssserver3d/ChangeLog trunk/rcssserver3d/RELEASE trunk/rcssserver3d/data/rsg/agent/nao/naoneckhead.rsg Modified: trunk/rcssserver3d/ChangeLog =================================================================== --- trunk/rcssserver3d/ChangeLog 2011-03-21 22:27:45 UTC (rev 253) +++ trunk/rcssserver3d/ChangeLog 2011-03-23 09:12:27 UTC (rev 254) @@ -1,3 +1,11 @@ +2011-03-23 Hedayat Vatankhah <hed...@gm...> + + * RELEASE: + - Updated release information for the next release + + * data/rsg/agent/nao/naoneckhead.rsg: + - Enable sensing field lines by default + 2011-02-10 Sander van Dijk <sgv...@gm...> * rcssserver3d/rcssserver3d/main.cpp Modified: trunk/rcssserver3d/RELEASE =================================================================== --- trunk/rcssserver3d/RELEASE 2011-03-21 22:27:45 UTC (rev 253) +++ trunk/rcssserver3d/RELEASE 2011-03-23 09:12:27 UTC (rev 254) @@ -1,26 +1,32 @@ -RELEASE News of rcssserver3d-0.6.4 +RELEASE News of rcssserver3d-0.6.5 -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. +This release comes with a number of enhancements and some bug fixes. Most +notably, the automated referee is improved to prevent many agents to collide +with each other which is required for running games with more players. Also, to +better suite the field for running 9 vs 9 games, the field size is increased +and it is 21x14 now. There are some visual improvements and minor enhancements +to improve the general experience with the simulator. -* 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 +* New touch rules: +The automated referee now enforces two new rules to better prevent crowding and +a high number of collisions in 9 vs 9 games: +- If an agent is in touch with more than 2 agents (including himself), and he + wasn't in such a situation in the previous time step - which means he is the + last to join the group - he is relocated outside of the field. +- If it is not clear which agent joined the group last, e.g. when 3 players + were all separate at time t, but were all touching each other in time t + 1, + an agent is chosen at random for relocation. -* Other changes: -- Improved referee to enforce more fair games -- Visual Studio 2010 compilation fixes -- Agents can sense field lines if enabled (currently disabled) - +* Other Enhancements: +- Visual improvements in rcssmonitor3d: new field texture, colored team names + and scores +- Set different agent and monitor ports with --agent-port and --server-port +- Bigger field size: 21x14 +- Updated PDF documentation +- Bug fixes, specially in the automated referee +- New Trainer command (killsim) to terminate the simulator +- Compilation fixes +- Nao robots now sense visual information about field lines by default + You can get the package on the Simspark page on SourceForge at http://sourceforge.net/projects/simspark/ Modified: trunk/rcssserver3d/data/rsg/agent/nao/naoneckhead.rsg =================================================================== --- trunk/rcssserver3d/data/rsg/agent/nao/naoneckhead.rsg 2011-03-21 22:27:45 UTC (rev 253) +++ trunk/rcssserver3d/data/rsg/agent/nao/naoneckhead.rsg 2011-03-23 09:12:27 UTC (rev 254) @@ -92,6 +92,7 @@ (setStaticSenseAxis false) (addNoise true) (setInterval 3) + (setSenseLine true) ) ;; (nd Transform This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <he...@us...> - 2011-03-24 16:29:41
|
Revision: 257 http://simspark.svn.sourceforge.net/simspark/?rev=257&view=rev Author: hedayat Date: 2011-03-24 16:29:33 +0000 (Thu, 24 Mar 2011) Log Message: ----------- * Preparing for the next release * Using the new timer system * Adding a macro containing simulator version, used in rcssserver3d instead of the hard coded one Modified Paths: -------------- trunk/rcssserver3d/CMakeLists.txt trunk/rcssserver3d/ChangeLog trunk/rcssserver3d/rcssmonitor3d/rcssmonitor3d.rb trunk/rcssserver3d/rcssserver3d/main.cpp trunk/rcssserver3d/rcssserver3d/simspark.rb trunk/rcssserver3d/rcssserver3d_config.h.cmake Modified: trunk/rcssserver3d/CMakeLists.txt =================================================================== --- trunk/rcssserver3d/CMakeLists.txt 2011-03-24 16:21:36 UTC (rev 256) +++ trunk/rcssserver3d/CMakeLists.txt 2011-03-24 16:29:33 UTC (rev 257) @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 2.6) project(rcssserver3d CXX C) -set(PACKAGE_VERSION "0.6.4") +set(PACKAGE_VERSION "0.6.5") ########## check for headerfiles/libraries ########## include(CheckIncludeFile) Modified: trunk/rcssserver3d/ChangeLog =================================================================== --- trunk/rcssserver3d/ChangeLog 2011-03-24 16:21:36 UTC (rev 256) +++ trunk/rcssserver3d/ChangeLog 2011-03-24 16:29:33 UTC (rev 257) @@ -1,26 +1,41 @@ +2011-03-24 Hedayat Vatankhah <hed...@gm...> + + * CMakeLists.txt: + - updated PACKAGE_VERSION to 0.6.5 for the next release + + * rcssserver3d_config.h.cmake: + - added a RCSS_VERSION constant to store rcssserver3d version + + * rcssserver3d/main.cpp (SimSpark::PrintGreeting): + - use RCSS_VERSION instead of the hard coded version number + + * rcssserver3d/simspark.rb: + * rcssmonitor3d/rcssmonitor3d.rb: + - use the new sparkSetupTimer() + 2011-03-23 Hedayat Vatankhah <hed...@gm...> * RELEASE: - - Updated release information for the next release + - updated release information for the next release * data/rsg/agent/nao/naoneckhead.rsg: - - Enable sensing field lines by default + - enable sensing field lines by default 2011-02-10 Sander van Dijk <sgv...@gm...> * rcssserver3d/rcssserver3d/main.cpp - - Set different agent and monitor ports with --agent-posrt and --server-port + - set different agent and monitor ports with --agent-posrt and --server-port * /trunk/rcssserver3d/data/textures/rcs-naofield.png - - New field texture + - new field texture 2011-01-13 Hedayat Vatankhah <hed...@gm...> * cmake/UseLATEX.cmake: - - Updated to version 1.7.2 + - updated to version 1.7.2 * plugin/soccermonitor/CMakeLists.txt: - - Link OpenGL libraries to fix MacOSX compile issue(Thanks to Giuliani) + - link OpenGL libraries to fix MacOSX compile issue(Thanks to Giuliani) 2010-12-14 Yuan Xu <xu...@in...> * rcssserver3d/plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor.cpp @@ -72,7 +87,7 @@ * rcssserver3d/naosoccersim.rb: * plugin/soccer/soccerruleaspect/soccerruleaspect.h: * plugin/soccer/soccerruleaspect/soccerruleaspect.cpp: - - Added the simple referee patch from FCPortugal team (thanks to + - added the simple referee patch from FCPortugal team (thanks to Luis Paulo Reis) 2010-02-28 Marian Buchta <mar...@gm...> @@ -446,5 +461,5 @@ * plugin/soccer/pantilteffector/pantilteffector.cpp: * plugin/soccer/restrictedvisionperceptor/restrictedvisionperceptor.cpp: * plugin/soccer/agentstateperceptor/agentstateperceptor.cpp: - - Replaced make_shared() with .lock() function call.(fixed compilation + - replaced make_shared() with .lock() function call.(fixed compilation error with recent boost versions.) Modified: trunk/rcssserver3d/rcssmonitor3d/rcssmonitor3d.rb =================================================================== --- trunk/rcssserver3d/rcssmonitor3d/rcssmonitor3d.rb 2011-03-24 16:21:36 UTC (rev 256) +++ trunk/rcssserver3d/rcssmonitor3d/rcssmonitor3d.rb 2011-03-24 16:29:33 UTC (rev 257) @@ -4,6 +4,7 @@ sparkSetupRendering() sparkSetupInput() +sparkSetupTimer() if ($logPlayerMode == true) sparkSetupMonitorLogPlayer() Modified: trunk/rcssserver3d/rcssserver3d/main.cpp =================================================================== --- trunk/rcssserver3d/rcssserver3d/main.cpp 2011-03-24 16:21:36 UTC (rev 256) +++ trunk/rcssserver3d/rcssserver3d/main.cpp 2011-03-24 16:29:33 UTC (rev 257) @@ -69,7 +69,8 @@ void SimSpark::PrintGreeting() { GetLog()->Normal() - << "rcssserver3d (formerly simspark), a monolithic simulator 0.6.1\n" + << "rcssserver3d (formerly simspark), a monolithic simulator " + RCSS_VERSION"\n" << "Copyright (C) 2004 Markus Rollmann, \n" << "Universität Koblenz.\n" << "Copyright (C) 2004-2009, " @@ -131,7 +132,7 @@ return false; } } - + } return true; Modified: trunk/rcssserver3d/rcssserver3d/simspark.rb =================================================================== --- trunk/rcssserver3d/rcssserver3d/simspark.rb 2011-03-24 16:21:36 UTC (rev 256) +++ trunk/rcssserver3d/rcssserver3d/simspark.rb 2011-03-24 16:29:33 UTC (rev 257) @@ -8,12 +8,19 @@ # toggle the internal monitor $enableInternalMonitor = false +# toggle the real time mode +$enableRealTimeMode = true + sparkSetupServer() if ($enableInternalMonitor) sparkSetupRendering() end sparkSetupInput() +if ($enableRealTimeMode) + sparkSetupTimer() +end + # sparkAddFPSCamera($scenePath+'camera', # -10,-10,5,15,248,4,false,2,10,10) Modified: trunk/rcssserver3d/rcssserver3d_config.h.cmake =================================================================== --- trunk/rcssserver3d/rcssserver3d_config.h.cmake 2011-03-24 16:21:36 UTC (rev 256) +++ trunk/rcssserver3d/rcssserver3d_config.h.cmake 2011-03-24 16:29:33 UTC (rev 257) @@ -4,4 +4,6 @@ #cmakedefine HAVE_ARPA_INET_H 1 -#define RCSS_BUNDLE_PATH "${BUNDLE_PATH}" \ No newline at end of file +#define RCSS_BUNDLE_PATH "${BUNDLE_PATH}" + +#define RCSS_VERSION "${PACKAGE_VERSION}" \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <he...@us...> - 2011-03-24 20:25:30
|
Revision: 259 http://simspark.svn.sourceforge.net/simspark/?rev=259&view=rev Author: hedayat Date: 2011-03-24 20:25:24 +0000 (Thu, 24 Mar 2011) Log Message: ----------- * Removing FindDevIL in favor of cmake's own module * Do not print error message for unused variables Modified Paths: -------------- trunk/rcssserver3d/ChangeLog trunk/rcssserver3d/plugin/soccer/CMakeLists.txt trunk/rcssserver3d/plugin/soccer/gamestateaspect/gamestateitem.cpp trunk/rcssserver3d/plugin/soccermonitor/CMakeLists.txt trunk/rcssserver3d/rcssserver3d/naosoccersim.rb Removed Paths: ------------- trunk/rcssserver3d/cmake/FindDevIL.cmake Modified: trunk/rcssserver3d/ChangeLog =================================================================== --- trunk/rcssserver3d/ChangeLog 2011-03-24 18:08:49 UTC (rev 258) +++ trunk/rcssserver3d/ChangeLog 2011-03-24 20:25:24 UTC (rev 259) @@ -1,5 +1,18 @@ 2011-03-24 Hedayat Vatankhah <hed...@gm...> + * plugin/soccer/CMakeLists.txt: + * plugin/soccermonitor/CMakeLists.txt: + - fixed to use CMake's own FindDevIL module + + * plugin/soccer/gamestateaspect/gamestateitem.cpp + (GameStateItem::GetInitialPredicates): + - do not try to send obsolete variables: AgentMass and AgentMaxSpeed + + * rcssserver3d/naosoccersim.rb: + - added MaxTouchGroupSize variable + - added a BorderSize variable to stop simulator from complaining for + missing variable + * CMakeLists.txt: - updated PACKAGE_VERSION to 0.6.5 for the next release Deleted: trunk/rcssserver3d/cmake/FindDevIL.cmake =================================================================== --- trunk/rcssserver3d/cmake/FindDevIL.cmake 2011-03-24 18:08:49 UTC (rev 258) +++ trunk/rcssserver3d/cmake/FindDevIL.cmake 2011-03-24 20:25:24 UTC (rev 259) @@ -1,124 +0,0 @@ -# -Try to find DevIL (developer image) library -# formerly known as OpenIL, see -# http://openil.sourceforge.net -# -# Once run this will define: -# -# DevIL_FOUND -# DevIL_INCLUDE_DIR -# DevIL_LIBRARIES -# -# Jan Woetzel 12/2005. -# -# www.mip.informatik.uni-kiel.de/~jw -# -------------------------------- - -# base dirs: -SET(DevIL_POSSIBLE_ROOT_PATHS - ${DevIL_ROOT_DIR} - $ENV{DevIL_ROOT_DIR} - ${DevIL_DIR} - $ENV{DevIL_DIR} - ${DEVIL_DIR} - $ENV{DEVIL_DIR} - ${DEVIL_HOME} - $ENV{DEVIL_HOME} - "$ENV{EXTERN_LIBS_DIR}/DevIL" - $ENV{EXTRA_DIR} - $ENV{EXTRA} - $ENV{ProgramFiles}/DevIL - /usr/local/ - /usr/ - /opt/net/gcc41/DevIL - /opt/net/gcc33/DevIL - C:/library/DevIL - "C:/Program Files/DevIL" - "C:/Program Files (x86)/DevIL" - C:/DevIL - ) - -# appended -SET(DevIL_POSSIBLE_INCDIR_SUFFIXES - include - DevIL/include ) -SET(DevIL_POSSIBLE_LIBDIR_SUFFIXES - lib - lib64 - ) - - - -FIND_PATH(DevIL_INCLUDE_DIR - NAMES IL/il.h - PATHS ${DevIL_POSSIBLE_ROOT_PATHS} - PATH_SUFFIXES ${DevIL_POSSIBLE_INCDIR_SUFFIXES} ) -#MESSAGE("DBG DevIL_INCLUDE_DIR=${DevIL_INCLUDE_DIR}") - - -FIND_LIBRARY(DevIL_LIBRARY_IL - NAMES DevIL devil DevIL IL - PATHS ${DevIL_POSSIBLE_ROOT_PATHS} - PATH_SUFFIXES ${DevIL_POSSIBLE_LIBDIR_SUFFIXES} ) -#MESSAGE("DBG DevIL_LIBRARY_IL=${DevIL_LIBRARY_IL}") - -FIND_LIBRARY(DevIL_LIBRARY_ILU - NAMES ILU ilu Ilu - PATHS ${DevIL_POSSIBLE_ROOT_PATHS} - PATH_SUFFIXES ${DevIL_POSSIBLE_LIBDIR_SUFFIXES} ) -#MESSAGE("DBG DevIL_LIBRARY_ILU=${DevIL_LIBRARY_ILU}") - -FIND_LIBRARY(DevIL_LIBRARY_ILUT - NAMES ILUT ilu Ilut - PATHS ${DevIL_POSSIBLE_ROOT_PATHS} - PATH_SUFFIXES ${DevIL_POSSIBLE_LIBDIR_SUFFIXES} ) -#MESSAGE("DBG DevIL_LIBRARY_ILUT=${DevIL_LIBRARY_ILUT}") - - - -# -------------------------------- - -IF (DevIL_INCLUDE_DIR) - IF (DevIL_LIBRARY_IL) - IF (DevIL_LIBRARY_ILU)# AND DevIL_LIBRARY_ILUT) - - SET(DevIL_FOUND TRUE) - SET(DevIL_LIBRARIES - ${DevIL_LIBRARY_IL} - ${DevIL_LIBRARY_ILU}) - IF (DevIL_LIBRARY_ILUT) - SET(DevIL_LIBRARIES ${DevIL_LIBRARIES} ${DevIL_LIBRARY_ILUT}) - ENDIF (DevIL_LIBRARY_ILUT) - - # get the link directory for rpath to be used with LINK_DIRECTORIES: - GET_FILENAME_COMPONENT(DevIL_LINK_DIRECTORIES ${DevIL_LIBRARY_IL} PATH) - - ENDIF(DevIL_LIBRARY_ILU)# AND DevIL_LIBRARY_ILUT) - ENDIF(DevIL_LIBRARY_IL) -ENDIF (DevIL_INCLUDE_DIR) - - -MARK_AS_ADVANCED( - DevIL_INCLUDE_DIR - DevIL_LIBRARY_IL - DevIL_LIBRARY_ILU - DevIL_LIBRARY_ILUT - DevIL_LIBRARIES - ) - - -# ========================================== -IF(NOT DevIL_FOUND) - # make FIND_PACKAGE friendly - IF(NOT DevIL_FIND_QUIETLY) - IF(DevIL_FIND_REQUIRED) - MESSAGE(FATAL_ERROR "DevIL required, please specify it's location.") - ELSE(DevIL_FIND_REQUIRED) - MESSAGE(STATUS "ERROR: DevIL was not found.") - ENDIF(DevIL_FIND_REQUIRED) - ENDIF(NOT DevIL_FIND_QUIETLY) -ENDIF(NOT DevIL_FOUND) - -# backward compatibility -SET(DEVIL_FOUND ${DevIL_FOUND}) -SET(DEVIL_LIBRARIES ${DevIL_LIBRARIES}) -SET(DEVIL_INCLUDE_DIR ${DevIL_INCLUDE_DIR}) Modified: trunk/rcssserver3d/plugin/soccer/CMakeLists.txt =================================================================== --- trunk/rcssserver3d/plugin/soccer/CMakeLists.txt 2011-03-24 18:08:49 UTC (rev 258) +++ trunk/rcssserver3d/plugin/soccer/CMakeLists.txt 2011-03-24 20:25:24 UTC (rev 259) @@ -126,7 +126,7 @@ ) include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${FREETYPE_INCLUDE_DIRS} - ${DevIL_INCLUDE_DIR}) + ${IL_INCLUDE_DIR}) add_library(soccer MODULE ${soccer_LIB_SRCS} ${soccer_LIB_HDRS}) Modified: trunk/rcssserver3d/plugin/soccer/gamestateaspect/gamestateitem.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/gamestateaspect/gamestateitem.cpp 2011-03-24 18:08:49 UTC (rev 258) +++ trunk/rcssserver3d/plugin/soccer/gamestateaspect/gamestateitem.cpp 2011-03-24 20:25:24 UTC (rev 259) @@ -75,9 +75,9 @@ PutFloatParam("WaitBeforeKickOff",pList); // agent parameter - PutFloatParam("AgentMass",pList); +// PutFloatParam("AgentMass",pList); PutFloatParam("AgentRadius",pList); - PutFloatParam("AgentMaxSpeed",pList); +// PutFloatParam("AgentMaxSpeed",pList); // ball parameter PutFloatParam("BallRadius",pList); Modified: trunk/rcssserver3d/plugin/soccermonitor/CMakeLists.txt =================================================================== --- trunk/rcssserver3d/plugin/soccermonitor/CMakeLists.txt 2011-03-24 18:08:49 UTC (rev 258) +++ trunk/rcssserver3d/plugin/soccermonitor/CMakeLists.txt 2011-03-24 20:25:24 UTC (rev 259) @@ -19,7 +19,7 @@ ) include_directories(${CMAKE_SOURCE_DIR}/plugin ${FREETYPE_INCLUDE_DIRS} - ${DevIL_INCLUDE_DIR}) + ${IL_INCLUDE_DIR}) add_library(soccermonitor MODULE ${soccermonitor_LIB_SRCS} ${soccermonitor_LIB_HDRS}) Modified: trunk/rcssserver3d/rcssserver3d/naosoccersim.rb =================================================================== --- trunk/rcssserver3d/rcssserver3d/naosoccersim.rb 2011-03-24 18:08:49 UTC (rev 258) +++ trunk/rcssserver3d/rcssserver3d/naosoccersim.rb 2011-03-24 20:25:24 UTC (rev 259) @@ -50,6 +50,7 @@ addSoccerVar('GoalKickDist', 1.0) addSoccerVar('AutomaticKickOff', false) addSoccerVar('WaitBeforeKickOff', 2.0) +addSoccerVar('BorderSize', 0.0) # prevent complaining about missing variable # agent parameters addSoccerVar('AgentRadius', 0.4) @@ -59,12 +60,13 @@ addSoccerVar('BallMass',0.026) # soccer rule parameters -addSoccerVar('RuleGoalPauseTime',3.0) -addSoccerVar('RuleKickInPauseTime',1.0) -addSoccerVar('RuleHalfTime',5.0 * 60) -addSoccerVar('RuleDropBallTime',15) +addSoccerVar('RuleGoalPauseTime', 3.0) +addSoccerVar('RuleKickInPauseTime', 1.0) +addSoccerVar('RuleHalfTime', 5.0 * 60) +addSoccerVar('RuleDropBallTime', 15) addSoccerVar('SingleHalfTime', false) -addSoccerVar('UseOffside',false) +addSoccerVar('UseOffside', false) +addSoccerVar('MaxTouchGroupSize', 2) # auto ref parameters FCP 2010 addSoccerVar('NotStandingMaxTime',30) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <he...@us...> - 2011-03-25 00:29:14
|
Revision: 260 http://simspark.svn.sourceforge.net/simspark/?rev=260&view=rev Author: hedayat Date: 2011-03-25 00:29:08 +0000 (Fri, 25 Mar 2011) Log Message: ----------- Renamed simspark.rb to rcssserver3d.rb for consistency. Modified Paths: -------------- trunk/rcssserver3d/ChangeLog trunk/rcssserver3d/doc/users/rcssmonitor3d.tex trunk/rcssserver3d/rcssserver3d/CMakeLists.txt trunk/rcssserver3d/rcssserver3d/main.cpp Added Paths: ----------- trunk/rcssserver3d/rcssserver3d/rcssserver3d.rb Removed Paths: ------------- trunk/rcssserver3d/rcssserver3d/simspark.rb Modified: trunk/rcssserver3d/ChangeLog =================================================================== --- trunk/rcssserver3d/ChangeLog 2011-03-24 20:25:24 UTC (rev 259) +++ trunk/rcssserver3d/ChangeLog 2011-03-25 00:29:08 UTC (rev 260) @@ -1,3 +1,11 @@ +2011-03-25 Hedayat Vatankhah <hed...@gm...> + + * rcssserver3d/CMakeLists.txt: + * rcssserver3d/main.cpp: + * rcssserver3d/rcssserver3d.rb: + * doc/users/rcssmonitor3d.tex: + - rename: simspark.rb -> rcssserver3d.rb + 2011-03-24 Hedayat Vatankhah <hed...@gm...> * plugin/soccer/CMakeLists.txt: Modified: trunk/rcssserver3d/doc/users/rcssmonitor3d.tex =================================================================== --- trunk/rcssserver3d/doc/users/rcssmonitor3d.tex 2011-03-24 20:25:24 UTC (rev 259) +++ trunk/rcssserver3d/doc/users/rcssmonitor3d.tex 2011-03-25 00:29:08 UTC (rev 260) @@ -7,7 +7,7 @@ \section{Internal Monitor} The internal monitor implementation is part of the SimSpark server. It -is enabled in the \texttt{simspark.rb} setup script by enabling the +is enabled in the \texttt{rcssserver3d.rb} setup script by enabling the rendering and input plugins of the server. To do so please uncomment the lines \texttt{sparkSetupRendering()} and \texttt{sparkSetupInput()}, i.e. remove the leading \texttt{'\#'} comment markers. Modified: trunk/rcssserver3d/rcssserver3d/CMakeLists.txt =================================================================== --- trunk/rcssserver3d/rcssserver3d/CMakeLists.txt 2011-03-24 20:25:24 UTC (rev 259) +++ trunk/rcssserver3d/rcssserver3d/CMakeLists.txt 2011-03-25 00:29:08 UTC (rev 260) @@ -27,7 +27,7 @@ ########### install files ############### -install(FILES simspark.rb soccersim.rb naosoccersim.rb +install(FILES rcssserver3d.rb soccersim.rb naosoccersim.rb internalsoccermonitor.rb internalsoccerbindings.rb DESTINATION ${DATADIR}/${CMAKE_PROJECT_NAME}) Modified: trunk/rcssserver3d/rcssserver3d/main.cpp =================================================================== --- trunk/rcssserver3d/rcssserver3d/main.cpp 2011-03-24 20:25:24 UTC (rev 259) +++ trunk/rcssserver3d/rcssserver3d/main.cpp 2011-03-25 00:29:08 UTC (rev 260) @@ -47,7 +47,7 @@ public: SimSpark(const std::string& relPathPrefix) : Spark(relPathPrefix), - mScriptPath("simspark.rb") + mScriptPath("rcssserver3d.rb") {}; /** called once after Spark finished it's init */ @@ -84,7 +84,7 @@ << "\nusage: rcssserver3d [options] [script]\n" << "\noptions:\n" << " --help\t\t\t print this message.\n" - << " --script-path PATH\t set the script path (simspark.rb path).\n" + << " --script-path PATH\t set the script path (rcssserver3d.rb path).\n" << "--agent-port PORTNUM\t port for agents to connect to.\n" << "--server-port PORTNUM\t port for monitors to connect to.\n" << "\n"; Copied: trunk/rcssserver3d/rcssserver3d/rcssserver3d.rb (from rev 257, trunk/rcssserver3d/rcssserver3d/simspark.rb) =================================================================== --- trunk/rcssserver3d/rcssserver3d/rcssserver3d.rb (rev 0) +++ trunk/rcssserver3d/rcssserver3d/rcssserver3d.rb 2011-03-25 00:29:08 UTC (rev 260) @@ -0,0 +1,84 @@ +# +# rcssserver3d.rb +# + +# toggle log file recording +$recordLogfile = false + +# toggle the internal monitor +$enableInternalMonitor = false + +# toggle the real time mode +$enableRealTimeMode = true + +sparkSetupServer() +if ($enableInternalMonitor) + sparkSetupRendering() +end +sparkSetupInput() + +if ($enableRealTimeMode) + sparkSetupTimer() +end + +# sparkAddFPSCamera($scenePath+'camera', +# -10,-10,5,15,248,4,false,2,10,10) + +# let spark create a default camera +if ($enableInternalMonitor) + sparkAddFPSCamera( + $scenePath+'camera', + x = 0, + y = -4, + z = 0.6, + vAngle = 10.0, + hAngle = 10.0, + maxSpeed = 1.5, + accel = 40.0, + drag = 4, + addCollider = false, + colliderRadius = 2.0 + ) +end + +# setup default input bindings +run "scripts/bindings.rb" + +# setup default materials common to all simulations +run "scripts/materials.rb" + +# +# uncomment for logging setup (see spark.rb for reference) +# + +sparkResetLogging() +sparkLogErrorToCerr() +#sparkLogAllToCerr() +#sparkLogAllToFile('spark.txt') +#sparkLogDebugToCerr() + +# +# uncomment any of the following to run a simulation +# + +# create an arena with a bunch of boxes and spheres +# scene = get($scenePath) +# scene.importScene('rsg/boxspheres/simspark.rsg') + +# create an arena to test various joint bodies +# scene = get($scenePath) +# scene.importScene('rsg/jointtest/simspark.rsg') + +# source soccersim.rb to run the soccer simulation +#run "soccersim.rb" +run "naosoccersim.rb" + +# setup the integrated agent +#sparkSetupTrain() +#addIntegratedAgent('SoccerbotBehavior',1) + +# setup game state info rendering for the internal monitor +# source soccersim.rb to run the soccer simulation +if ($enableInternalMonitor) + run "internalsoccermonitor.rb" +end Deleted: trunk/rcssserver3d/rcssserver3d/simspark.rb =================================================================== --- trunk/rcssserver3d/rcssserver3d/simspark.rb 2011-03-24 20:25:24 UTC (rev 259) +++ trunk/rcssserver3d/rcssserver3d/simspark.rb 2011-03-25 00:29:08 UTC (rev 260) @@ -1,84 +0,0 @@ -# -# simspark.rb -# - -# toggle log file recording -$recordLogfile = false - -# toggle the internal monitor -$enableInternalMonitor = false - -# toggle the real time mode -$enableRealTimeMode = true - -sparkSetupServer() -if ($enableInternalMonitor) - sparkSetupRendering() -end -sparkSetupInput() - -if ($enableRealTimeMode) - sparkSetupTimer() -end - -# sparkAddFPSCamera($scenePath+'camera', -# -10,-10,5,15,248,4,false,2,10,10) - -# let spark create a default camera -if ($enableInternalMonitor) - sparkAddFPSCamera( - $scenePath+'camera', - x = 0, - y = -4, - z = 0.6, - vAngle = 10.0, - hAngle = 10.0, - maxSpeed = 1.5, - accel = 40.0, - drag = 4, - addCollider = false, - colliderRadius = 2.0 - ) -end - -# setup default input bindings -run "scripts/bindings.rb" - -# setup default materials common to all simulations -run "scripts/materials.rb" - -# -# uncomment for logging setup (see spark.rb for reference) -# - -sparkResetLogging() -sparkLogErrorToCerr() -#sparkLogAllToCerr() -#sparkLogAllToFile('spark.txt') -#sparkLogDebugToCerr() - -# -# uncomment any of the following to run a simulation -# - -# create an arena with a bunch of boxes and spheres -# scene = get($scenePath) -# scene.importScene('rsg/boxspheres/simspark.rsg') - -# create an arena to test various joint bodies -# scene = get($scenePath) -# scene.importScene('rsg/jointtest/simspark.rsg') - -# source soccersim.rb to run the soccer simulation -#run "soccersim.rb" -run "naosoccersim.rb" - -# setup the integrated agent -#sparkSetupTrain() -#addIntegratedAgent('SoccerbotBehavior',1) - -# setup game state info rendering for the internal monitor -# source soccersim.rb to run the soccer simulation -if ($enableInternalMonitor) - run "internalsoccermonitor.rb" -end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <he...@us...> - 2011-03-25 22:36:25
|
Revision: 262 http://simspark.svn.sourceforge.net/simspark/?rev=262&view=rev Author: hedayat Date: 2011-03-25 22:36:19 +0000 (Fri, 25 Mar 2011) Log Message: ----------- Updated RELEASE and NEWS notes for 0.6.5 release Modified Paths: -------------- trunk/rcssserver3d/ChangeLog trunk/rcssserver3d/NEWS trunk/rcssserver3d/RELEASE Modified: trunk/rcssserver3d/ChangeLog =================================================================== --- trunk/rcssserver3d/ChangeLog 2011-03-25 00:54:16 UTC (rev 261) +++ trunk/rcssserver3d/ChangeLog 2011-03-25 22:36:19 UTC (rev 262) @@ -1,3 +1,9 @@ +2011-03-26 Hedayat Vatankhah <hed...@gm...> + + * NEWS: + * RELEASE: + - updated for 0.6.5 release + 2011-03-25 Hedayat Vatankhah <hed...@gm...> * rcssserver3d/CMakeLists.txt: Modified: trunk/rcssserver3d/NEWS =================================================================== --- trunk/rcssserver3d/NEWS 2011-03-25 00:54:16 UTC (rev 261) +++ trunk/rcssserver3d/NEWS 2011-03-25 22:36:19 UTC (rev 262) @@ -1,3 +1,35 @@ +[0.6.5] +This release comes with a number of enhancements and some bug fixes. Most +notably, the automated referee is improved to prevent many agents to collide +with each other which is required for running games with more players. Also, to +better suite the field for running 9 vs 9 games, the field size is increased +and it is 21x14 now. There are some visual improvements and minor enhancements +to improve the general experience with the simulator. Finally, simspark.rb is +renamed to rcssserver3d.rb for more consistency. + +* New touch rules: +The automated referee now enforces two new rules to better prevent crowding and +a high number of collisions in 9 vs 9 games: +- If an agent is in touch with more than 2 agents (including himself), and he + wasn't in such a situation in the previous time step - which means he is the + last to join the group - he is relocated outside of the field. +- If it is not clear which agent joined the group last, e.g. when 3 players + were all separate at time t, but were all touching each other in time t + 1, + an agent is chosen at random for relocation. + +* Other Enhancements: +- Visual improvements in rcssmonitor3d: new field texture, colored team names + and scores +- Set different agent and monitor ports with --agent-port and --server-port +- Bigger field size: 21x14 +- Updated PDF documentation +- Bug fixes, specially in the automated referee +- New Trainer command (killsim) to terminate the simulator +- Compilation fixes +- Nao robots now sense visual information about field lines by default +- Now you should change the value of enableRealTimeMode variable in + rcssserver3d.rb if you want to turn off using real time mode + [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 Modified: trunk/rcssserver3d/RELEASE =================================================================== --- trunk/rcssserver3d/RELEASE 2011-03-25 00:54:16 UTC (rev 261) +++ trunk/rcssserver3d/RELEASE 2011-03-25 22:36:19 UTC (rev 262) @@ -5,7 +5,8 @@ with each other which is required for running games with more players. Also, to better suite the field for running 9 vs 9 games, the field size is increased and it is 21x14 now. There are some visual improvements and minor enhancements -to improve the general experience with the simulator. +to improve the general experience with the simulator. Finally, simspark.rb is +renamed to rcssserver3d.rb for more consistency. * New touch rules: The automated referee now enforces two new rules to better prevent crowding and @@ -27,6 +28,8 @@ - New Trainer command (killsim) to terminate the simulator - Compilation fixes - Nao robots now sense visual information about field lines by default +- Now you should change the value of enableRealTimeMode variable in + rcssserver3d.rb if you want to turn off using real time mode You can get the package on the Simspark page on SourceForge at http://sourceforge.net/projects/simspark/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <he...@us...> - 2011-03-27 22:01:40
|
Revision: 266 http://simspark.svn.sourceforge.net/simspark/?rev=266&view=rev Author: hedayat Date: 2011-03-27 22:01:34 +0000 (Sun, 27 Mar 2011) Log Message: ----------- Only print error messages on stderr to prevent excessive logging Modified Paths: -------------- trunk/rcssserver3d/ChangeLog trunk/rcssserver3d/rcssmonitor3d/rcssmonitor3d.rb Modified: trunk/rcssserver3d/ChangeLog =================================================================== --- trunk/rcssserver3d/ChangeLog 2011-03-27 21:47:57 UTC (rev 265) +++ trunk/rcssserver3d/ChangeLog 2011-03-27 22:01:34 UTC (rev 266) @@ -1,3 +1,8 @@ +2011-03-28 Hedayat Vatankhah <hed...@gm...> + + * rcssmonitor3d/rcssmonitor3d.rb: + - only log error messages to output (a small cleanup for 0.6.5 release) + 2011-03-26 Hedayat Vatankhah <hed...@gm...> * NEWS: Modified: trunk/rcssserver3d/rcssmonitor3d/rcssmonitor3d.rb =================================================================== --- trunk/rcssserver3d/rcssmonitor3d/rcssmonitor3d.rb 2011-03-27 21:47:57 UTC (rev 265) +++ trunk/rcssserver3d/rcssmonitor3d/rcssmonitor3d.rb 2011-03-27 22:01:34 UTC (rev 266) @@ -41,7 +41,7 @@ # sparkResetLogging() -sparkLogAllToCerr() +sparkLogErrorToCerr() # sparkLogAllToFile('./spark.txt') # sparkLogDebugToCerr() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <he...@us...> - 2011-04-20 23:19:33
|
Revision: 268 http://simspark.svn.sourceforge.net/simspark/?rev=268&view=rev Author: hedayat Date: 2011-04-20 23:19:27 +0000 (Wed, 20 Apr 2011) Log Message: ----------- Implementing a fix for goal counting problem based on Luis's suggestion and Mahdi's work. Modified Paths: -------------- trunk/rcssserver3d/ChangeLog trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.h Modified: trunk/rcssserver3d/ChangeLog =================================================================== --- trunk/rcssserver3d/ChangeLog 2011-04-20 23:14:35 UTC (rev 267) +++ trunk/rcssserver3d/ChangeLog 2011-04-20 23:19:27 UTC (rev 268) @@ -1,3 +1,12 @@ +2011-04-21 Hedayat Vatankhah <hed...@gm...> + + * plugin/soccer/soccerruleaspect/soccerruleaspect.h: + * plugin/soccer/soccerruleaspect/soccerruleaspect.cpp (SoccerRuleAspect::CheckGoal): + - if goal recorder's cannot detect any goals, geometrically check to + make sure that no goal is actually happened. Thanks to Luis for starting + the effort and Mahdi for the initial code for calculating where the ball + crosses the goal geometrically. + 2011-03-28 Hedayat Vatankhah <hed...@gm...> * rcssmonitor3d/rcssmonitor3d.rb: Modified: trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2011-04-20 23:14:35 UTC (rev 267) +++ trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2011-04-20 23:19:27 UTC (rev 268) @@ -63,7 +63,7 @@ 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 + mMin3PlDistance(0), // min dist for third closest of team before being repositioned mMaxTouchGroupSize(1000), mMaxFaultTime(0.0) // maximum time allowed for a player to commit a positional fault before being repositioned { @@ -83,23 +83,23 @@ mBallBody->Enable(); } -/* Uses only Ball and Players positions and detects overcrowind near ball and areas and +/* 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 +void SoccerRuleAspect::AutomaticSimpleReferee(TPlayMode playMode) { // Reset counters before kickoff if (playMode == PM_BeforeKickOff) - { + { ResetFaultCounter(TI_LEFT); ResetFaultCounter(TI_RIGHT); } 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 + 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 AnalyseTouchGroups(TI_LEFT); AnalyseTouchGroups(TI_RIGHT); // Only apply rules during play-on @@ -108,7 +108,7 @@ ClearPlayersAutomatic(TI_LEFT); // enforce standing and not overcrowding rules for left team ClearPlayersAutomatic(TI_RIGHT); // enforce standing and not overcrowding rules for right team } - + // Reset touch groups ResetTouchGroups(TI_LEFT); ResetTouchGroups(TI_RIGHT); @@ -116,18 +116,18 @@ } -void +void SoccerRuleAspect::ResetFaultCounterPlayer(int unum, TTeamIndex idx) { - playerGround[unum][idx] = 0; - playerNotStanding[unum][idx] = 0; + 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; + prevPlayerInsideOwnArea[unum][idx] = 0; + playerInsideOwnArea[unum][idx] = 0; + playerFaultTime[unum][idx] = 0; } -void +void SoccerRuleAspect::ResetFaultCounter(TTeamIndex idx) { for(int t=1; t<=11; t++) { @@ -136,54 +136,54 @@ } // Process agent state: standing, sitted, laying down, ... -void +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 + //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]++; + { + 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]++; + playerGround[unum][idx]++; } //increase player standing or at least trying... Reset ground if (pos.z() >= middleZVal) { - playerStanding[unum][idx]++; + 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 (playerStanding[unum][idx] > 0.5 / 0.02) { + playerNotStanding[unum][idx] = 0; } } // 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++) + 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++) +// 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; +// cout << endl; // } } @@ -202,7 +202,7 @@ ownGoalPos = Vector3f(-mFieldLength/2.0, 0.0, 0.0); else ownGoalPos = Vector3f(mFieldLength/2.0, 0.0, 0.0); - + boost::shared_ptr<oxygen::Transform> agent_aspect; SoccerBase::TAgentStateList::const_iterator i; @@ -210,45 +210,45 @@ 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; + 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()) + + 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()) + + 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; + closestPlayer[idx] = unum; } // save player inside area state in previous cycle - prevPlayerInsideOwnArea[unum][idx] = playerInsideOwnArea[unum][idx]; + 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())) || + 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; + playerInsideOwnArea[unum][idx] = 1; //goalie is not repositioned when inside own area... if (unum == 1) - { - distGArr[unum][idx] = 0.0; - } + { + distGArr[unum][idx] = 0.0; + } } else playerInsideOwnArea[unum][idx] = 0; @@ -256,7 +256,7 @@ // 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 @@ -290,7 +290,7 @@ SoccerBase::TAgentStateList agent_states; if (! SoccerBase::GetAgentStates(*mBallState.get(), agent_states, idx)) return; - + SoccerBase::TAgentStateList::const_iterator i; for (i = agent_states.begin(); i != agent_states.end(); i++) { @@ -307,31 +307,31 @@ 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)) + // 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]++; } // I am the second closest player but i am too near the ball (and not the goalie) - else if(unum != 1 && closestPlayerDist[idx2] < mMinOppDistance && - distArr[unum][idx] <= mMin2PlDistance + 0.01 && ordArr[unum][idx] == 2 ) + else if(unum != 1 && closestPlayerDist[idx2] < mMinOppDistance && + distArr[unum][idx] <= mMin2PlDistance + 0.01 && ordArr[unum][idx] == 2 ) { playerFaultTime[unum][idx]++; } - // Too many players inside my own penalty area and Im am the last one to enter or + // 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 else if((numPlInsideOwnArea[idx] > mMaxPlayersInsideOwnArea && unum != 1 && playerInsideOwnArea[unum][idx] == 1 && - (prevPlayerInsideOwnArea[unum][idx] == 0 || + (prevPlayerInsideOwnArea[unum][idx] == 0 || (prevPlayerInsideOwnArea[1][idx] == 0 && playerInsideOwnArea[1][idx] == 1 && mMaxPlayersInsideOwnArea + 1 == ordGArr[unum][idx])))) { playerFaultTime[unum][idx]++; } // I am a field player and on the ground for too much time - else if (unum != 1 && playerGround[unum][idx] > mGroundMaxTime / 0.02) + else if (unum != 1 && playerGround[unum][idx] > mGroundMaxTime / 0.02) { playerFaultTime[unum][idx]++; } @@ -346,7 +346,7 @@ playerFaultTime[unum][idx]++; } // I am the goalie and I and not standing for too much time - else if (unum == 1 && playerNotStanding[unum][idx] > mGoalieNotStandingMaxTime / 0.02) + else if (unum == 1 && playerNotStanding[unum][idx] > mGoalieNotStandingMaxTime / 0.02) { playerFaultTime[unum][idx]++; } @@ -354,11 +354,11 @@ { playerFaultTime[unum][idx]=0; } - } + } } -salt::Vector3f SoccerRuleAspect::RepositionOutsidePos(salt::Vector3f posIni, int unum, TTeamIndex idx) +salt::Vector3f SoccerRuleAspect::RepositionOutsidePos(salt::Vector3f posIni, int unum, TTeamIndex idx) { salt::Vector3f pos; // Choose x side based on team @@ -396,12 +396,12 @@ 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); + salt::Vector3f new_pos = RepositionOutsidePos(ballPos, unum, idx); //Calculate my Reposition pos outside of the field - SoccerBase::MoveAgent(agent_aspect, new_pos); + 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; + //cout << "*********Player Repos Num: " << unum << " Team: " << team << " Pos: " << new_pos << endl; } } } @@ -1025,9 +1025,35 @@ { // check if the ball is in one of the goals TTeamIndex idx = mBallState->GetGoalState(); + if (idx == TI_NONE) { - return false; + const salt::Vector3f ballPos = mBallBody->GetPosition(); + const float xDist2Goal = fabs(ballPos.x()) - mGoalBallLineX; + + // check if ball is completely out of the field + if (xDist2Goal < 0) + return false; + + salt::Vector3f normBVel = mBallBody->GetVelocity(); + // ball should be inside the field recently (assumes that the simulation + // step size is smaller than 1 second) + if (ballPos.x() - normBVel.x() > mGoalBallLineX) + return false; + + normBVel.Normalize(); + double velCos = normBVel.x(); + double dist = xDist2Goal / velCos; + salt::Vector3f crossPoint = ballPos - normBVel * dist; + + if (fabs(crossPoint.y()) < mGoalWidth / 2.0 && + crossPoint.z() < mGoalHeight) + { + if (ballPos.x() < 0) + idx = TI_LEFT; + else + idx = TI_RIGHT; + } } // score the lucky team @@ -1231,7 +1257,7 @@ << playMode << "\n"; break; } - + // Simple Referee AutomaticSimpleReferee(playMode); } @@ -1281,6 +1307,7 @@ SoccerBase::GetSoccerVar(*this,"FieldLength",mFieldLength); SoccerBase::GetSoccerVar(*this,"FieldWidth",mFieldWidth); SoccerBase::GetSoccerVar(*this,"GoalWidth",mGoalWidth); + SoccerBase::GetSoccerVar(*this,"GoalHeight",mGoalHeight); SoccerBase::GetSoccerVar(*this,"FreeKickDistance",mFreeKickDist); SoccerBase::GetSoccerVar(*this,"FreeKickMoveDist",mFreeKickMoveDist); SoccerBase::GetSoccerVar(*this,"GoalKickDist",mGoalKickDist); @@ -1291,9 +1318,9 @@ float penaltyLength, penaltyWidth; SoccerBase::GetSoccerVar(*this,"PenaltyLength",penaltyLength); SoccerBase::GetSoccerVar(*this,"PenaltyWidth",penaltyWidth); - + // auto ref parameters - SoccerBase::GetSoccerVar(*this,"NotStandingMaxTime",mNotStandingMaxTime); + SoccerBase::GetSoccerVar(*this,"NotStandingMaxTime",mNotStandingMaxTime); SoccerBase::GetSoccerVar(*this,"GoalieNotStandingMaxTime",mGoalieNotStandingMaxTime); SoccerBase::GetSoccerVar(*this,"GroundMaxTime",mGroundMaxTime); SoccerBase::GetSoccerVar(*this,"GoalieGroundMaxTime",mGoalieGroundMaxTime); @@ -1324,6 +1351,8 @@ -(penaltyWidth + mGoalWidth)/2.0), Vector2f(-mFieldLength/2.0, (penaltyWidth + mGoalWidth)/2.0)); + + mGoalBallLineX = mFieldLength / 2.0 + mBallRadius; } void @@ -1753,7 +1782,7 @@ SoccerBase::TAgentStateList agent_states; if (SoccerBase::GetAgentStates(*mBallState.get(), agent_states, TI_NONE)) { - + SoccerBase::TAgentStateList::const_iterator i; for (i = agent_states.begin(); i != agent_states.end(); ++i) (*i)->UnSelect(); @@ -1768,7 +1797,7 @@ if (SoccerBase::GetAgentStates(*mBallState.get(), agent_states, TI_NONE) && agent_states.size() > 0) { boost::shared_ptr<AgentState> first = agent_states.front(); - + SoccerBase::TAgentStateList::const_iterator i; for (i = agent_states.begin(); i != agent_states.end(); ++i) { @@ -1784,7 +1813,7 @@ return; } } - + // No agent selected, select first first->Select(); } Modified: trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.h =================================================================== --- trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.h 2011-04-20 23:14:35 UTC (rev 267) +++ trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.h 2011-04-20 23:19:27 UTC (rev 268) @@ -45,7 +45,7 @@ { public: typedef std::list<boost::shared_ptr<AgentState> > TAgentStateList; - + public: SoccerRuleAspect(); virtual ~SoccerRuleAspect(); @@ -64,13 +64,13 @@ \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 */ @@ -80,7 +80,7 @@ */ void ClearPlayersAutomatic(TTeamIndex idx); - /** Calculates distance arrays needed for repositioning players + /** Calculates distance arrays needed for repositioning players */ void CalculateDistanceArrays(TTeamIndex idx); @@ -99,18 +99,18 @@ */ void ResetFaultCounterPlayer(int unum, TTeamIndex idx); - /**Analyse Faults from players and increase fault counter of offending players + /**Analyse Faults from players and increase fault counter of offending players */ void AnalyseFaults(TTeamIndex idx); /** Check whether too many agents are touching */ void AnalyseTouchGroups(TTeamIndex idx); - + /** Reset the touch groups */ void ResetTouchGroups(TTeamIndex idx); - + /** Automatic Referee that clears players that violate the rules */ void AutomaticSimpleReferee(TPlayMode playMode); @@ -138,19 +138,19 @@ void ClearPlayersWithException(const salt::Vector3f& pos, float radius, float min_dist, TTeamIndex idx, boost::shared_ptr<AgentState> agentState); - /** + /** * get the size of field, i.e. length and width - * - * + * + * * @return the length and width */ salt::Vector2f GetFieldSize() const; - - + + void ResetAgentSelection(); - + void SelectNextAgent(); - + void ClearSelectedPlayers(); protected: @@ -238,7 +238,7 @@ */ void ClearPlayers(const salt::AABB2& box, float min_dist, TTeamIndex idx); - /** + /** * clear the player before kick off, if the team is the kick off * side, the robots can be on his own half and the center circle, * otherwise the robots can only be on his own half except the @@ -247,7 +247,7 @@ * @param idx the team which kick off */ void ClearPlayersBeforeKickOff(TTeamIndex idx); - + protected: /** reference to the body node of the Ball */ boost::shared_ptr<oxygen::RigidBody> mBallBody; @@ -277,6 +277,10 @@ float mFieldWidth; /** the goal width (in meters) */ float mGoalWidth; + /** the goal height (in meters) */ + float mGoalHeight; + /** the absolute x coordinate of the goal which ball should pass (in meters) */ + float mGoalBallLineX; /** the point on the field where we do the kick in, free kick etc. */ salt::Vector3f mFreeKickPos; /** the distance opponents have to keep during free kicks, kick ins etc. */ @@ -295,28 +299,28 @@ //FCP 2010 - New Parameters (added by FCPortugal for Singapure 2010) /** max time player may be sitted or laying down before being repositioned */ - int mNotStandingMaxTime; + int mNotStandingMaxTime; /** max time player may be on the ground before being repositioned */ - int mGroundMaxTime; + int mGroundMaxTime; /** max time goalie may be sitted or laying down before being repositioned */ - int mGoalieNotStandingMaxTime; + 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; + float mMin2PlDistance; /** min dist for third closest of team before being repositioned */ - float mMin3PlDistance; + float mMin3PlDistance; /** min dist for closest Opponent to ball in order to use repositions for the second and third player*/ - float mMinOppDistance; + float mMinOppDistance; /** maximum number of players of the defending team that may be inside own penalty area */ - int mMaxPlayersInsideOwnArea; + int mMaxPlayersInsideOwnArea; /** maximum number of players that may be in a single touch group */ int mMaxTouchGroupSize; /** maximum time allowed for a player to commit a positional fault before being repositioned */ - int mMaxFaultTime; + 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 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 @@ -329,7 +333,7 @@ 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 */ + /* FCP 2010 - New Parameters */ // areas where opponents are not allowed in certain play modes /** bounding box for the right half of the field */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <he...@us...> - 2011-04-21 13:55:54
|
Revision: 269 http://simspark.svn.sourceforge.net/simspark/?rev=269&view=rev Author: hedayat Date: 2011-04-21 13:55:47 +0000 (Thu, 21 Apr 2011) Log Message: ----------- - use float variables in CheckGoal - remove an opponent when the number of opponents in a group are greater than the number of team mates Modified Paths: -------------- trunk/rcssserver3d/ChangeLog trunk/rcssserver3d/NEWS trunk/rcssserver3d/RELEASE trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp Modified: trunk/rcssserver3d/ChangeLog =================================================================== --- trunk/rcssserver3d/ChangeLog 2011-04-20 23:19:27 UTC (rev 268) +++ trunk/rcssserver3d/ChangeLog 2011-04-21 13:55:47 UTC (rev 269) @@ -1,11 +1,23 @@ 2011-04-21 Hedayat Vatankhah <hed...@gm...> + * NEWS: + * RELEASE: + - updated for 0.6.5 to reflect removing an opponent from a touch group when + there are more opponents in the group than teammates + * plugin/soccer/soccerruleaspect/soccerruleaspect.h: - * plugin/soccer/soccerruleaspect/soccerruleaspect.cpp (SoccerRuleAspect::CheckGoal): + * plugin/soccer/soccerruleaspect/soccerruleaspect.cpp + (SoccerRuleAspect::CheckGoal): - if goal recorder's cannot detect any goals, geometrically check to make sure that no goal is actually happened. Thanks to Luis for starting the effort and Mahdi for the initial code for calculating where the ball crosses the goal geometrically. + (SoccerRuleAspect::AnalyseTouchGroups): + - reposition a player from a team with more players in a touch group. Thanks + to Nexus3D (Mehdi?) for the initial patch. It intended to reposition the + player who joined last even from the opponent team, but we don't have + this info now so remove an unspecified player from the opponent if the + last player is not going to be removed. 2011-03-28 Hedayat Vatankhah <hed...@gm...> Modified: trunk/rcssserver3d/NEWS =================================================================== --- trunk/rcssserver3d/NEWS 2011-04-20 23:19:27 UTC (rev 268) +++ trunk/rcssserver3d/NEWS 2011-04-21 13:55:47 UTC (rev 269) @@ -12,7 +12,9 @@ a high number of collisions in 9 vs 9 games: - If an agent is in touch with more than 2 agents (including himself), and he wasn't in such a situation in the previous time step - which means he is the - last to join the group - he is relocated outside of the field. + last to join the group - he is relocated outside of the field. However, if + the number of opponents in the group are more than teammates, an unspecified + opponent will be relocated instead. - If it is not clear which agent joined the group last, e.g. when 3 players were all separate at time t, but were all touching each other in time t + 1, an agent is chosen at random for relocation. Modified: trunk/rcssserver3d/RELEASE =================================================================== --- trunk/rcssserver3d/RELEASE 2011-04-20 23:19:27 UTC (rev 268) +++ trunk/rcssserver3d/RELEASE 2011-04-21 13:55:47 UTC (rev 269) @@ -13,7 +13,9 @@ a high number of collisions in 9 vs 9 games: - If an agent is in touch with more than 2 agents (including himself), and he wasn't in such a situation in the previous time step - which means he is the - last to join the group - he is relocated outside of the field. + last to join the group - he is relocated outside of the field. However, if + the number of opponents in the group are more than teammates, an unspecified + opponent will be relocated instead. - If it is not clear which agent joined the group last, e.g. when 3 players were all separate at time t, but were all touching each other in time t + 1, an agent is chosen at random for relocation. Modified: trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2011-04-20 23:19:27 UTC (rev 268) +++ trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2011-04-21 13:55:47 UTC (rev 269) @@ -84,7 +84,7 @@ } /* 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) */ +players inappropriate behavior (laying on the ground or not walking for too much time) */ void SoccerRuleAspect::AutomaticSimpleReferee(TPlayMode playMode) { @@ -98,11 +98,13 @@ { 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 + AnalyseFaults(TI_LEFT); // Analyzes simple faults for the left team + AnalyseFaults(TI_RIGHT); // Analyzes simple faults for the right team AnalyseTouchGroups(TI_LEFT); AnalyseTouchGroups(TI_RIGHT); - // Only apply rules during play-on + + // Only apply rules during play-on, leaves some time for agents to + // solve it themselves if (playMode == PM_PlayOn) { ClearPlayersAutomatic(TI_LEFT); // enforce standing and not overcrowding rules for left team @@ -275,12 +277,39 @@ SoccerBase::TAgentStateList::iterator i = agent_states.begin(); for (; i != agent_states.end(); ++i) { + boost::shared_ptr<TouchGroup> touchGroup = (*i)->GetOldTouchGroup(); + // Wasn't touching before, joined group making group too large - if ((*i)->GetOldTouchGroup()->size() == 1 && (*i)->GetTouchGroup()->size() > mMaxTouchGroupSize) + if (touchGroup->size() == 1 && touchGroup->size() > mMaxTouchGroupSize) { - playerFaultTime[(*i)->GetUniformNumber()][idx]++; - // Remove player from touch group so no more agents are replaced - (*i)->GetTouchGroup()->erase(*i); + // determine the team that has more players in the touch group + int pl[3] = { 0 }; + TTeamIndex oppIdx; + TouchGroup::iterator oppIt; // stores the last opponent in touch group + for (TouchGroup::iterator agentIt = touchGroup->begin(); + agentIt != touchGroup->end(); ++agentIt) + { + pl[(*agentIt)->GetTeamIndex()]++; + if ((*agentIt)->GetTeamIndex() != idx) + { + oppIdx = (*agentIt)->GetTeamIndex(); + oppIt = agentIt; + } + } + + if (pl[idx] >= touchGroup->size() - pl[idx]) + { + playerFaultTime[(*i)->GetUniformNumber()][idx]++; + // Remove player from touch group so no more agents are replaced + touchGroup->erase(*i); + } + else + { + // I am the last one to enter the group, but the number of + // opponents in the group are more than us + playerFaultTime[(*oppIt)->GetUniformNumber()][oppIdx]++; + touchGroup->erase(*oppIt); + } } } } @@ -1042,8 +1071,8 @@ return false; normBVel.Normalize(); - double velCos = normBVel.x(); - double dist = xDist2Goal / velCos; + float velCos = normBVel.x(); + float dist = xDist2Goal / velCos; salt::Vector3f crossPoint = ballPos - normBVel * dist; if (fabs(crossPoint.y()) < mGoalWidth / 2.0 && This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <he...@us...> - 2011-04-29 18:28:18
|
Revision: 277 http://simspark.svn.sourceforge.net/simspark/?rev=277&view=rev Author: hedayat Date: 2011-04-29 18:28:11 +0000 (Fri, 29 Apr 2011) Log Message: ----------- Some compilation fixes for Windows and a small cleanup Modified Paths: -------------- trunk/rcssserver3d/CMakeLists.txt trunk/rcssserver3d/ChangeLog trunk/rcssserver3d/rcssserver3d/CMakeLists.txt trunk/rcssserver3d/windows/install_extra.nsi Removed Paths: ------------- trunk/rcssserver3d/cmake/FindBoost.cmake Modified: trunk/rcssserver3d/CMakeLists.txt =================================================================== --- trunk/rcssserver3d/CMakeLists.txt 2011-04-29 18:16:55 UTC (rev 276) +++ trunk/rcssserver3d/CMakeLists.txt 2011-04-29 18:28:11 UTC (rev 277) @@ -12,6 +12,12 @@ set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/) set(ENV{SDLDIR} $ENV{SDLDIR} C:/library/SDL/ "C:/Program Files/SDL/" "C:/Program Files (x86)/SDL/" C:/SDL/) +if (WIN32) + set(Boost_USE_STATIC_LIBS ON) + set(Boost_USE_MULTITHREADED ON) + set(Boost_USE_STATIC_RUNTIME OFF) +endif (WIN32) + find_package(Spark REQUIRED) find_package(Freetype REQUIRED) find_package(Boost REQUIRED) @@ -41,7 +47,7 @@ endif (UNIX) if(WIN32) - add_definitions(-D_CRT_SECURE_NO_WARNINGS -DBOOST_ALL_DYN_LINK) + add_definitions(-D_CRT_SECURE_NO_WARNINGS) include_directories(${CMAKE_SOURCE_DIR}/windows/include) if(MSVC) add_definitions(/Gm /Zi /GL) Modified: trunk/rcssserver3d/ChangeLog =================================================================== --- trunk/rcssserver3d/ChangeLog 2011-04-29 18:16:55 UTC (rev 276) +++ trunk/rcssserver3d/ChangeLog 2011-04-29 18:28:11 UTC (rev 277) @@ -1,3 +1,17 @@ +2011-04-29 Hedayat Vatankhah <hed...@gm...> + + * CMakeLists.txt: + - use static boost libraries under Windows + + * windows/install_extra.nsi: + - adopt the script for the latest version of CMake and NSIS + + * rcssserver3d/CMakeLists.txt: + - don't install Linux only files in Windows + + * cmake/FindBoost.cmake: + - removed in favor of CMake's own version + 2011-04-21 Hedayat Vatankhah <hed...@gm...> * NEWS: Deleted: trunk/rcssserver3d/cmake/FindBoost.cmake =================================================================== --- trunk/rcssserver3d/cmake/FindBoost.cmake 2011-04-29 18:16:55 UTC (rev 276) +++ trunk/rcssserver3d/cmake/FindBoost.cmake 2011-04-29 18:28:11 UTC (rev 277) @@ -1,938 +0,0 @@ -# - 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 <ma...@cy...> -# Copyright 2007 Wengo -# Copyright 2007 Mike Jackson -# Copyright 2008 Andreas Pakulat <ap...@gm...> -# Copyright 2008-2009 Philip Lowman <ph...@yh...> -# -# 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) - Modified: trunk/rcssserver3d/rcssserver3d/CMakeLists.txt =================================================================== --- trunk/rcssserver3d/rcssserver3d/CMakeLists.txt 2011-04-29 18:16:55 UTC (rev 276) +++ trunk/rcssserver3d/rcssserver3d/CMakeLists.txt 2011-04-29 18:28:11 UTC (rev 277) @@ -31,7 +31,9 @@ internalsoccermonitor.rb internalsoccerbindings.rb DESTINATION ${DATADIR}/${CMAKE_PROJECT_NAME}) -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) +if (NOT WIN32) + 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) \ No newline at end of file Modified: trunk/rcssserver3d/windows/install_extra.nsi =================================================================== --- trunk/rcssserver3d/windows/install_extra.nsi 2011-04-29 18:16:55 UTC (rev 276) +++ trunk/rcssserver3d/windows/install_extra.nsi 2011-04-29 18:28:11 UTC (rev 277) @@ -1,8 +1,13 @@ -CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\RCSSServer3D.lnk" "$INSTDIR\bin\rcssserver3d.cmd" -CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\RCSSMonitor3D.lnk" "$INSTDIR\bin\rcssmonitor3d.cmd" -!insertmacro MUI_STARTMENU_WRITE_END -!define MUI_STARTMENUPAGE_CURRENT_ID "SOMETHING_NOT_AVAILABLE" +; Creating Start Menu shortcuts only if it is enabled +Var /GLOBAL MyTemp +StrCpy $MyTemp "${MUI_STARTMENUPAGE_Application_VARIABLE}" 1 +;If the folder start with >, the user has chosen not to create a shortcut +${if} $MyTemp != ">" + CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\RCSSServer3D.lnk" "$INSTDIR\bin\rcssserver3d.cmd" + CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\RCSSMonitor3D.lnk" "$INSTDIR\bin\rcssmonitor3d.cmd" +${endif} + WriteRegExpandStr HKLM 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment\' 'RCSSSERVER3D_DIR' '$INSTDIR' ClearErrors FileOpen $0 $INSTDIR\bin\rcssserver3d.cmd w This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <he...@us...> - 2011-05-13 21:56:18
|
Revision: 283 http://simspark.svn.sourceforge.net/simspark/?rev=283&view=rev Author: hedayat Date: 2011-05-13 21:56:12 +0000 (Fri, 13 May 2011) Log Message: ----------- Fixed a bug in goal counting Modified Paths: -------------- trunk/rcssserver3d/ChangeLog trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp Modified: trunk/rcssserver3d/ChangeLog =================================================================== --- trunk/rcssserver3d/ChangeLog 2011-05-01 22:11:58 UTC (rev 282) +++ trunk/rcssserver3d/ChangeLog 2011-05-13 21:56:12 UTC (rev 283) @@ -1,3 +1,10 @@ +2011-05-14 Hedayat Vatankhah <hed...@gm...> + + * plugin/soccer/soccerruleaspect/soccerruleaspect.cpp + (SoccerRuleAspect::CheckGoal): + - fixed a small bug in goal counting which cause this function to always + count a goal when ball moved out of the field + 2011-05-02 Hedayat Vatankhah <hed...@gm...> * CMakeLists.txt: Modified: trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2011-05-01 22:11:58 UTC (rev 282) +++ trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2011-05-13 21:56:12 UTC (rev 283) @@ -1067,7 +1067,7 @@ salt::Vector3f normBVel = mBallBody->GetVelocity(); // ball should be inside the field recently (assumes that the simulation // step size is smaller than 1 second) - if (ballPos.x() - normBVel.x() > mGoalBallLineX) + if (fabs(ballPos.x() - normBVel.x()) > mGoalBallLineX) return false; normBVel.Normalize(); @@ -1083,6 +1083,8 @@ else idx = TI_RIGHT; } + else + return false; } // score the lucky team This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <he...@us...> - 2011-06-06 10:23:23
|
Revision: 284 http://simspark.svn.sourceforge.net/simspark/?rev=284&view=rev Author: hedayat Date: 2011-06-06 10:23:16 +0000 (Mon, 06 Jun 2011) Log Message: ----------- Fixed a small but important mistake I made in AnalyseTouchGroups Modified Paths: -------------- trunk/rcssserver3d/ChangeLog trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp Modified: trunk/rcssserver3d/ChangeLog =================================================================== --- trunk/rcssserver3d/ChangeLog 2011-05-13 21:56:12 UTC (rev 283) +++ trunk/rcssserver3d/ChangeLog 2011-06-06 10:23:16 UTC (rev 284) @@ -1,3 +1,10 @@ +2011-06-06 Hedayat Vatankhah <hed...@gm...> + + * plugin/soccer/soccerruleaspect/soccerruleaspect.cpp + (SoccerRuleAspect::AnalyseTouchGroups): + - fixed a horrible mistake of mine which prevented from touch group rules + to be applied at all + 2011-05-14 Hedayat Vatankhah <hed...@gm...> * plugin/soccer/soccerruleaspect/soccerruleaspect.cpp Modified: trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2011-05-13 21:56:12 UTC (rev 283) +++ trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2011-06-06 10:23:16 UTC (rev 284) @@ -277,10 +277,11 @@ SoccerBase::TAgentStateList::iterator i = agent_states.begin(); for (; i != agent_states.end(); ++i) { - boost::shared_ptr<TouchGroup> touchGroup = (*i)->GetOldTouchGroup(); + boost::shared_ptr<TouchGroup> touchGroup = (*i)->GetTouchGroup(); // Wasn't touching before, joined group making group too large - if (touchGroup->size() == 1 && touchGroup->size() > mMaxTouchGroupSize) + if ((*i)->GetOldTouchGroup()->size() == 1 && + touchGroup->size() > mMaxTouchGroupSize) { // determine the team that has more players in the touch group int pl[3] = { 0 }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sgv...@us...> - 2012-02-14 15:51:37
|
Revision: 292 http://simspark.svn.sourceforge.net/simspark/?rev=292&view=rev Author: sgvandijk Date: 2012-02-14 15:51:26 +0000 (Tue, 14 Feb 2012) Log Message: ----------- - adopt init script path prefix change to rcssserver3d Modified Paths: -------------- trunk/rcssserver3d/ChangeLog trunk/rcssserver3d/rcssmonitor3d/main.cpp trunk/rcssserver3d/rcssserver3d/main.cpp Modified: trunk/rcssserver3d/ChangeLog =================================================================== --- trunk/rcssserver3d/ChangeLog 2012-02-14 15:48:05 UTC (rev 291) +++ trunk/rcssserver3d/ChangeLog 2012-02-14 15:51:26 UTC (rev 292) @@ -1,3 +1,10 @@ +2012-02-14 Sander van Dijk <sgv...@gm...> + + * rcssserver3d/main.cpp (Spark): + * rcssmonitor3d/main.cpp (Spark): + - add --init-script-prefix option to specify location of spark.rb, + zeitgeist.rb, etc + 2011-06-06 Hedayat Vatankhah <hed...@gm...> * plugin/soccer/soccerruleaspect/soccerruleaspect.cpp Modified: trunk/rcssserver3d/rcssmonitor3d/main.cpp =================================================================== --- trunk/rcssserver3d/rcssmonitor3d/main.cpp 2012-02-14 15:48:05 UTC (rev 291) +++ trunk/rcssserver3d/rcssmonitor3d/main.cpp 2012-02-14 15:51:26 UTC (rev 292) @@ -45,8 +45,8 @@ class MonitorSpark : public Spark { public: - MonitorSpark(const std::string& relPathPrefix) : - Spark(relPathPrefix) + MonitorSpark() : + Spark() {}; /** called once after Spark finished it's init */ @@ -165,7 +165,7 @@ int main(int argc, char** argv) { // the spark app framework instance - MonitorSpark spark("../../"); + MonitorSpark spark; if (! spark.Init(argc, argv)) { Modified: trunk/rcssserver3d/rcssserver3d/main.cpp =================================================================== --- trunk/rcssserver3d/rcssserver3d/main.cpp 2012-02-14 15:48:05 UTC (rev 291) +++ trunk/rcssserver3d/rcssserver3d/main.cpp 2012-02-14 15:51:26 UTC (rev 292) @@ -45,8 +45,8 @@ class SimSpark : public Spark { public: - SimSpark(const std::string& relPathPrefix) : - Spark(relPathPrefix), + SimSpark() : + Spark(), mScriptPath("rcssserver3d.rb") {}; @@ -83,10 +83,11 @@ GetLog()->Normal() << "\nusage: rcssserver3d [options] [script]\n" << "\noptions:\n" - << " --help\t\t\t print this message.\n" - << " --script-path PATH\t set the script path (rcssserver3d.rb path).\n" - << "--agent-port PORTNUM\t port for agents to connect to.\n" - << "--server-port PORTNUM\t port for monitors to connect to.\n" + << " --help\t\t\t\t print this message.\n" + << " --script-path PATH\t\t set the script path (rcssserver3d.rb path).\n" + << " --init-script-prefix PATH\t path prefix for init scripts (spark.rb, oxygen.rb, etc.).\n" + << " --agent-port PORTNUM\t\t port for agents to connect to.\n" + << " --server-port PORTNUM\t\t port for monitors to connect to.\n" << "\n"; } @@ -166,7 +167,7 @@ int main(int argc, char** argv) { // the spark app framework instance - SimSpark spark("../../"); + SimSpark spark; if (! spark.Init(argc, argv)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <he...@us...> - 2012-04-08 21:39:40
|
Revision: 302 http://simspark.svn.sourceforge.net/simspark/?rev=302&view=rev Author: hedayat Date: 2012-04-08 21:39:34 +0000 (Sun, 08 Apr 2012) Log Message: ----------- Change teams' sides on the second half Modified Paths: -------------- trunk/rcssserver3d/ChangeLog trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.h trunk/rcssserver3d/rcssserver3d/naosoccersim.rb Modified: trunk/rcssserver3d/ChangeLog =================================================================== --- trunk/rcssserver3d/ChangeLog 2012-04-07 07:22:30 UTC (rev 301) +++ trunk/rcssserver3d/ChangeLog 2012-04-08 21:39:34 UTC (rev 302) @@ -1,3 +1,10 @@ +2012-04-09 Hedayat Vatankhah <hed...@gm...> + + * plugin/soccer/soccerruleaspect/soccerruleaspect.h: + * plugin/soccer/soccerruleaspect/soccerruleaspect.cpp (SoccerRuleAspect::SwapTeamSides): + * rcssserver3d/naosoccersim.rb: + - change teams' sides in the second half if enabled (enabled by default) + 2012-04-07 Hedayat Vatankhah <hed...@gm...> * plugin/soccer/soccerruleaspect/soccerruleaspect.cpp (SoccerRuleAspect::UpdateGameOver): Modified: trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2012-04-07 07:22:30 UTC (rev 301) +++ trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2012-04-08 21:39:34 UTC (rev 302) @@ -50,6 +50,7 @@ mWaitBeforeKickOff(1.0), mSingleHalfTime(false), mAutomaticQuit(true), + mChangeSidesInSecondHalf(true), mSayMsgSize(20), mAudioCutDist(50.0), mFirstCollidingAgent(true), @@ -577,6 +578,20 @@ } void +SoccerRuleAspect::SwapTeamSides() +{ + SoccerBase::TAgentStateList agent_states; + if (! SoccerBase::GetAgentStates(*mBallState.get(), agent_states)) + return; + + SoccerBase::TAgentStateList::iterator it; + for (it = agent_states.begin(); it != agent_states.end(); ++it) + { + (*it)->SetTeamIndex(SoccerBase::OpponentTeam((*it)->GetTeamIndex())); + } +} + +void SoccerRuleAspect::ClearSelectedPlayers() { float min_dist = mFreeKickMoveDist; @@ -1183,6 +1198,8 @@ // the first game half is over mGameState->SetPlayMode(PM_BeforeKickOff); mGameState->SetGameHalf(GH_SECOND); + if (mChangeSidesInSecondHalf) + SwapTeamSides(); } } else if ((half == GH_SECOND) && (now >= 2 * mHalfTime)) @@ -1348,6 +1365,7 @@ SoccerBase::GetSoccerVar(*this,"WaitBeforeKickOff",mWaitBeforeKickOff); SoccerBase::GetSoccerVar(*this,"SingleHalfTime",mSingleHalfTime); SoccerBase::GetSoccerVar(*this,"AutomaticQuit",mAutomaticQuit); + SoccerBase::GetSoccerVar(*this,"ChangeSidesInSecondHalf",mChangeSidesInSecondHalf); SoccerBase::GetSoccerVar(*this,"UseOffside",mUseOffside); float penaltyLength, penaltyWidth; SoccerBase::GetSoccerVar(*this,"PenaltyLength",penaltyLength); Modified: trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.h =================================================================== --- trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.h 2012-04-07 07:22:30 UTC (rev 301) +++ trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.h 2012-04-08 21:39:34 UTC (rev 302) @@ -248,6 +248,11 @@ */ void ClearPlayersBeforeKickOff(TTeamIndex idx); + /** + * swaps the side of the teams + */ + void SwapTeamSides(); + protected: /** reference to the body node of the Ball */ boost::shared_ptr<oxygen::RigidBody> mBallBody; @@ -298,6 +303,8 @@ bool mSingleHalfTime; /** flag if the simulator should quit automatically when the game is over */ bool mAutomaticQuit; + /** flag if the side of the teams should be changed in the second half*/ + bool mChangeSidesInSecondHalf; //FCP 2010 - New Parameters (added by FCPortugal for Singapure 2010) /** max time player may be sitted or laying down before being repositioned */ Modified: trunk/rcssserver3d/rcssserver3d/naosoccersim.rb =================================================================== --- trunk/rcssserver3d/rcssserver3d/naosoccersim.rb 2012-04-07 07:22:30 UTC (rev 301) +++ trunk/rcssserver3d/rcssserver3d/naosoccersim.rb 2012-04-08 21:39:34 UTC (rev 302) @@ -51,6 +51,7 @@ addSoccerVar('AutomaticKickOff', false) addSoccerVar('WaitBeforeKickOff', 2.0) addSoccerVar('AutomaticQuit', true) +addSoccerVar('ChangeSidesInSecondHalf', true) addSoccerVar('BorderSize', 0.0) # prevent complaining about missing variable # agent parameters This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <he...@us...> - 2012-04-09 20:46:50
|
Revision: 303 http://simspark.svn.sourceforge.net/simspark/?rev=303&view=rev Author: hedayat Date: 2012-04-09 20:46:44 +0000 (Mon, 09 Apr 2012) Log Message: ----------- Automatic KickOff should work fine in all cases and correctly select the kickoff side for the second half. Wait for the specified time before automatic kickoff from when the first agent connects rather than when the simulator is started. Modified Paths: -------------- trunk/rcssserver3d/ChangeLog trunk/rcssserver3d/plugin/soccer/gamestateaspect/gamestateaspect.cpp trunk/rcssserver3d/plugin/soccer/gamestateaspect/gamestateaspect.h trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.h trunk/rcssserver3d/rcssserver3d/naosoccersim.rb Modified: trunk/rcssserver3d/ChangeLog =================================================================== --- trunk/rcssserver3d/ChangeLog 2012-04-08 21:39:34 UTC (rev 302) +++ trunk/rcssserver3d/ChangeLog 2012-04-09 20:46:44 UTC (rev 303) @@ -1,9 +1,29 @@ +2012-04-10 Hedayat Vatankhah <hed...@gm...> + + * plugin/soccer/soccerruleaspect/soccerruleaspect.cpp + (SoccerRuleAspect::UpdateBeforeKickOff): + - WaitBeforeKickOff is now calculated from when the first agent connects + rather than from the beginning of the before kickoff playmode (when the + simulator is started) + 2012-04-09 Hedayat Vatankhah <hed...@gm...> + * plugin/soccer/gamestateaspect/gamestateaspect.h (GameStateAspect): + * plugin/soccer/gamestateaspect/gamestateaspect.cpp (GameStateAspect::KickOff): + - Fix KickOff for the second half: give the ball to the other team in all + cases (both when the teams change their sides in the second half and when + they don't). + * plugin/soccer/soccerruleaspect/soccerruleaspect.h: * plugin/soccer/soccerruleaspect/soccerruleaspect.cpp (SoccerRuleAspect::SwapTeamSides): - * rcssserver3d/naosoccersim.rb: - change teams' sides in the second half if enabled (enabled by default) + + * rcssserver3d/naosoccersim.rb: + - add new variables for the above changes: CoinTossForKickOff and + ChangeSidesInSecondHalf. The former specifies if in the automatic kickoff + mode, the first half kick off is always given to the left team or is + determined randomly. The latter specifies if the teams should change + their sides in the second half. 2012-04-07 Hedayat Vatankhah <hed...@gm...> Modified: trunk/rcssserver3d/plugin/soccer/gamestateaspect/gamestateaspect.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/gamestateaspect/gamestateaspect.cpp 2012-04-08 21:39:34 UTC (rev 302) +++ trunk/rcssserver3d/plugin/soccer/gamestateaspect/gamestateaspect.cpp 2012-04-09 20:46:44 UTC (rev 303) @@ -40,8 +40,8 @@ mGameHalf = GH_FIRST; mScore[0] = 0; mScore[1] = 0; - mLastKickOff = TI_NONE; - //mSecondHalfKickOff = TI_NONE; + mLastKickOffGameHalf = GH_NONE; + mNextHalfKickOff = TI_NONE; mLeftInit = Vector3f(0,0,0); mRightInit = Vector3f(0,0,0); mFinished = false; @@ -97,77 +97,35 @@ } -// let the monitor handle who kicks off in 2nd half. void GameStateAspect::KickOff(TTeamIndex ti) { - // throw a coin to determine which team kicks off + // throw a coin to determine which team kicks off, except if a new half + // is started in which the opposite team should kick off if (ti == TI_NONE) { ti = (salt::UniformRNG<>(0,1)() <= 0.5) ? TI_LEFT : TI_RIGHT; + + if (mGameHalf != mLastKickOffGameHalf) + { + if (mNextHalfKickOff != TI_NONE) + ti = mNextHalfKickOff; + + bool changeSides; + SoccerBase::GetSoccerVar(*this, "ChangeSidesInSecondHalf", + changeSides); + + if (changeSides) + mNextHalfKickOff = ti; + else + mNextHalfKickOff = (ti == TI_LEFT) ? TI_RIGHT : TI_LEFT; + } } SetPlayMode((ti == TI_LEFT) ? PM_KickOff_Left : PM_KickOff_Right); - - if (mLastKickOff == TI_NONE) - mLastKickOff = ti; + mLastKickOffGameHalf = mGameHalf; } - - -// void -// GameStateAspect::KickOff(TTeamIndex ti) -// { -// if (mGameHalf == GH_FIRST) -// { -// // throw a coin to determine which team kicks off -// if (ti == TI_NONE) -// { -// ti = (salt::UniformRNG<>(0,1)() <= 0.5) ? TI_LEFT : TI_RIGHT; -// } - -// SetPlayMode((ti == TI_LEFT) ? PM_KickOff_Left : PM_KickOff_Right); - -// if (mLastKickOff == TI_NONE) -// mLastKickOff = ti; -// } -// else -// { -// // in the second half, let the opposite team kick off -// SetPlayMode((mLastKickOff == TI_LEFT) ? PM_KickOff_Right : PM_KickOff_Left); -// } -// } -//--------------------------------------------- -// void -// GameStateAspect::KickOff(TTeamIndex ti) -// { -// if (mGameHalf == GH_FIRST) -// { -// // throw a coin to determine which team kicks off -// if (ti == TI_NONE) -// { -// ti = (salt::UniformRNG<>(0,1)() <= 0.5) ? TI_LEFT : TI_RIGHT; -// } - -// SetPlayMode((ti == TI_LEFT) ? PM_KickOff_Left : PM_KickOff_Right); - -// mLastKickOff = ti; -// if (mSecondHalfKickOff == TI_NONE) -// { -// //clog << "setting mSecondHalfKickOff\n"; - -// mSecondHalfKickOff = -// (mLastKickOff == TI_LEFT) ? TI_RIGHT : TI_LEFT; -// } -// } -// else -// { -// // in the second half, let the opposite team kick off -// SetPlayMode((mSecondHalfKickOff == TI_LEFT) ? PM_KickOff_Left : PM_KickOff_Right); -// } -// } - -//--------------------------------------------- TTime GameStateAspect::GetTime() const { @@ -481,6 +439,11 @@ fieldWidth/2 - mAgentRadius*2, mAgentRadius ); + + bool coinTossKickOff = true; + SoccerBase::GetSoccerVar(*this, "CoinTossForKickOff", coinTossKickOff); + if (!coinTossKickOff) + mNextHalfKickOff = TI_LEFT; } int Modified: trunk/rcssserver3d/plugin/soccer/gamestateaspect/gamestateaspect.h =================================================================== --- trunk/rcssserver3d/plugin/soccer/gamestateaspect/gamestateaspect.h 2012-04-08 21:39:34 UTC (rev 302) +++ trunk/rcssserver3d/plugin/soccer/gamestateaspect/gamestateaspect.h 2012-04-09 20:46:44 UTC (rev 303) @@ -153,10 +153,10 @@ TGameHalf mGameHalf; /** the team that had the last KickOff */ - TTeamIndex mLastKickOff; + TGameHalf mLastKickOffGameHalf; -// /** the team that has to start the second half */ -// TTeamIndex mSecondHalfKickOff; + /** the team that has to start the next half */ + TTeamIndex mNextHalfKickOff; /** the names of the two teams */ std::string mTeamName[2]; Modified: trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2012-04-08 21:39:34 UTC (rev 302) +++ trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2012-04-09 20:46:44 UTC (rev 303) @@ -51,6 +51,7 @@ mSingleHalfTime(false), mAutomaticQuit(true), mChangeSidesInSecondHalf(true), + mAutoKickOffTimeOrigin(1000000.0), mSayMsgSize(20), mAudioCutDist(50.0), mFirstCollidingAgent(true), @@ -713,7 +714,13 @@ mInOffsideRightPlayers.clear(); #endif - if (mAutomaticKickOff && mGameState->GetModeTime() > mWaitBeforeKickOff) + float kickOffWaitTime = 0; + if (mAutoKickOffTimeOrigin > mGameState->GetModeTime()) + mAutoKickOffTimeOrigin = mGameState->GetModeTime(); + else + kickOffWaitTime = mGameState->GetModeTime() - mAutoKickOffTimeOrigin; + + if (mAutomaticKickOff && kickOffWaitTime > mWaitBeforeKickOff) { mGameState->KickOff(); } Modified: trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.h =================================================================== --- trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.h 2012-04-08 21:39:34 UTC (rev 302) +++ trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.h 2012-04-09 20:46:44 UTC (rev 303) @@ -305,6 +305,8 @@ bool mAutomaticQuit; /** flag if the side of the teams should be changed in the second half*/ bool mChangeSidesInSecondHalf; + /** time to wait until we kick off automatically */ + float mAutoKickOffTimeOrigin; //FCP 2010 - New Parameters (added by FCPortugal for Singapure 2010) /** max time player may be sitted or laying down before being repositioned */ Modified: trunk/rcssserver3d/rcssserver3d/naosoccersim.rb =================================================================== --- trunk/rcssserver3d/rcssserver3d/naosoccersim.rb 2012-04-08 21:39:34 UTC (rev 302) +++ trunk/rcssserver3d/rcssserver3d/naosoccersim.rb 2012-04-09 20:46:44 UTC (rev 303) @@ -48,11 +48,15 @@ addSoccerVar('FreeKickDistance', 1.3) addSoccerVar('FreeKickMoveDist', 1.5) addSoccerVar('GoalKickDist', 1.0) +addSoccerVar('BorderSize', 0.0) # prevent complaining about missing variable + +# soccer game settings addSoccerVar('AutomaticKickOff', false) -addSoccerVar('WaitBeforeKickOff', 2.0) +addSoccerVar('WaitBeforeKickOff', 5.0) +addSoccerVar('CoinTossForKickOff', false) + addSoccerVar('AutomaticQuit', true) addSoccerVar('ChangeSidesInSecondHalf', true) -addSoccerVar('BorderSize', 0.0) # prevent complaining about missing variable # agent parameters addSoccerVar('AgentRadius', 0.4) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <he...@us...> - 2012-04-16 09:41:48
|
Revision: 305 http://simspark.svn.sourceforge.net/simspark/?rev=305&view=rev Author: hedayat Date: 2012-04-16 09:41:37 +0000 (Mon, 16 Apr 2012) Log Message: ----------- Fixed a small bug in TrainerCommandParser Modified Paths: -------------- trunk/rcssserver3d/ChangeLog trunk/rcssserver3d/plugin/soccer/trainercommandparser/trainercommandparser.cpp Modified: trunk/rcssserver3d/ChangeLog =================================================================== --- trunk/rcssserver3d/ChangeLog 2012-04-09 21:00:07 UTC (rev 304) +++ trunk/rcssserver3d/ChangeLog 2012-04-16 09:41:37 UTC (rev 305) @@ -1,3 +1,9 @@ +2012-04-15 Hedayat Vatankhah <hed...@gm...> + + * plugin/soccer/trainercommandparser/trainercommandparser.cpp + (TrainerCommandParser::ParsePlayerCommand): + - fixed a small bug in parsing move paramter (Thanks to Andreas Seekircher) + 2012-04-10 Hedayat Vatankhah <hed...@gm...> * plugin/soccer/soccerruleaspect/soccerruleaspect.cpp Modified: trunk/rcssserver3d/plugin/soccer/trainercommandparser/trainercommandparser.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/trainercommandparser/trainercommandparser.cpp 2012-04-09 21:00:07 UTC (rev 304) +++ trunk/rcssserver3d/plugin/soccer/trainercommandparser/trainercommandparser.cpp 2012-04-16 09:41:37 UTC (rev 305) @@ -52,7 +52,7 @@ mCommandMap["repos"] = CT_REPOS; mCommandMap["killsim"] = CT_KILLSIM; mCommandMap["reqfullstate"] = CT_REQFULLSTATE; - + // setup team index map // Originally team sides were "L","R" and "N" // But this seems to be unused @@ -124,7 +124,7 @@ mSimServer = shared_dynamic_cast<SimulationServer> (GetCore()->Get("/sys/server/simulation")); - + if (mGameControl.get() == 0) { GetLog()->Error() << "ERROR: (TrainerCommandParser) Unable to get SimulationServer\n"; @@ -132,7 +132,7 @@ mMonitorControl = shared_dynamic_cast<MonitorControl> (mSimServer->GetControlNode("MonitorControl")); - + if (mMonitorControl.get() == 0) { GetLog()->Error() << "ERROR: (TrainerCommandParser) Unable to get MonitorControl\n"; @@ -235,7 +235,7 @@ case CT_REQFULLSTATE: mMonitorControl->RequestFullState(); break; - + default: return false; } @@ -244,7 +244,7 @@ } void TrainerCommandParser::ParsePlayerCommand(const oxygen::Predicate & predicate) -{ +{ Predicate::Iterator unumParam(predicate); int unum; bool specified = true; @@ -257,7 +257,7 @@ } else specified = false; - + string team; TTeamIndex idx; Predicate::Iterator teamParam(predicate); @@ -269,7 +269,7 @@ specified = false; else idx = mTeamIndexMap[team]; - } + } else specified = false; @@ -278,17 +278,17 @@ mSoccerRule->ClearSelectedPlayers(); return; } - + SoccerBase::TAgentStateList agentStates; - SoccerBase::GetAgentStates(*this, agentStates, (specified ? idx : TI_NONE)); + SoccerBase::GetAgentStates(*this, agentStates, (specified ? idx : TI_NONE)); SoccerBase::TAgentStateList::iterator iter = agentStates.begin(); bool found = false; while (iter != agentStates.end() && !found) - { + { if ((specified && (*iter)->GetUniformNumber() == unum && (*iter)->GetTeamIndex() == idx) || (!specified && (*iter)->IsSelected())) - found = true; + found = true; else ++iter; } @@ -296,7 +296,7 @@ if (!found) { GetLog()->Error() << "(TrainerCommandParser) ERROR: can't get correct AgentState\n"; - return; + return; } Predicate::Iterator posParam(predicate); @@ -332,7 +332,7 @@ float ang; // extract position vector - if (! predicate.GetValue(moveParam, pos)) + if (! predicate.AdvanceValue(moveParam, pos)) { GetLog()->Error() << "(TrainerCommandParser) ERROR: can't get agent rot\n"; return; @@ -358,7 +358,7 @@ } } - // Joschka: I removed the part to set a velocity because it doesn't really + // Joschka: I removed the part to set a velocity because it doesn't really // seem to have a meaning for agents that have more than just a single body Predicate::Iterator batParam(predicate); @@ -372,11 +372,11 @@ { GetLog()->Error() << "(TrainerCommandParser) ERROR: can't get battery value\n"; return; - } + } // set new battery (*iter)->SetBattery(battery); - + } Predicate::Iterator tempParam(predicate); @@ -391,17 +391,17 @@ GetLog()->Error() << "(TrainerCommandParser) ERROR: can't get temperatur value\n"; return; } - + // set new temperature (*iter)->SetBattery(temperature); - + } } void TrainerCommandParser::ParseBallCommand(const oxygen::Predicate& predicate) { - Predicate::Iterator posParam(predicate); + Predicate::Iterator posParam(predicate); if (predicate.FindParameter(posParam, "pos")) { @@ -412,7 +412,7 @@ { GetLog()->Error() << "(TrainerCommandParser) ERROR: can't get ball pos\n"; return; - } + } boost::shared_ptr<RigidBody> body; @@ -515,7 +515,7 @@ { GetLog()->Error() << "(TrainerCommandParser) ERROR: unknown team" << team << "\n"; - + } } else @@ -527,11 +527,11 @@ } void TrainerCommandParser::ParseSelectCommand(const oxygen::Predicate & predicate) -{ +{ Predicate::Iterator unumParam(predicate); int unum; bool specified = true; - + boost::shared_ptr<SoccerRuleAspect> soccerRuleAspect; if (!SoccerBase::GetSoccerRuleAspect(*this, soccerRuleAspect)) { @@ -547,13 +547,13 @@ } else specified = false; - + if (specified && unum == -1) { soccerRuleAspect->ResetAgentSelection(); return; } - + string team; TTeamIndex idx; Predicate::Iterator teamParam(predicate); @@ -565,26 +565,26 @@ specified = false; else idx = mTeamIndexMap[team]; - } + } else specified = false; - + if (!specified) { soccerRuleAspect->SelectNextAgent(); return; } - + SoccerBase::TAgentStateList agentStates; - SoccerBase::GetAgentStates(*this, agentStates, idx); + SoccerBase::GetAgentStates(*this, agentStates, idx); SoccerBase::TAgentStateList::iterator iter = agentStates.begin(); bool found = false; while (iter != agentStates.end() && !found) - { - if ((*iter)->GetUniformNumber() == unum) + { + if ((*iter)->GetUniformNumber() == unum) { - found = true; + found = true; } else ++iter; @@ -593,7 +593,7 @@ if (!found) { GetLog()->Error() << "(TrainerCommandParser) ERROR: can't get correct AgentState\n"; - return; + return; } soccerRuleAspect->ResetAgentSelection(); @@ -601,11 +601,11 @@ } void TrainerCommandParser::ParseKillCommand(const oxygen::Predicate & predicate) -{ +{ Predicate::Iterator unumParam(predicate); int unum; bool specified = true; - + boost::shared_ptr<SoccerRuleAspect> soccerRuleAspect; if (!SoccerBase::GetSoccerRuleAspect(*this, soccerRuleAspect)) { @@ -621,7 +621,7 @@ } else specified = false; - + string team; TTeamIndex idx; Predicate::Iterator teamParam(predicate); @@ -633,10 +633,10 @@ specified = false; else idx = mTeamIndexMap[team]; - } + } else specified = false; - + GameControlServer::TAgentAspectList agentAspects; mGameControl->GetAgentAspectList(agentAspects); GameControlServer::TAgentAspectList::iterator aaiter; @@ -660,13 +660,13 @@ } void TrainerCommandParser::ParseReposCommand(const oxygen::Predicate & predicate) -{ +{ cerr << "repos 2" << endl; Predicate::Iterator unumParam(predicate); int unum; bool specified = true; - + boost::shared_ptr<SoccerRuleAspect> soccerRuleAspect; if (!SoccerBase::GetSoccerRuleAspect(*this, soccerRuleAspect)) { @@ -682,7 +682,7 @@ } else specified = false; - + string team; TTeamIndex idx; Predicate::Iterator teamParam(predicate); @@ -694,12 +694,12 @@ specified = false; else idx = mTeamIndexMap[team]; - } + } else specified = false; SoccerBase::TAgentStateList agentStates; - SoccerBase::GetAgentStates(*this, agentStates, TI_NONE); + SoccerBase::GetAgentStates(*this, agentStates, TI_NONE); SoccerBase::TAgentStateList::iterator iter = agentStates.begin(); boost::shared_ptr<oxygen::Transform> agent_aspect; for (;iter != agentStates.end(); ++iter) @@ -715,14 +715,14 @@ 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); + Vector3f new_pos = mSoccerRule->RepositionOutsidePos(ballPos, (*iter)->GetUniformNumber(), (*iter)->GetTeamIndex()); + SoccerBase::MoveAgent(agent_aspect, new_pos); break; } } } - + void TrainerCommandParser::ParseKillSimCommand(const oxygen::Predicate & predicate) { mSimServer->Quit(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <he...@us...> - 2012-05-16 12:20:44
|
Revision: 307 http://simspark.svn.sourceforge.net/simspark/?rev=307&view=rev Author: hedayat Date: 2012-05-16 12:20:35 +0000 (Wed, 16 May 2012) Log Message: ----------- Increased WaitBeforeKickoff time to 30 seconds Fix the position of penalty lines in visual percepts Modified Paths: -------------- trunk/rcssserver3d/ChangeLog trunk/rcssserver3d/data/rsg/agent/nao/soccer.rsg trunk/rcssserver3d/rcssserver3d/naosoccersim.rb Modified: trunk/rcssserver3d/ChangeLog =================================================================== --- trunk/rcssserver3d/ChangeLog 2012-04-16 09:46:12 UTC (rev 306) +++ trunk/rcssserver3d/ChangeLog 2012-05-16 12:20:35 UTC (rev 307) @@ -1,3 +1,12 @@ +2012-05-16 Hedayat Vatankhah <hed...@gm...> + + * data/rsg/agent/nao/soccer.rsg: + - use correct penalty width which is equal to PenaltyWidth + GoalWidth + + * rcssserver3d/naosoccersim.rb: + - changed default value of 'WaitBeforeKickOff' to 30, since 5 seconds + is too small for any team to start. + 2012-04-15 Hedayat Vatankhah <hed...@gm...> * plugin/soccer/trainercommandparser/trainercommandparser.cpp Modified: trunk/rcssserver3d/data/rsg/agent/nao/soccer.rsg =================================================================== --- trunk/rcssserver3d/data/rsg/agent/nao/soccer.rsg 2012-04-16 09:46:12 UTC (rev 306) +++ trunk/rcssserver3d/data/rsg/agent/nao/soccer.rsg 2012-05-16 12:20:35 UTC (rev 307) @@ -11,7 +11,7 @@ (def $FieldHeight (eval Soccer.FieldHeight)) (def $GoalDepth (eval Soccer.GoalDepth)) (def $PenaltyLength (eval Soccer.PenaltyLength)) - (def $PenaltyWidth (eval Soccer.PenaltyWidth)) + (def $PenaltyWidth (eval Soccer.PenaltyWidth + Soccer.GoalWidth)) ;; height of the field ground plane (def $FieldMaterial matGrass) Modified: trunk/rcssserver3d/rcssserver3d/naosoccersim.rb =================================================================== --- trunk/rcssserver3d/rcssserver3d/naosoccersim.rb 2012-04-16 09:46:12 UTC (rev 306) +++ trunk/rcssserver3d/rcssserver3d/naosoccersim.rb 2012-05-16 12:20:35 UTC (rev 307) @@ -52,7 +52,7 @@ # soccer game settings addSoccerVar('AutomaticKickOff', false) -addSoccerVar('WaitBeforeKickOff', 5.0) +addSoccerVar('WaitBeforeKickOff', 30.0) addSoccerVar('CoinTossForKickOff', false) addSoccerVar('AutomaticQuit', true) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <he...@us...> - 2012-05-16 17:04:17
|
Revision: 309 http://simspark.svn.sourceforge.net/simspark/?rev=309&view=rev Author: hedayat Date: 2012-05-16 17:04:06 +0000 (Wed, 16 May 2012) Log Message: ----------- Add first draft of release notes for 0.6.6 Fixed a small bug in trainercommandparser Disable AutomaticQuit by default Modified Paths: -------------- trunk/rcssserver3d/ChangeLog trunk/rcssserver3d/RELEASE trunk/rcssserver3d/plugin/soccer/trainercommandparser/trainercommandparser.cpp trunk/rcssserver3d/rcssserver3d/naosoccersim.rb Modified: trunk/rcssserver3d/ChangeLog =================================================================== --- trunk/rcssserver3d/ChangeLog 2012-05-16 17:01:57 UTC (rev 308) +++ trunk/rcssserver3d/ChangeLog 2012-05-16 17:04:06 UTC (rev 309) @@ -1,11 +1,20 @@ 2012-05-16 Hedayat Vatankhah <hed...@gm...> + * RELEASE: + - initial version for 0.6.6 release + + * plugin/soccer/trainercommandparser/trainercommandparser.cpp + (TrainerCommandParser::OnLink): + - fixed a typo where mGameControl was checked instead of mSimServer to see + if it is valid + * data/rsg/agent/nao/soccer.rsg: - use correct penalty width which is equal to PenaltyWidth + GoalWidth * rcssserver3d/naosoccersim.rb: - changed default value of 'WaitBeforeKickOff' to 30, since 5 seconds is too small for any team to start. + - disabled AutomaticQuit mode by default for consistency with older versions 2012-04-15 Hedayat Vatankhah <hed...@gm...> Modified: trunk/rcssserver3d/RELEASE =================================================================== --- trunk/rcssserver3d/RELEASE 2012-05-16 17:01:57 UTC (rev 308) +++ trunk/rcssserver3d/RELEASE 2012-05-16 17:04:06 UTC (rev 309) @@ -1,37 +1,47 @@ -RELEASE News of rcssserver3d-0.6.5 +RELEASE News of rcssserver3d-0.6.6 -This release comes with a number of enhancements and some bug fixes. Most -notably, the automated referee is improved to prevent many agents to collide -with each other which is required for running games with more players. Also, to -better suite the field for running 9 vs 9 games, the field size is increased -and it is 21x14 now. There are some visual improvements and minor enhancements -to improve the general experience with the simulator. Finally, simspark.rb is -renamed to rcssserver3d.rb for more consistency. +It's time for a new release! This release comes with a number of bug fixes and +several minor enhancements here and there. Now, you can run the server for +two complete halves. Teams now change their sides in the second half. Also, +automatic kick off and automatic quit modes are added. More detailed information +about this release follows: -* New touch rules: -The automated referee now enforces two new rules to better prevent crowding and -a high number of collisions in 9 vs 9 games: -- If an agent is in touch with more than 2 agents (including himself), and he - wasn't in such a situation in the previous time step - which means he is the - last to join the group - he is relocated outside of the field. However, if - the number of opponents in the group are more than teammates, an unspecified - opponent will be relocated instead. -- If it is not clear which agent joined the group last, e.g. when 3 players - were all separate at time t, but were all touching each other in time t + 1, - an agent is chosen at random for relocation. +* Several Bug fixes. Some notable ones are: + - Penalty lines are now visible at their actual position (Thanks to Marcus for + his bug report) + - Fixed a small bug in parsing move paramter (Thanks to Andreas Seekircher) + - Fixed a mistake which prevented from touch group rules to be applied at all + - Fixed a small bug in goal counting which cause this function to always + count a goal when ball moved out of the field +* Enhance Automatic Kickoff Support: + - Changed default value of 'WaitBeforeKickOff' to 30, since 5 seconds + is too small for any team to start. + - WaitBeforeKickOff is now calculated from when the first agent connects + rather than from the beginning of the before kickoff playmode (when the + simulator is started) + - A game can be started with kick off for the left team, or using 'coin toss' + to determine which team should start the game. CoinTossForKickOff variable + in naosoccersim.rb can be used to change the behavior. It is disabled + by default. + +* Enhance Support for 'Second Half': + - Automatic Kick Off mode assigns Kick off to the correct team in the second + half + - Change teams' sides in the second half if enabled (enabled by default). It + can be disabled using ChangeSidesInSecondHalf variable in naosoccersim.rb. + +* Automatic Quit: + - In Automatic Quit mode rcsssever3d shuts down automatically when the game + is over. It is disabled by default but can be enabled using 'AutomaticQuit' + variable in naosoccersim.rb + * Other Enhancements: -- Visual improvements in rcssmonitor3d: new field texture, colored team names - and scores -- Set different agent and monitor ports with --agent-port and --server-port -- Bigger field size: 21x14 -- Updated PDF documentation -- Bug fixes, specially in the automated referee -- New Trainer command (killsim) to terminate the simulator -- Compilation fixes -- Nao robots now sense visual information about field lines by default -- Now you should change the value of enableRealTimeMode variable in - rcssserver3d.rb if you want to turn off using real time mode +- The location of init scripts (e.g. zeitgeist.rb) can now be specified using + --init-script-prefix (you still can put most of the scripts and data files + like rsg/ directory inside your ~/.simspark/ instead). +- Better Windows support +- Support creating Windows binaries under Linux using MinGW You can get the package on the Simspark page on SourceForge at http://sourceforge.net/projects/simspark/ Modified: trunk/rcssserver3d/plugin/soccer/trainercommandparser/trainercommandparser.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/trainercommandparser/trainercommandparser.cpp 2012-05-16 17:01:57 UTC (rev 308) +++ trunk/rcssserver3d/plugin/soccer/trainercommandparser/trainercommandparser.cpp 2012-05-16 17:04:06 UTC (rev 309) @@ -125,7 +125,7 @@ mSimServer = shared_dynamic_cast<SimulationServer> (GetCore()->Get("/sys/server/simulation")); - if (mGameControl.get() == 0) + if (mSimServer.get() == 0) { GetLog()->Error() << "ERROR: (TrainerCommandParser) Unable to get SimulationServer\n"; } Modified: trunk/rcssserver3d/rcssserver3d/naosoccersim.rb =================================================================== --- trunk/rcssserver3d/rcssserver3d/naosoccersim.rb 2012-05-16 17:01:57 UTC (rev 308) +++ trunk/rcssserver3d/rcssserver3d/naosoccersim.rb 2012-05-16 17:04:06 UTC (rev 309) @@ -55,7 +55,7 @@ addSoccerVar('WaitBeforeKickOff', 30.0) addSoccerVar('CoinTossForKickOff', false) -addSoccerVar('AutomaticQuit', true) +addSoccerVar('AutomaticQuit', false) addSoccerVar('ChangeSidesInSecondHalf', true) # agent parameters This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <he...@us...> - 2012-05-17 09:04:01
|
Revision: 310 http://simspark.svn.sourceforge.net/simspark/?rev=310&view=rev Author: hedayat Date: 2012-05-17 09:03:50 +0000 (Thu, 17 May 2012) Log Message: ----------- Fix middle circle radius to be equal to FreeKickDist. Enlarge soccer field to 20x30 Updated release notes Modified Paths: -------------- trunk/rcssserver3d/ChangeLog trunk/rcssserver3d/RELEASE trunk/rcssserver3d/data/rsg/agent/nao/soccer.rsg trunk/rcssserver3d/rcssserver3d/naosoccersim.rb Modified: trunk/rcssserver3d/ChangeLog =================================================================== --- trunk/rcssserver3d/ChangeLog 2012-05-16 17:04:06 UTC (rev 309) +++ trunk/rcssserver3d/ChangeLog 2012-05-17 09:03:50 UTC (rev 310) @@ -1,3 +1,11 @@ +2012-05-17 Hedayat Vatankhah <hed...@gm...> + + * rcssserver3d/naosoccersim.rb: + - use new field dimensions: 20x30 + + * data/rsg/agent/nao/soccer.rsg: + - The radius of center circle (field ring) should be equal to + FreeKickDistance (they are equal in FIFA rules too) 2012-05-16 Hedayat Vatankhah <hed...@gm...> * RELEASE: Modified: trunk/rcssserver3d/RELEASE =================================================================== --- trunk/rcssserver3d/RELEASE 2012-05-16 17:04:06 UTC (rev 309) +++ trunk/rcssserver3d/RELEASE 2012-05-17 09:03:50 UTC (rev 310) @@ -7,8 +7,8 @@ about this release follows: * Several Bug fixes. Some notable ones are: - - Penalty lines are now visible at their actual position (Thanks to Marcus for - his bug report) + - Penalty lines and middle circle are now visible at their actual position + (Thanks to Marcus for his bug report, and Sander). - Fixed a small bug in parsing move paramter (Thanks to Andreas Seekircher) - Fixed a mistake which prevented from touch group rules to be applied at all - Fixed a small bug in goal counting which cause this function to always Modified: trunk/rcssserver3d/data/rsg/agent/nao/soccer.rsg =================================================================== --- trunk/rcssserver3d/data/rsg/agent/nao/soccer.rsg 2012-05-16 17:04:06 UTC (rev 309) +++ trunk/rcssserver3d/data/rsg/agent/nao/soccer.rsg 2012-05-17 09:03:50 UTC (rev 310) @@ -12,6 +12,7 @@ (def $GoalDepth (eval Soccer.GoalDepth)) (def $PenaltyLength (eval Soccer.PenaltyLength)) (def $PenaltyWidth (eval Soccer.PenaltyWidth + Soccer.GoalWidth)) + (def $FreeKickDistance (eval Soccer.FreeKickDistance)) ;; height of the field ground plane (def $FieldMaterial matGrass) @@ -261,7 +262,7 @@ ;; ring (importScene rsg/agent/fieldring.rsg - 1.8) + $FreeKickDistance) ;; ;; add the ball Modified: trunk/rcssserver3d/rcssserver3d/naosoccersim.rb =================================================================== --- trunk/rcssserver3d/rcssserver3d/naosoccersim.rb 2012-05-16 17:04:06 UTC (rev 309) +++ trunk/rcssserver3d/rcssserver3d/naosoccersim.rb 2012-05-17 09:03:50 UTC (rev 310) @@ -37,8 +37,8 @@ end # the soccer field dimensions in meters -addSoccerVar('FieldLength', 21.0) -addSoccerVar('FieldWidth', 14.0) +addSoccerVar('FieldLength', 30.0) +addSoccerVar('FieldWidth', 20.0) addSoccerVar('FieldHeight', 40.0) addSoccerVar('GoalWidth', 2.1) addSoccerVar('GoalDepth', 0.6) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <he...@us...> - 2012-05-20 21:42:32
|
Revision: 314 http://simspark.svn.sourceforge.net/simspark/?rev=314&view=rev Author: hedayat Date: 2012-05-20 21:42:25 +0000 (Sun, 20 May 2012) Log Message: ----------- Reduce the height of Nao's foot Modified Paths: -------------- trunk/rcssserver3d/ChangeLog trunk/rcssserver3d/NEWS trunk/rcssserver3d/RELEASE trunk/rcssserver3d/data/rsg/agent/nao/naoleg.rsg Modified: trunk/rcssserver3d/ChangeLog =================================================================== --- trunk/rcssserver3d/ChangeLog 2012-05-19 18:40:58 UTC (rev 313) +++ trunk/rcssserver3d/ChangeLog 2012-05-20 21:42:25 UTC (rev 314) @@ -1,3 +1,13 @@ +2012-05-21 Hedayat Vatankhah <hed...@gm...> + + * NEWS: + * RELEASE: + - updated for 0.6.6 release + + * data/rsg/agent/nao/naoleg.rsg: + - reduce Nao's foot height (patch by Sander) and modify the position of + ankle accordingly + 2012-05-19 Hedayat Vatankhah <hed...@gm...> * plugin/soccer/soccerruleaspect/soccerruleaspect.cpp Modified: trunk/rcssserver3d/NEWS =================================================================== --- trunk/rcssserver3d/NEWS 2012-05-19 18:40:58 UTC (rev 313) +++ trunk/rcssserver3d/NEWS 2012-05-20 21:42:25 UTC (rev 314) @@ -6,11 +6,13 @@ also increased to 20x30 meters, and free kick distance is 2.0 meters now. More detailed information about this release follows: -* Field Changes: +* Field/Dimension Changes: - New dimensions: 20x30 - Free kick distance: 2.0 - Corner kick position: in the middle point between goal and corner of the field, to facilitate faster corner kicks. + - Nao's foot height is now 0.02 rather than 0.03. Ankle's position changed + accordingly * Several Bug fixes. Some notable ones are: - Penalty lines and middle circle are now visible at their actual position Modified: trunk/rcssserver3d/RELEASE =================================================================== --- trunk/rcssserver3d/RELEASE 2012-05-19 18:40:58 UTC (rev 313) +++ trunk/rcssserver3d/RELEASE 2012-05-20 21:42:25 UTC (rev 314) @@ -7,11 +7,13 @@ also increased to 20x30 meters, and free kick distance is 2.0 meters now. More detailed information about this release follows: -* Field Changes: +* Field/Dimension Changes: - New dimensions: 20x30 - Free kick distance: 2.0 - Corner kick position: in the middle point between goal and corner of the field, to facilitate faster corner kicks. + - Nao's foot height is now 0.02 rather than 0.03. Ankle's position changed + accordingly * Several Bug fixes. Some notable ones are: - Penalty lines and middle circle are now visible at their actual position Modified: trunk/rcssserver3d/data/rsg/agent/nao/naoleg.rsg =================================================================== --- trunk/rcssserver3d/data/rsg/agent/nao/naoleg.rsg 2012-05-19 18:40:58 UTC (rev 313) +++ trunk/rcssserver3d/data/rsg/agent/nao/naoleg.rsg 2012-05-20 21:42:25 UTC (rev 314) @@ -68,7 +68,7 @@ (def $FootRelAnkle_X 0) (def $FootRelAnkle_Y 0.03) - (def $FootRelAnkle_Z -0.035) + (def $FootRelAnkle_Z -0.04) (def $Hip1_X (eval $Torso_X + $Hip1RelTorso_X)) (def $Hip1_Y (eval $Torso_Y + $Hip1RelTorso_Y)) @@ -118,7 +118,7 @@ (def $FootSizeX 0.08) (def $FootSizeY 0.16) - (def $FootSizeZ 0.03) + (def $FootSizeZ 0.02) (def $FootMass 0.2) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <he...@us...> - 2012-05-22 18:22:45
|
Revision: 315 http://simspark.svn.sourceforge.net/simspark/?rev=315&view=rev Author: hedayat Date: 2012-05-22 18:22:38 +0000 (Tue, 22 May 2012) Log Message: ----------- Add a "paused" game state (when teams are not playing, e.g. Goal left/right play modes) Apply automatic referee rules always while the game is 'running', and reset all counters when 'paused'. Modified Paths: -------------- trunk/rcssserver3d/ChangeLog trunk/rcssserver3d/plugin/soccer/gamestateaspect/gamestateaspect.cpp trunk/rcssserver3d/plugin/soccer/gamestateaspect/gamestateaspect.h trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.h Modified: trunk/rcssserver3d/ChangeLog =================================================================== --- trunk/rcssserver3d/ChangeLog 2012-05-20 21:42:25 UTC (rev 314) +++ trunk/rcssserver3d/ChangeLog 2012-05-22 18:22:38 UTC (rev 315) @@ -1,3 +1,19 @@ +2012-05-22 Hedayat Vatankhah <hed...@gm...> + + * plugin/soccer/gamestateaspect/gamestateaspect.cpp: + * plugin/soccer/gamestateaspect/gamestateaspect.h: + - added knowledge about a 'paused' state, in which game is not really + running (waiting for the referee to allow the game to continue, e.g. in + goal left/right state or at the beginning of a kick in state) + + * plugin/soccer/soccerruleaspect/soccerruleaspect.h: + - a little cleanup, and fixed comment for mAutoKickOffTimeOrigin + + * plugin/soccer/soccerruleaspect/soccerruleaspect.cpp: + - update game's paused state + - consider the referee rules always while the game is running (not paused), + and reset all counters otherwise. + 2012-05-21 Hedayat Vatankhah <hed...@gm...> * NEWS: Modified: trunk/rcssserver3d/plugin/soccer/gamestateaspect/gamestateaspect.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/gamestateaspect/gamestateaspect.cpp 2012-05-20 21:42:25 UTC (rev 314) +++ trunk/rcssserver3d/plugin/soccer/gamestateaspect/gamestateaspect.cpp 2012-05-22 18:22:38 UTC (rev 315) @@ -45,6 +45,7 @@ mLeftInit = Vector3f(0,0,0); mRightInit = Vector3f(0,0,0); mFinished = false; + mGamePaused = true; } GameStateAspect::~GameStateAspect() @@ -479,3 +480,13 @@ mScore[0] = scoreLeft; mScore[1] = scoreRight; } + +bool GameStateAspect::IsPaused() const +{ + return mGamePaused; +} + +void GameStateAspect::SetPaused(bool paused) +{ + mGamePaused = paused; +} Modified: trunk/rcssserver3d/plugin/soccer/gamestateaspect/gamestateaspect.h =================================================================== --- trunk/rcssserver3d/plugin/soccer/gamestateaspect/gamestateaspect.h 2012-05-20 21:42:25 UTC (rev 314) +++ trunk/rcssserver3d/plugin/soccer/gamestateaspect/gamestateaspect.h 2012-05-22 18:22:38 UTC (rev 315) @@ -112,6 +112,12 @@ /** sets the current game scores. useful if you start a game in the middle */ void SetScores(int scoreLeft, int scoreRight); + /** returns if the game is paused */ + bool IsPaused() const; + + /** sets the game running state (paused or not) */ + void SetPaused(bool paused); + protected: /** setup the init positions for the agents */ virtual void OnLink(); @@ -175,8 +181,12 @@ /** the radius of an agent */ float mAgentRadius; + /** flag if the simulation should be stopped */ bool mFinished; + + /** flag if the game is running or paused (e.g. in goal_left/right state) */ + bool mGamePaused; }; DECLARE_CLASS(GameStateAspect); Modified: trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2012-05-20 21:42:25 UTC (rev 314) +++ trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2012-05-22 18:22:38 UTC (rev 315) @@ -91,8 +91,9 @@ void SoccerRuleAspect::AutomaticSimpleReferee(TPlayMode playMode) { - // Reset counters before kickoff - if (playMode == PM_BeforeKickOff) + // Reset counters and do not consider players' faults when game is not + // running + if (mGameState->IsPaused()) { ResetFaultCounter(TI_LEFT); ResetFaultCounter(TI_RIGHT); @@ -106,13 +107,8 @@ AnalyseTouchGroups(TI_LEFT); AnalyseTouchGroups(TI_RIGHT); - // Only apply rules during play-on, leaves some time for agents to - // solve it themselves - if (playMode == PM_PlayOn) - { - ClearPlayersAutomatic(TI_LEFT); // enforce standing and not overcrowding rules for left team - ClearPlayersAutomatic(TI_RIGHT); // enforce standing and not overcrowding rules for 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 // Reset touch groups ResetTouchGroups(TI_LEFT); @@ -704,6 +700,7 @@ Vector3f pos(0,0,mBallRadius); MoveBall(pos); + mGameState->SetPaused(true); ClearPlayers(mRightHalf, mFreeKickMoveDist, TI_LEFT); ClearPlayers(mLeftHalf, mFreeKickMoveDist, TI_RIGHT); @@ -729,6 +726,8 @@ void SoccerRuleAspect::UpdateKickOff(TTeamIndex idx) { + mGameState->SetPaused(false); + ClearPlayersBeforeKickOff(idx); // if no player touched the ball for mDropBallTime, we move away @@ -761,8 +760,11 @@ // do nothing for the duration of mKickInPauseTime if (mGameState->GetModeTime() < mKickInPauseTime) { + mGameState->SetPaused(true); return; } + mGameState->SetPaused(false); + // move away opponent team ClearPlayers(mFreeKickPos, mFreeKickDist, mFreeKickMoveDist, SoccerBase::OpponentTeam(idx)); @@ -810,8 +812,10 @@ // do nothing for the duration of mKickInPauseTime if (mGameState->GetModeTime() < mKickInPauseTime) { + mGameState->SetPaused(true); return; } + mGameState->SetPaused(false); //--------------- salt::Vector2f ball_pos(mFreeKickPos.x(), mFreeKickPos.y()); @@ -880,8 +884,11 @@ // do nothing for the duration of mKickInPauseTime if (mGameState->GetModeTime() < mKickInPauseTime) { + mGameState->SetPaused(true); return; } + mGameState->SetPaused(false); + // move away opponent team ClearPlayers(idx == TI_LEFT ? mLeftPenaltyArea : mRightPenaltyArea, mFreeKickMoveDist, SoccerBase::OpponentTeam(idx)); @@ -936,8 +943,11 @@ // do nothing for the duration of mKickInPauseTime if (mGameState->GetModeTime() < mKickInPauseTime) { + mGameState->SetPaused(true); return; } + mGameState->SetPaused(false); + // move away opponent team ClearPlayers(mFreeKickPos, mFreeKickDist, mFreeKickMoveDist, SoccerBase::OpponentTeam(idx)); @@ -1129,6 +1139,8 @@ void SoccerRuleAspect::UpdatePlayOn() { + mGameState->SetPaused(false); + // check if the ball is in one of the goals if (CheckGoal()) { @@ -1155,6 +1167,8 @@ void SoccerRuleAspect::UpdateGoal() { + mGameState->SetPaused(true); + // check if the pause time after the goal has elapsed if (mGameState->GetModeTime() < mGoalPauseTime) { @@ -1182,6 +1196,8 @@ void SoccerRuleAspect::UpdateGameOver() { + mGameState->SetPaused(true); + // wait for 10 seconds to finish if (mGameState->GetModeTime() < 9 || !mAutomaticQuit) { Modified: trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.h =================================================================== --- trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.h 2012-05-20 21:42:25 UTC (rev 314) +++ trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.h 2012-05-22 18:22:38 UTC (rev 315) @@ -265,6 +265,7 @@ /** 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 */ @@ -274,8 +275,10 @@ /** the time we wait before dropping the ball in play modes where only 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) */ float mFieldLength; /** the field width (in meters) */ @@ -286,8 +289,10 @@ float mGoalHeight; /** the absolute x coordinate of the goal which ball should pass (in meters) */ float mGoalBallLineX; + /** the point on the field where we do the kick in, free kick etc. */ salt::Vector3f mFreeKickPos; + /** the distance opponents have to keep during free kicks, kick ins etc. */ float mFreeKickDist; /** the (least) distance opponents will be moved away if they are to close @@ -295,6 +300,7 @@ float mFreeKickMoveDist; /** the distance from the back line the ball should be placed at for a goal kick */ float mGoalKickDist; + /** flag if the simulator should do the kick off automatically after the agent */ bool mAutomaticKickOff; /** time to wait until we kick off automatically */ @@ -305,7 +311,7 @@ bool mAutomaticQuit; /** flag if the side of the teams should be changed in the second half*/ bool mChangeSidesInSecondHalf; - /** time to wait until we kick off automatically */ + /** the time origin from which mWaitBeforeKickOff is calculated */ float mAutoKickOffTimeOrigin; //FCP 2010 - New Parameters (added by FCPortugal for Singapure 2010) @@ -329,6 +335,7 @@ int mMaxTouchGroupSize; /** 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 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <he...@us...> - 2012-05-22 22:33:21
|
Revision: 316 http://simspark.svn.sourceforge.net/simspark/?rev=316&view=rev Author: hedayat Date: 2012-05-22 22:33:15 +0000 (Tue, 22 May 2012) Log Message: ----------- Don't allow direct goals from kickoff Don't allow dribbling on kickoff Update 0.6.6 release notes Modified Paths: -------------- trunk/rcssserver3d/ChangeLog trunk/rcssserver3d/NEWS trunk/rcssserver3d/RELEASE trunk/rcssserver3d/plugin/soccer/gamestateaspect/gamestateaspect.cpp trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.h Modified: trunk/rcssserver3d/ChangeLog =================================================================== --- trunk/rcssserver3d/ChangeLog 2012-05-22 18:22:38 UTC (rev 315) +++ trunk/rcssserver3d/ChangeLog 2012-05-22 22:33:15 UTC (rev 316) @@ -1,3 +1,13 @@ +2012-05-23 Hedayat Vatankhah <hed...@gm...> + + * NEWS: + * RELEASE: + - updated for 0.6.6 + + * plugin/soccer/soccerruleaspect/soccerruleaspect.cpp: + - do not allow direct goals from kickoff + - do not let the kickoff taker to kick the ball again befor other players + 2012-05-22 Hedayat Vatankhah <hed...@gm...> * plugin/soccer/gamestateaspect/gamestateaspect.cpp: @@ -8,6 +18,7 @@ * plugin/soccer/soccerruleaspect/soccerruleaspect.h: - a little cleanup, and fixed comment for mAutoKickOffTimeOrigin + - removed an unused variable mLastValidBallPosition * plugin/soccer/soccerruleaspect/soccerruleaspect.cpp: - update game's paused state Modified: trunk/rcssserver3d/NEWS =================================================================== --- trunk/rcssserver3d/NEWS 2012-05-22 18:22:38 UTC (rev 315) +++ trunk/rcssserver3d/NEWS 2012-05-22 22:33:15 UTC (rev 316) @@ -6,6 +6,14 @@ also increased to 20x30 meters, and free kick distance is 2.0 meters now. More detailed information about this release follows: +* Rule Changes: + - automatic referee now enforces rules whenever players are permitted to + play, rather than only in playon play mode. + - it is no longer possible to score directly from kick off, the ball should + at least touch another player before going into the goal + - in kickoff playmode, the kicker cannot touch the ball again until another + player touches it. + * Field/Dimension Changes: - New dimensions: 20x30 - Free kick distance: 2.0 Modified: trunk/rcssserver3d/RELEASE =================================================================== --- trunk/rcssserver3d/RELEASE 2012-05-22 18:22:38 UTC (rev 315) +++ trunk/rcssserver3d/RELEASE 2012-05-22 22:33:15 UTC (rev 316) @@ -7,6 +7,14 @@ also increased to 20x30 meters, and free kick distance is 2.0 meters now. More detailed information about this release follows: +* Rule Changes: + - automatic referee now enforces rules whenever players are permitted to + play, rather than only in playon play mode. + - it is no longer possible to score directly from kick off, the ball should + at least touch another player before going into the goal + - in kickoff playmode, the kicker cannot touch the ball again until another + player touches it. + * Field/Dimension Changes: - New dimensions: 20x30 - Free kick distance: 2.0 Modified: trunk/rcssserver3d/plugin/soccer/gamestateaspect/gamestateaspect.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/gamestateaspect/gamestateaspect.cpp 2012-05-22 18:22:38 UTC (rev 315) +++ trunk/rcssserver3d/plugin/soccer/gamestateaspect/gamestateaspect.cpp 2012-05-22 22:33:15 UTC (rev 316) @@ -119,7 +119,7 @@ if (changeSides) mNextHalfKickOff = ti; else - mNextHalfKickOff = (ti == TI_LEFT) ? TI_RIGHT : TI_LEFT; + mNextHalfKickOff = SoccerBase::OpponentTeam(ti); } } Modified: trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2012-05-22 18:22:38 UTC (rev 315) +++ trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2012-05-22 22:33:15 UTC (rev 316) @@ -68,7 +68,9 @@ mMin2PlDistance(0), // min dist for second closest of team before being repositioned mMin3PlDistance(0), // min dist for third closest of team before being repositioned mMaxTouchGroupSize(1000), - mMaxFaultTime(0.0) // maximum time allowed for a player to commit a positional fault before being repositioned + mMaxFaultTime(0.0), // maximum time allowed for a player to commit a positional fault before being repositioned + mLastKickOffKickTime(0), + mCheckKickOffKickerFault(false) { mFreeKickPos = Vector3f(0.0,0.0,mBallRadius); } @@ -589,6 +591,40 @@ } void +SoccerRuleAspect::PunishKickOffFault( + boost::shared_ptr<oxygen::AgentAspect> agent) +{ + boost::shared_ptr<AgentState> agentState; + if (!SoccerBase::GetAgentState(agent, agentState)) + { + GetLog()->Error() << "ERROR: (SoccerRuleAspect) Cannot get " + "AgentState from an AgentAspect\n"; + } + else + { + TTeamIndex opp = SoccerBase::OpponentTeam(agentState->GetTeamIndex()); + ClearPlayersBeforeKickOff(opp); + + // put the ball back in the middle of the playing field + Vector3f pos(0, 0, mBallRadius); + MoveBall(pos); + + mGameState->KickOff(opp); + } +} + +inline bool SoccerRuleAspect::WasLastKickFromKickOff( + boost::shared_ptr<oxygen::AgentAspect> &lastKicker) +{ + TTime kickTime; + // notice that a kick is not necessarily an immediate action, it can + // take some time... + return mBallState->GetLastCollidingAgent(lastKicker, kickTime) + && kickTime - mLastKickOffKickTime < 0.1 // kick duration = 0.1 + && lastKicker == mLastKickOffTaker; +} + +void SoccerRuleAspect::ClearSelectedPlayers() { float min_dist = mFreeKickMoveDist; @@ -750,6 +786,9 @@ } if (time > mGameState->GetLastModeChange()) { + mLastKickOffKickTime = time; + mCheckKickOffKickerFault = true; + mLastKickOffTaker = agent; mGameState->SetPlayMode(PM_PlayOn); } } @@ -1099,6 +1138,8 @@ if (idx == TI_NONE) { + // sometimes, ball can't record goals due to approximation errors, + // so we check for goals analytically const salt::Vector3f ballPos = mBallBody->GetPosition(); const float xDist2Goal = fabs(ballPos.x()) - mGoalBallLineX; @@ -1129,6 +1170,19 @@ return false; } + /* don't allow goals directly from kickoff + * + * todo it is allowed in FIFA rules, so we should get rid of it e.g. by + * adding noise to the beam effector so that kickoff kicks cannot be + * precisely planned + */ + boost::shared_ptr<AgentAspect> agent; + if (WasLastKickFromKickOff(agent)) + { + PunishKickOffFault(agent); + return false; + } + // score the lucky team mGameState->ScoreTeam((idx == TI_LEFT) ? TI_RIGHT : TI_LEFT); mGameState->SetPlayMode((idx == TI_LEFT) ? PM_Goal_Right : PM_Goal_Left); @@ -1136,6 +1190,25 @@ return true; } +bool +SoccerRuleAspect::CheckKickOffTakerFault() +{ + if (!mCheckKickOffKickerFault) + return false; + + boost::shared_ptr<AgentAspect> agent; + if (!WasLastKickFromKickOff(agent)) // second kick + { + mCheckKickOffKickerFault = false; + if (agent == mLastKickOffTaker) + { + PunishKickOffFault(mLastKickOffTaker); + return true; + } + } + return false; +} + void SoccerRuleAspect::UpdatePlayOn() { @@ -1161,6 +1234,11 @@ } #endif + if (CheckKickOffTakerFault()) + { + return; + } + // other checks go here... } @@ -1176,7 +1254,7 @@ } // put the ball back in the middle of the playing field - Vector3f pos(0,0,mBallRadius); + Vector3f pos(0, 0, mBallRadius); MoveBall(pos); // kick off for the opposite team Modified: trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.h =================================================================== --- trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.h 2012-05-22 18:22:38 UTC (rev 315) +++ trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.h 2012-05-22 22:33:15 UTC (rev 316) @@ -211,6 +211,9 @@ /** checks if the assistant referee should raise the flag for offside */ bool CheckOffside(); + /** checks if kickoff taker has kicked the ball again before other players */ + bool CheckKickOffTakerFault(); + /** moves the ball to pos setting its linear and angular velocity to 0 */ void MoveBall(const salt::Vector3f& pos); @@ -253,6 +256,15 @@ */ void SwapTeamSides(); + /** + * Punish agent's fault committed during kickoff + */ + void PunishKickOffFault(boost::shared_ptr<oxygen::AgentAspect> agent); + + /** returns true if last kick was happenned in kick off */ + bool WasLastKickFromKickOff( + boost::shared_ptr<oxygen::AgentAspect> &lastKicker); + protected: /** reference to the body node of the Ball */ boost::shared_ptr<oxygen::RigidBody> mBallBody; @@ -276,9 +288,6 @@ 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) */ float mFieldLength; /** the field width (in meters) */ @@ -384,6 +393,13 @@ /** use offside law */ bool mUseOffside; + + /** the time of the kick in the last kick off mode */ + TTime mLastKickOffKickTime; + /** the player which kicked in the last kick off mode */ + boost::shared_ptr<oxygen::AgentAspect> mLastKickOffTaker; + /** if kickoff taker should be checked for single kick rule */ + bool mCheckKickOffKickerFault; }; DECLARE_CLASS(SoccerRuleAspect); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |