Interface SensorPack


public interface SensorPack

Interface SensorPack is given to you so that you can call this to learn about the current status of the soccer field.


Method Summary
 int ballHeldByPlayer()
          Which player is holding the ball?
 int ballHeldByTeam()
          Which team is holding the ball?
 void drawLine(double x1, double y1, double x2, double y2)
          A utility/debugging method: draw a line from (x1,y1) to (x2,y2).
 double getAngle(double x1, double y1, double x2, double y2)
          A utility method: what is the angle of the line segment going from from (x1,y1) to (x2,y2)?
 double getBallTheta()
          Get the ball's orientation.
 double getBallX()
          Get the ball's x location.
 double getBallY()
          Get the ball's y location.
 double getCurrentTime()
          Get the current time.
 double getTheta(int team, int player)
          Get the orientation of any player, in whichever team.
 double getX(int team, int player)
          Get the x-coordinate of any player's location, in whichever team.
 double getY(int team, int player)
          Get the y-coordinate of any player's location, in whichever team.
 boolean isBallHeld()
          Has the ball been grabbed and is being held by someone?
 

Method Detail

getX

double getX(int team,
            int player)
Get the x-coordinate of any player's location, in whichever team.


getY

double getY(int team,
            int player)
Get the y-coordinate of any player's location, in whichever team.


getTheta

double getTheta(int team,
                int player)
Get the orientation of any player, in whichever team.


getBallX

double getBallX()
Get the ball's x location.


getBallY

double getBallY()
Get the ball's y location.


getBallTheta

double getBallTheta()
Get the ball's orientation.


getCurrentTime

double getCurrentTime()
Get the current time.


isBallHeld

boolean isBallHeld()
Has the ball been grabbed and is being held by someone?


ballHeldByTeam

int ballHeldByTeam()
Which team is holding the ball?


ballHeldByPlayer

int ballHeldByPlayer()
Which player is holding the ball?


getAngle

double getAngle(double x1,
                double y1,
                double x2,
                double y2)
A utility method: what is the angle of the line segment going from from (x1,y1) to (x2,y2)?


drawLine

void drawLine(double x1,
              double y1,
              double x2,
              double y2)
A utility/debugging method: draw a line from (x1,y1) to (x2,y2).