# File high_skills/walkBehindBallRelative.rb, line 14 def initialize @agentInfo = Java::sk.fiit.jim.agent.AgentInfo.getInstance @radius = 1 end
# File high_skills/walkBehindBallRelative.rb, line 19 def pickHighSkill case when @agentInfo.ballUnseen > 3 #puts 'finding ball' return Localize.new(Proc.new{(not see_ball? || me.on_ground?)}) end #puts 'walking to' return pickWalk end
# File high_skills/walkBehindBallRelative.rb, line 29 def pickWalk #relative positions @ballRelPos = @agentInfo.ballControlPosition @goalRelPos = @agentInfo.kickTarget @leftPoint = @ballRelPos.add(Vector3D.cartesian(0,@radius,0)) @frontPoint = @ballRelPos.add(Vector3D.cartesian(-@radius,0,0)) if(@agentInfo.whereIsTarget(@ballRelPos) == "back") puts "baaaaaaaaaaaaaaaaaaaaaaack" @targetToGo = @leftPoint else @targetToGo = @frontPoint end return WalkOld.new(@targetToGo) end