From: <sgv...@us...> - 2009-06-15 15:08:27
|
Revision: 68 http://simspark.svn.sourceforge.net/simspark/?rev=68&view=rev Author: sgvandijk Date: 2009-06-15 15:08:14 +0000 (Mon, 15 Jun 2009) Log Message: ----------- - change goal and out-of-field checks to only accept when ball is completely over the line Modified Paths: -------------- trunk/rcssserver3d/ChangeLog trunk/rcssserver3d/data/rsg/agent/nao/goal.rsg trunk/rcssserver3d/plugin/soccer/ballstateaspect/ballstateaspect.cpp trunk/rcssserver3d/plugin/soccer/ballstateaspect/ballstateaspect.h Modified: trunk/rcssserver3d/ChangeLog =================================================================== --- trunk/rcssserver3d/ChangeLog 2009-06-15 13:33:46 UTC (rev 67) +++ trunk/rcssserver3d/ChangeLog 2009-06-15 15:08:14 UTC (rev 68) @@ -1,3 +1,11 @@ +2009-06-15 Sander van Dijk <sgv...@gm...> + + * plugin/soccer/ballstateaspect/ballstateaspect.h + * plugin/soccer/ballstateaspect/ballstateaspect.cpp + * data/rsg/agent/nao/goal.rsg + - change goal and out-of-field checks to only accept when ball is + completely over the line + 2009-04-30 Sander van Dijk <sgv...@gm...> * rcssmonitor3d/rcssmonitor3d.rb Modified: trunk/rcssserver3d/data/rsg/agent/nao/goal.rsg =================================================================== --- trunk/rcssserver3d/data/rsg/agent/nao/goal.rsg 2009-06-15 13:33:46 UTC (rev 67) +++ trunk/rcssserver3d/data/rsg/agent/nao/goal.rsg 2009-06-15 15:08:14 UTC (rev 68) @@ -9,11 +9,18 @@ (def $GoalWidth (eval Soccer.GoalWidth)) (def $GoalDepth (eval Soccer.GoalDepth)) (def $GoalHeight (eval Soccer.GoalHeight)) - + (def $BallRadius (eval Soccer.BallRadius)) + (def $GoalHalfWidth (eval $GoalWidth / 2.0)) (def $GoalHalfHeight (eval $GoalHeight / 2.0)) (def $GoalHalfDepth (eval $GoalDepth / 2.0)) + (def $BallDiameter (eval $BallRadius * 2.0)) + + (def $GoalColliderWidth (eval $GoalWidth - $BallDiameter)) + (def $GoalColliderDepth (eval $GoalDepth - $BallDiameter)) + (def $GoalColliderHeight (eval $GoalHeight)) + (def $BarDiameter 0.04) (def $BarRadius (eval $BarDiameter / 2.0)) @@ -29,7 +36,7 @@ (setLocalRotation 0 0 $theta) (nd BoxCollider (setName BoxCollider) - (setBoxLengths $GoalDepth $GoalWidth $GoalHeight) + (setBoxLengths $GoalColliderDepth $GoalColliderWidth $GoalColliderHeight) (nd RecorderHandler (setName recorder) ) Modified: trunk/rcssserver3d/plugin/soccer/ballstateaspect/ballstateaspect.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/ballstateaspect/ballstateaspect.cpp 2009-06-15 13:33:46 UTC (rev 67) +++ trunk/rcssserver3d/plugin/soccer/ballstateaspect/ballstateaspect.cpp 2009-06-15 15:08:14 UTC (rev 68) @@ -101,8 +101,8 @@ void BallStateAspect::UpdateBallOnField() { const Vector3f& posBall = mBall->GetWorldTransform().Pos(); - mBallOnField = ( gAbs(posBall.x()) < mHalfFieldLength ) - && ( gAbs(posBall.y()) < mHalfFieldWidth ); + mBallOnField = ( gAbs(posBall.x()) < mHalfFieldLength + mBallRadius + 0.001 ) + && ( gAbs(posBall.y()) < mHalfFieldWidth + mBallRadius + 0.001 ); } void BallStateAspect::UpdateLastValidBallPos() @@ -182,6 +182,8 @@ float fieldLength = 100.0f; SoccerBase::GetSoccerVar(*this,"FieldLength",fieldLength); mHalfFieldLength = fieldLength * 0.5f; + + SoccerBase::GetSoccerVar(*this,"BallRadius",mBallRadius); } void BallStateAspect::OnUnlink() Modified: trunk/rcssserver3d/plugin/soccer/ballstateaspect/ballstateaspect.h =================================================================== --- trunk/rcssserver3d/plugin/soccer/ballstateaspect/ballstateaspect.h 2009-06-15 13:33:46 UTC (rev 67) +++ trunk/rcssserver3d/plugin/soccer/ballstateaspect/ballstateaspect.h 2009-06-15 15:08:14 UTC (rev 68) @@ -141,6 +141,9 @@ /** indicates in which goal the ball is, TI_NONE otherwise */ TTeamIndex mGoalState; + /** the cached ball radius */ + float mBallRadius; + /** the cached field length */ float mHalfFieldLength; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |