homework 2
#include "Representations/BehaviorControl/Skills.h"
#include "Representations/BehaviorControl/Libraries/LibCheck.h"
#include "Tools/BehaviorControl/Framework/Skill/CabslSkill.h"
#include "Representations/BehaviorControl/FieldBall.h"
#include "Representations/Modeling/BallModel.h"
#include "Representations/Modeling/TeamBallModel.h"
SKILL_IMPLEMENTATION(SearchBallAsRulesImpl,
{,
IMPLEMENTS(SearchBallAsRules),
REQUIRES(LibCheck),
REQUIRES(BallModel),
REQUIRES(FieldBall),
REQUIRES(TeamBallModel),
CALLS(WalkToTarget),
CALLS(PathToTarget),
CALLS(WalkAtRelativeSpeed),
CALLS(LookLeftAndRight),
CALLS(LookForward),
});
class SearchBallAsRulesImpl : public SearchBallAsRulesImplBase
{
option(SearchBallAsRules)
{
initial_state(chaseLastBall)
{
transition
{
if(state_time>5000.f)
goto lookAround;
}
action
{
theLookLeftAndRightSkill();
theWalkToTargetSkill(Pose2f(0.8f, 0.8f, 0.8f), Pose2f(0.8f,theTeamBallModel.position.x()-200,theTeamBallModel.position.y()) );
}
}
state(lookAround)
{
transition
{
if(state_time>5000.f)
goto walkToTeamBallModel;
}
action
{
theWalkAtRelativeSpeedSkill(Pose2f(0.8f, 0.f, 0.f));
}
}
}
};
MAKE_SKILL_IMPLEMENTATION(SearchBallAsRulesImpl);