uk.ac.ed.inf.sdp2012.group7.strategy
Class ControlInterface
java.lang.Object
uk.ac.ed.inf.sdp2012.group7.strategy.ControlInterface
- All Implemented Interfaces:
- java.util.Observer
public class ControlInterface
- extends java.lang.Object
- implements java.util.Observer
This takes a plan from Control Management and turns it
into actual commands.
- Author:
- David Fraser -s0912336
Field Summary |
static org.apache.log4j.Logger |
logger
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
public static final org.apache.log4j.Logger logger
getInstance
public static ControlInterface getInstance(int lookahead)
getInstance
public static ControlInterface getInstance()
chooseArc
public static Arc chooseArc(Plan plan)
- Generates an arc which the robot needs to travel on to get to the goal point
- Parameters:
plan
-
- Returns:
generateArc
public static Arc generateArc(Point2D p,
java.util.ArrayList<Node> path,
double v,
int lookahead,
double nodeInPixels)
implimentArc
public void implimentArc(Arc path,
Plan plan)
findGoalPoint
public static Point2D findGoalPoint(java.util.ArrayList<Node> p,
Point2D pos,
int lookahead)
throws java.lang.Exception
- Returns the goal point which is 1 lookahead distance away from the robot
- Parameters:
points
- The list of points on the pathrobotPosition
- The current robot position
- Returns:
- The goal point
- Throws:
java.lang.Exception
kick
public void kick()
drive
public void drive()
stop
public void stop()
update
public void update(java.util.Observable arg0,
java.lang.Object arg1)
- Specified by:
update
in interface java.util.Observer