cz.cuni.amis.pogamut.emohawk.agent.module.sensomotoric
Class EmohawkNavigation

Package class diagram package EmohawkNavigation
java.lang.Object
  extended by cz.cuni.amis.pogamut.emohawk.agent.module.sensomotoric.EmohawkNavigation

public class EmohawkNavigation
extends Object

Facade for navigation in UT2004. Method navigate() can be called both synchronously and asynchronously. Uses IUT2004PathExecutor, FloydWarshallMap, IUT2004RunStraight and IUT2004GetBackToNavGraph to handle all possible navigation cases.

Author:
knight, jimmy

Field Summary
protected static int ARRIVED_AT_LOCATION_XY_THRESHOLD
          Location threshold for checking whether we have arrived on target.
protected static int ARRIVED_AT_LOCATION_Z_THRESHOLD
          Location threshold for checking whether we have arrived on target.
static double AT_LOCATION
          We're managed to get to location
static double AT_PLAYER
          We're managed to get to player
protected  UT2004Bot bot
          UT2004Bot reference.
protected  IPathFuture currentFuturePath
          Current path stored in IPathFuture object.
protected  ILocated currentTarget
          Current location target.
protected  Player currentTargetPlayer
          Current target is player (if not null)
protected  IWorldEventListener<EndMessage> endMessageListener
           
protected  NavPoint fromNavPoint
          Navpoint we're running from (initial position when path executor has been triggered)
protected  FloydWarshallMap fwMap
          FloydWarshallMap that is used for path planning.
protected  ILocated lastTarget
          Last location target.
protected  Player lastTargetPlayer
          Last location target.
protected  LogCategory log
          Log used by this class.
protected  boolean navigating
          Whether navigation is running.
protected static int NEW_PATH_DISTANCE_THRESHOLD
          Location threshold for requesting of a new path or switching a path.
protected static double PLAYER_DISTANCE_TRASHOLD
          When PLAYER is further from currentTarget than this location, recompute the path
protected  boolean runningStraightToPlayer
          We're running straight to the player.
protected  Location runningStraightToPlayerFailedAt
          Where run-straight failed.
protected  NavPoint toNavPoint
          Navpoint we're running to, nearest navpoint to currentTarget
 
Constructor Summary
EmohawkNavigation(UT2004Bot bot, Steering steering, FloydWarshallMap fwMap)
          Here you may specify any custom UT2004Navigation parts.
 
Method Summary
 List<ILocated> getCurrentPathCopy()
           
 List<ILocated> getCurrentPathDirect()
           
 ILocated getCurrentTarget()
           
 NavPoint getCurrentTargetNavPoint()
           
 Player getCurrentTargetPlayer()
           
 ILocated getLastTarget()
           
 NavPoint getLastTargetNavPoint()
           
 NavPoint getLastTargetPlayer()
           
 NavPoint getNearestNavPoint(ILocated location)
           
 boolean isNavigating()
           
protected  void navigate()
           
 void navigate(ILocated target)
           
 void navigate(Player player)
           
protected  void processPathFuture(IPathFuture futurePath)
          Checks if last path element is in close distance from our desired target and if not, we will add our desired target as the last path element.
protected  void reset(boolean stopGetBackToNavGraph)
           
 void setFocus(ILocated located)
           
protected  void startNavigate()
           
 void stopNavigation()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NEW_PATH_DISTANCE_THRESHOLD

protected static final int NEW_PATH_DISTANCE_THRESHOLD
Location threshold for requesting of a new path or switching a path.

See Also:
Constant Field Values

ARRIVED_AT_LOCATION_XY_THRESHOLD

protected static final int ARRIVED_AT_LOCATION_XY_THRESHOLD
Location threshold for checking whether we have arrived on target. For XY - 2D plane distance

See Also:
Constant Field Values

ARRIVED_AT_LOCATION_Z_THRESHOLD

protected static final int ARRIVED_AT_LOCATION_Z_THRESHOLD
Location threshold for checking whether we have arrived on target. For Z distance.

See Also:
Constant Field Values

PLAYER_DISTANCE_TRASHOLD

protected static final double PLAYER_DISTANCE_TRASHOLD
When PLAYER is further from currentTarget than this location, recompute the path

See Also:
Constant Field Values

AT_PLAYER

public static final double AT_PLAYER
We're managed to get to player

See Also:
Constant Field Values

AT_LOCATION

public static final double AT_LOCATION
We're managed to get to location

See Also:
Constant Field Values

log

protected LogCategory log
Log used by this class.


fwMap

protected FloydWarshallMap fwMap
FloydWarshallMap that is used for path planning.


bot

protected UT2004Bot bot
UT2004Bot reference.


endMessageListener

protected IWorldEventListener<EndMessage> endMessageListener

lastTarget

protected ILocated lastTarget
Last location target.


lastTargetPlayer

protected Player lastTargetPlayer
Last location target.


currentTarget

protected ILocated currentTarget
Current location target.


currentTargetPlayer

protected Player currentTargetPlayer
Current target is player (if not null)


fromNavPoint

protected NavPoint fromNavPoint
Navpoint we're running from (initial position when path executor has been triggered)


toNavPoint

protected NavPoint toNavPoint
Navpoint we're running to, nearest navpoint to currentTarget


currentFuturePath

protected IPathFuture currentFuturePath
Current path stored in IPathFuture object.


navigating

protected boolean navigating
Whether navigation is running.


runningStraightToPlayer

protected boolean runningStraightToPlayer
We're running straight to the player.


runningStraightToPlayerFailedAt

protected Location runningStraightToPlayerFailedAt
Where run-straight failed.

Constructor Detail

EmohawkNavigation

public EmohawkNavigation(UT2004Bot bot,
                         Steering steering,
                         FloydWarshallMap fwMap)
Here you may specify any custom UT2004Navigation parts.

Parameters:
bot -
ut2004PathExecutor -
fwMap -
getBackOnPath -
runStraight -
Method Detail

isNavigating

public boolean isNavigating()

setFocus

public void setFocus(ILocated located)

stopNavigation

public void stopNavigation()

navigate

public void navigate(ILocated target)

navigate

public void navigate(Player player)

getNearestNavPoint

public NavPoint getNearestNavPoint(ILocated location)

getCurrentPathCopy

public List<ILocated> getCurrentPathCopy()

getCurrentPathDirect

public List<ILocated> getCurrentPathDirect()

getCurrentTarget

public ILocated getCurrentTarget()

getCurrentTargetPlayer

public Player getCurrentTargetPlayer()

getCurrentTargetNavPoint

public NavPoint getCurrentTargetNavPoint()

getLastTarget

public ILocated getLastTarget()

getLastTargetPlayer

public NavPoint getLastTargetPlayer()

getLastTargetNavPoint

public NavPoint getLastTargetNavPoint()

startNavigate

protected void startNavigate()

navigate

protected void navigate()

processPathFuture

protected void processPathFuture(IPathFuture futurePath)
Checks if last path element is in close distance from our desired target and if not, we will add our desired target as the last path element.

Parameters:
futurePath -

reset

protected void reset(boolean stopGetBackToNavGraph)


Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.