uk.ac.ed.inf.sdp2012.group7.strategy
Class ControlInterface

java.lang.Object
  extended by 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
           
 
Method Summary
static Arc chooseArc(Plan plan)
          Generates an arc which the robot needs to travel on to get to the goal point
 void drive()
           
static Point2D findGoalPoint(java.util.ArrayList<Node> p, Point2D pos, int lookahead)
          Returns the goal point which is 1 lookahead distance away from the robot
static Arc generateArc(Point2D p, java.util.ArrayList<Node> path, double v, int lookahead, double nodeInPixels)
           
static ControlInterface getInstance()
           
static ControlInterface getInstance(int lookahead)
           
 void implimentArc(Arc path, Plan plan)
           
 void kick()
           
 void stop()
           
 void update(java.util.Observable arg0, java.lang.Object arg1)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

public static final org.apache.log4j.Logger logger
Method Detail

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 path
robotPosition - 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