v_ourgoal_r.java

来自「利用JAVA编写的群体机器人局部通讯完成一定得队形控制」· Java 代码 · 共 56 行

JAVA
56
字号
/* * v_OurGoal_r.java */package EDU.gatech.cc.is.clay;import java.lang.*;import EDU.gatech.cc.is.abstractrobot.GoalSensor;import EDU.gatech.cc.is.util.Vec2;/** * Report the egocentric position of the defended goal for a soccer robot. * <P> * For detailed information on how to configure behaviors, see the * <A HREF="../clay/docs/index.html">Clay page</A>. * <P> * <A HREF="../COPYRIGHT.html">Copyright</A> * (c)1997, 1998 Tucker Balch * * @author Tucker Balch * @version $Revision: 1.1 $ */public class v_OurGoal_r extends NodeVec2	{	/** 	Turn debug printing on or off.	*/	public static final boolean DEBUG = Node.DEBUG;	private GoalSensor abstract_robot;	/**	Instantiate a v_OurGoal_r schema.	@param ar GoalSensor, the abstract_robot object that provides hardware support.	*/	public v_OurGoal_r(GoalSensor ar)		{		if (DEBUG) System.out.println("v_OurGoal_r: instantiated");		abstract_robot = ar;		}	/**	Return a Vec2 pointing from the	center of the robot to the ball.	@param timestamp long, only get new information if timestamp > than last call                or timestamp == -1.	@return the sensed ball	*/	public Vec2 Value(long timestamp)		{		if (DEBUG) System.out.println("v_OurGoal_r: Value()");		return(abstract_robot.getOurGoal(timestamp));		}        }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?