cz.cuni.amis.pogamut.ut2004.agent.module.sensor
Class NavigationGraphHelper

Package class diagram package NavigationGraphHelper
java.lang.Object
  extended by cz.cuni.amis.pogamut.base.agent.module.AgentModule<AGENT>
      extended by cz.cuni.amis.pogamut.base.agent.module.SensorModule<UT2004Bot>
          extended by cz.cuni.amis.pogamut.ut2004.agent.module.sensor.NavigationGraphHelper
All Implemented Interfaces:
IComponent

public class NavigationGraphHelper
extends SensorModule<UT2004Bot>

This module helps you to obtain nearest NavPoint and NavPointNeighbourLink to your current location.

Author:
Jimmy

Nested Class Summary
protected  class NavigationGraphHelper.MapPointListObtainedListener
          MapPointListObtained listener.
 
Field Summary
protected  NavigationGraphHelper.MapPointListObtainedListener mapPointListObtainedListener
           
static DistanceUtils.IGetDistance<NavPointNeighbourLink> NAV_LINK_GET_DISTANCE
           
static DistanceUtils.IGetDistance<NavLinkPair> NAV_LINK_PAIR_GET_DISTANCE
           
protected  Set<NavLinkPair> navLinkPairs
          List of ALL existing NavLinkPair in the map.
protected  Map<UnrealId,Set<NavLinkPair>> navPointLinks
          Key: NavPoint.getId() Value: set of link (pairs) that either originate or ends in the corresponding navpoint, i.e.
 
Fields inherited from class cz.cuni.amis.pogamut.base.agent.module.SensorModule
worldView
 
Fields inherited from class cz.cuni.amis.pogamut.base.agent.module.AgentModule
agent, controller, eventBus, log
 
Constructor Summary
NavigationGraphHelper(UT2004Bot bot)
           
 
Method Summary
 NavLinkPair getNearestNavLinkPair()
          Returns nearest NavLinkPair to current bot position.
 NavLinkPair getNearestNavLinkPair(ILocated target)
          Returns nearest NavLinkPair to some 'target'.
 NavPoint getNearestNavPoint()
          Returns nearest NavPoint to current bot position.
 NavPoint getNearestNavPoint(double maxDistance)
          Returns nearest NavPoint to current bot position no further than 'maxDistance' from the bot.
 NavPoint getNearestNavPoint(ILocated target)
          Returns nearest NavPoint to some 'target'.
 NavPoint getNearestNavPoint(ILocated target, double maxDistance)
          Returns nearest NavPoint to some 'target' no further than 'maxDistance' from the bot.
protected  void init(Collection<NavPoint> navPoints)
          Initialization method called from NavigationGraphHelper.MapPointListObtainedListener.
static Boolean isPointProjectionAfterLinkSegment(NavPointNeighbourLink link, ILocated point)
          Tells whether "point" projection to "link" is inside the "link segment".
static Boolean isPointProjectionBeforeLinkSegment(NavPointNeighbourLink link, ILocated point)
          Tells whether "point" projection to "link" is inside the "link segment".
static Boolean isPointProjectionOnLinkSegment(NavPointNeighbourLink link, ILocated point)
          Tells whether "point" projection to "link" is inside the "link segment".
static Location projectPointToLinkLine(NavPointNeighbourLink link, ILocated point)
          Projects 'point' to line formed by the 'link'.
 
Methods inherited from class cz.cuni.amis.pogamut.base.agent.module.AgentModule
cleanUp, getComponentId, getLog, getState, initComponentId, isRunning, kill, pause, reset, resume, start, stop, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NAV_LINK_GET_DISTANCE

public static final DistanceUtils.IGetDistance<NavPointNeighbourLink> NAV_LINK_GET_DISTANCE

NAV_LINK_PAIR_GET_DISTANCE

public static final DistanceUtils.IGetDistance<NavLinkPair> NAV_LINK_PAIR_GET_DISTANCE

navPointLinks

protected Map<UnrealId,Set<NavLinkPair>> navPointLinks
Key: NavPoint.getId() Value: set of link (pairs) that either originate or ends in the corresponding navpoint, i.e. NavLinkPair.isLinkNavPoint(UnrealId) is true for the key.


navLinkPairs

protected Set<NavLinkPair> navLinkPairs
List of ALL existing NavLinkPair in the map.


mapPointListObtainedListener

protected NavigationGraphHelper.MapPointListObtainedListener mapPointListObtainedListener
Constructor Detail

NavigationGraphHelper

public NavigationGraphHelper(UT2004Bot bot)
Method Detail

getNearestNavPoint

public NavPoint getNearestNavPoint()
Returns nearest NavPoint to current bot position.


getNearestNavPoint

public NavPoint getNearestNavPoint(double maxDistance)
Returns nearest NavPoint to current bot position no further than 'maxDistance' from the bot.


getNearestNavLinkPair

public NavLinkPair getNearestNavLinkPair()
Returns nearest NavLinkPair to current bot position.

Returns:

getNearestNavPoint

public NavPoint getNearestNavPoint(ILocated target)
Returns nearest NavPoint to some 'target'.

Parameters:
target -
Returns:

getNearestNavPoint

public NavPoint getNearestNavPoint(ILocated target,
                                   double maxDistance)
Returns nearest NavPoint to some 'target' no further than 'maxDistance' from the bot.

Parameters:
target -
maxDistance -
Returns:

getNearestNavLinkPair

public NavLinkPair getNearestNavLinkPair(ILocated target)
Returns nearest NavLinkPair to some 'target'.

Parameters:
target -
Returns:

projectPointToLinkLine

public static Location projectPointToLinkLine(NavPointNeighbourLink link,
                                              ILocated point)
Projects 'point' to line formed by the 'link'.

Parameters:
link -
point -

isPointProjectionOnLinkSegment

public static Boolean isPointProjectionOnLinkSegment(NavPointNeighbourLink link,
                                                     ILocated point)
Tells whether "point" projection to "link" is inside the "link segment".

Parameters:
link -
point -
Returns:

isPointProjectionBeforeLinkSegment

public static Boolean isPointProjectionBeforeLinkSegment(NavPointNeighbourLink link,
                                                         ILocated point)
Tells whether "point" projection to "link" is inside the "link segment".

Parameters:
link -
point -
Returns:

isPointProjectionAfterLinkSegment

public static Boolean isPointProjectionAfterLinkSegment(NavPointNeighbourLink link,
                                                        ILocated point)
Tells whether "point" projection to "link" is inside the "link segment".

Parameters:
link -
point -
Returns:

init

protected void init(Collection<NavPoint> navPoints)
Initialization method called from NavigationGraphHelper.MapPointListObtainedListener.



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