roboplayer.core.memory
Class VisualInfo

java.lang.Object
  |
  +--roboplayer.core.memory.VisualInfo
All Implemented Interfaces:
SeeListener

public class VisualInfo
extends java.lang.Object
implements SeeListener

This class represents visual memory. It not only read information from sensors, but it can be used to store information and estimate position for objects out of the view

Version:
1.0
Author:
Krzysztof Langner

Constructor Summary
VisualInfo(Body body, Params params, char side, java.lang.String team)
           
 
Method Summary
 ObjectInfo getBall()
           
 double getDirection()
           
 Polar getLandmark(java.lang.String name)
           
 Polar getMyGoalPos()
           
 ObjectInfo getNearestPlayer(Polar pos)
           
 ObjectInfo getNearestTeammate(Polar pos)
          This function looks for nearest player to specified position.
 Polar getOpponentGoalPos()
           
 ObjectInfo getOpponentPlayer(double dir)
           
 java.util.Enumeration getPlayers()
          Return all players
 Polar getPolar(Vector2d pos)
          This function returns polar coordinates of specified point
 Vector2d getPosition()
           
 double getTurnAngle()
           
 void onSee(java.lang.String info)
          see message will be send to this function
 Vector2d positionFromPolar(Polar p)
          This function calculates position from polar coordinates
 void updateSee()
          This function updates state from old state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VisualInfo

public VisualInfo(Body body,
                  Params params,
                  char side,
                  java.lang.String team)
Method Detail

onSee

public void onSee(java.lang.String info)
Description copied from interface: SeeListener
see message will be send to this function

Specified by:
onSee in interface SeeListener
Parameters:
info - see info

updateSee

public void updateSee()
This function updates state from old state. Currently only ball is estimated and we don't care about our speed.

Specified by:
updateSee in interface SeeListener

getDirection

public double getDirection()

getPosition

public Vector2d getPosition()

getBall

public ObjectInfo getBall()

getOpponentGoalPos

public Polar getOpponentGoalPos()

getMyGoalPos

public Polar getMyGoalPos()

getPlayers

public java.util.Enumeration getPlayers()
Return all players

Returns:
Enumeration interface

positionFromPolar

public Vector2d positionFromPolar(Polar p)
This function calculates position from polar coordinates


getNearestPlayer

public ObjectInfo getNearestPlayer(Polar pos)

getNearestTeammate

public ObjectInfo getNearestTeammate(Polar pos)
This function looks for nearest player to specified position.

Parameters:
pos - Distance is calculated from this position
Returns:
Player object or null if we are the nearest player

getOpponentPlayer

public ObjectInfo getOpponentPlayer(double dir)

getLandmark

public Polar getLandmark(java.lang.String name)

getTurnAngle

public double getTurnAngle()

getPolar

public Polar getPolar(Vector2d pos)
This function returns polar coordinates of specified point