SteeringStuff
Class SteeringManager

Package class diagram package SteeringManager
java.lang.Object
  extended by SteeringStuff.SteeringManager
Direct Known Subclasses:
SocialSteeringManager

public class SteeringManager
extends Object

This class manages the whole navigation layer of the steered bot. The manager calls steerings to compute the force, combines all forces and sends the computed next velocity to the locomotion layer (modul locomotion).

Author:
Marki

Field Summary
static cz.cuni.amis.pogamut.base3d.worldview.object.Location BASIC_LOCATION
           
protected  UT2004Bot botself
          This manager needs botself, raycasting and AdvancedLocomotion.
static boolean DEBUG
          Enables/disables all debugging println.
protected  boolean drawRaycasting
          Whether the rays should be drawned (this value will be the parameter of setDrawTraceLines()).
protected  AdvancedLocomotion locomotion
           
static double MAX_FORCE
           
protected  double multiplier
           
protected  javax.vecmath.Vector3d myNextVelocity
           
protected  RaycastingManager rayManager
           
 HashMap<SteeringType,Double> steeringWeights
           
static boolean Thomas
           
protected static double WALK_VELOCITY_LENGTH
          How long is the vector of walking velocity.
 
Constructor Summary
SteeringManager(UT2004Bot bot, Raycasting raycasting, AdvancedLocomotion locomotion)
          Creates the new SteeringManager.
SteeringManager(UT2004Bot bot, Raycasting raycasting, AdvancedLocomotion locomotion, double multiplier)
           
 
Method Summary
 void addLeaderFollowingSteering(LeaderFollowingProperties properties)
           
 void addObstacleAvoidanceSteering(ObstacleAvoidanceProperties properties)
           
 void addPathFollowingSteering(PathFollowingProperties properties)
           
 void addPeopleAvoidanceSteering(PeopleAvoidanceProperties properties)
           
 void addSteering(SteeringType type)
          Adds the steering of the steering type from the argument.
 void addSteering(SteeringType type, double weight)
          Adds the steering of the steering type from the argument with the weight from the argument.
 void addStickToPathSteering(StickToPathProperties properties)
           
 void addTargetApproachingSteering(TargetApproachingProperties properties)
           
 void addWalkAlongSteering(WalkAlongProperties properties)
           
 void addWallFollowingSteering(WallFollowingProperties properties)
           
 void clearSteerings()
          Removes all currently active steerings.
 LeaderFollowingProperties getLeaderFollowingProperties()
          Returns path following properites if this steering is set or null otherwise.
 javax.vecmath.Vector3d getMyActualVelocity()
          Returns the scaled actual velocity.
 javax.vecmath.Vector3d getMyNextVelocity()
          Returns the computed next velocity.
 ObstacleAvoidanceProperties getObstacleAvoidanceProperties()
          Returns path following properites if this steering is set or null otherwise.
 PathFollowingProperties getPathFollowingProperties()
          Returns path following properites if this steering is set or null otherwise.
 PeopleAvoidanceProperties getPeopleAvoidanceProperties()
          Returns people avoidance properites if this steering is set or null otherwise.
static cz.cuni.amis.pogamut.base3d.worldview.object.Location getRandomStartLocation()
          Returns the random location near to the BASIC_LOCATION.
static cz.cuni.amis.pogamut.base3d.worldview.object.Rotation getRandomStartRotation()
          Returns the random rotation.
 HashMap<SteeringType,javax.vecmath.Vector3d> getSteeringForces()
          Returns the hasp map of used steering forces.
 TargetApproachingProperties getTargetApproachingProperties()
          Returns target approaching properites if this steering is set or null otherwise.
 WalkAlongProperties getWalkAlongProperties()
          Returns walk along properites if this steering is set or null otherwise.
 WallFollowingProperties getWallFollowingProperties()
          Returns wall following properites if this steering is set or null otherwise.
 boolean hasSteering(SteeringType type)
          Returns true, if the manager has this steering type in the list of used steerings.
 boolean isCanEnlargeVelocity()
          Returns whether the velocity can be enlarged when every active steering agrees.
 boolean isDrawRaycasting()
          Returns whether the rays are drawn in the UE2.
 boolean isLeaderFollowingActive()
           
 boolean isNavigating()
          Returns whether we are currently using SteeringManager for navigation.
 boolean isObstacleAvoidanceActive()
           
 boolean isPathFollowingActive()
           
 boolean isPeopleAvoidanceActive()
           
 boolean isStickToPathSteeringActive()
           
 boolean isTargetApproachingActive()
           
 boolean isWalkAlongActive()
           
 boolean isWallFollowingActive()
           
 void moveTheBot(javax.vecmath.Vector3d nextVelocity, boolean everyoneWantsToGoFaster, cz.cuni.amis.pogamut.base3d.worldview.object.Location focusLocation)
          This method is used mainly in SteeringManager.run().
 void removeLeaderFollowingSteering()
           
 void removeObstacleAvoidanceSteering()
           
 void removePathFollowingSteering()
           
 void removePeopleAvoidanceSteering()
           
 void removeSteering(SteeringType type)
          Removes the steering of the steering type from the argument.
 void removeStickToPathSteering()
           
 void removeTargetApproachingSteering()
           
 void removeWalkAlongSteering()
           
 void removeWallFollowingSteering()
           
 void run()
          The main method.
 void setCanEnlargeVelocity(boolean canEnlargeVelocity)
          If true, the velocity can be enlarged when every active steering agrees.
 void setDrawRaycasting(boolean drawRaycasting)
          Sets whether the rays in UE2 should be drawned.
protected  cz.cuni.amis.pogamut.base3d.worldview.object.Location setFocusSpecific(SteeringType steeringType, boolean wantsToStop, cz.cuni.amis.pogamut.base3d.worldview.object.Location newFocus, cz.cuni.amis.pogamut.base3d.worldview.object.Location focusLoc)
           
 void setLastVeloWeight(double lastVeloWeight)
           
 void setLeaderFollowingSteering(LeaderFollowingProperties properties)
           
 void setMultiplier(double multiplier)
          Sets the multiplier of the velocity.
 void setObstacleAvoidanceSteering(ObstacleAvoidanceProperties properties)
           
 void setPathFollowingSteering(PathFollowingProperties properties)
           
 void setPeopleAvoidanceSteering(PeopleAvoidanceProperties properties)
           
 void setSteeringProperties(SteeringType type, SteeringProperties newProperties)
          Sets the steering properties of the steering type from the argument.
 void setStickToPathSteering(StickToPathProperties properties)
           
 void setTargetApproachingSteering(TargetApproachingProperties properties)
           
 void setUseLastVeloWeight(boolean useLastVeloWeight)
           
protected  javax.vecmath.Vector3d setVelocitySpecific(ISteering steering, RefBoolean wantsToGoFaster, RefBoolean wantsToStop, RefLocation newFocus)
          When owerriden can provide different behaviour of steering computation i.e.
 void setWalkAlongSteering(WalkAlongProperties properties)
           
 void setWallFollowingSteering(WallFollowingProperties properties)
           
 void start()
          Registers endMessageListener and by this activates steering navigation.
 void stop()
          Unregisters endMessageListener - steering manager will cease to navigate the bot (the bot will stop, but steering settings will be preserved).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

public static final boolean DEBUG
Enables/disables all debugging println.

See Also:
Constant Field Values

botself

protected UT2004Bot botself
This manager needs botself, raycasting and AdvancedLocomotion.


locomotion

protected AdvancedLocomotion locomotion

rayManager

protected RaycastingManager rayManager

steeringWeights

public HashMap<SteeringType,Double> steeringWeights

myNextVelocity

protected javax.vecmath.Vector3d myNextVelocity

multiplier

protected double multiplier

MAX_FORCE

public static final double MAX_FORCE
See Also:
Constant Field Values

WALK_VELOCITY_LENGTH

protected static final double WALK_VELOCITY_LENGTH
How long is the vector of walking velocity. Used for rescaling normal vector, when hitting an obstacle with a ray.

See Also:
Constant Field Values

BASIC_LOCATION

public static final cz.cuni.amis.pogamut.base3d.worldview.object.Location BASIC_LOCATION

drawRaycasting

protected boolean drawRaycasting
Whether the rays should be drawned (this value will be the parameter of setDrawTraceLines()).


Thomas

public static boolean Thomas
Constructor Detail

SteeringManager

public SteeringManager(UT2004Bot bot,
                       Raycasting raycasting,
                       AdvancedLocomotion locomotion)
Creates the new SteeringManager. This class manages the whole navigation layer of the steered bot. The manager calls steerings to compute the force, combines all forces and sends the computed next velocity to the locomotion layer (modul locomotion).

Parameters:
bot - The bot, who should be steered be these steerings.
raycasting - The instance of the class Raycasting.
locomotion - The AdvancedLocomotion of the bot.

SteeringManager

public SteeringManager(UT2004Bot bot,
                       Raycasting raycasting,
                       AdvancedLocomotion locomotion,
                       double multiplier)
Parameters:
bot - The bot, who should be steered be these steerings. This class manages the whole navigation layer of the steered bot. The manager calls steerings to compute the force, combines all forces and sends the computed next velocity to the locomotion layer (modul locomotion).
raycasting - The instance of the class Raycasting.
locomotion - The AdvancedLocomotion of the bot.
multiplier - Default value is 1. The multiplier of the velocity. E.g, if you want to make this bot run nearly all the time, set the multiplier 2. But remember, that steerings could work worse.
Method Detail

addSteering

public void addSteering(SteeringType type)
Adds the steering of the steering type from the argument. The weight of this steering wil be 1.


addSteering

public void addSteering(SteeringType type,
                        double weight)
Adds the steering of the steering type from the argument with the weight from the argument.


hasSteering

public boolean hasSteering(SteeringType type)
Returns true, if the manager has this steering type in the list of used steerings.


removeSteering

public void removeSteering(SteeringType type)
Removes the steering of the steering type from the argument.


setSteeringProperties

public void setSteeringProperties(SteeringType type,
                                  SteeringProperties newProperties)
Sets the steering properties of the steering type from the argument.


run

public void run()
The main method. This method must be called in each tick (logic), if we want the navigation layer to compute the next velocity and send it to the locomotion layer. Note: Should not be called anymore. Use start() and stop() methods.


moveTheBot

public void moveTheBot(javax.vecmath.Vector3d nextVelocity,
                       boolean everyoneWantsToGoFaster,
                       cz.cuni.amis.pogamut.base3d.worldview.object.Location focusLocation)
This method is used mainly in SteeringManager.run(). But if we want to stop the bot - and after a while make him again to walk, we can remember his velocity befor stopping and use this methode.


getRandomStartLocation

public static cz.cuni.amis.pogamut.base3d.worldview.object.Location getRandomStartLocation()
Returns the random location near to the BASIC_LOCATION.


getRandomStartRotation

public static cz.cuni.amis.pogamut.base3d.worldview.object.Rotation getRandomStartRotation()
Returns the random rotation.


getSteeringForces

public HashMap<SteeringType,javax.vecmath.Vector3d> getSteeringForces()
Returns the hasp map of used steering forces.


getMyActualVelocity

public javax.vecmath.Vector3d getMyActualVelocity()
Returns the scaled actual velocity.


getMyNextVelocity

public javax.vecmath.Vector3d getMyNextVelocity()
Returns the computed next velocity.


isDrawRaycasting

public boolean isDrawRaycasting()
Returns whether the rays are drawn in the UE2.


setDrawRaycasting

public void setDrawRaycasting(boolean drawRaycasting)
Sets whether the rays in UE2 should be drawned.


setCanEnlargeVelocity

public void setCanEnlargeVelocity(boolean canEnlargeVelocity)
If true, the velocity can be enlarged when every active steering agrees.


isCanEnlargeVelocity

public boolean isCanEnlargeVelocity()
Returns whether the velocity can be enlarged when every active steering agrees.


setMultiplier

public void setMultiplier(double multiplier)
Sets the multiplier of the velocity. The computed velocity vektor will be multiplied by this value. E.g, if you want to make this bot run nearly all the time, set the multiplier 2 (or 3). But remember, that steerings could work worse.


setLastVeloWeight

public void setLastVeloWeight(double lastVeloWeight)

setUseLastVeloWeight

public void setUseLastVeloWeight(boolean useLastVeloWeight)

start

public void start()
Registers endMessageListener and by this activates steering navigation.


stop

public void stop()
Unregisters endMessageListener - steering manager will cease to navigate the bot (the bot will stop, but steering settings will be preserved).


isNavigating

public boolean isNavigating()
Returns whether we are currently using SteeringManager for navigation.

Returns:

clearSteerings

public void clearSteerings()
Removes all currently active steerings.


getLeaderFollowingProperties

public LeaderFollowingProperties getLeaderFollowingProperties()
Returns path following properites if this steering is set or null otherwise.

Returns:

getObstacleAvoidanceProperties

public ObstacleAvoidanceProperties getObstacleAvoidanceProperties()
Returns path following properites if this steering is set or null otherwise.

Returns:

getPathFollowingProperties

public PathFollowingProperties getPathFollowingProperties()
Returns path following properites if this steering is set or null otherwise.

Returns:

getPeopleAvoidanceProperties

public PeopleAvoidanceProperties getPeopleAvoidanceProperties()
Returns people avoidance properites if this steering is set or null otherwise.

Returns:

getTargetApproachingProperties

public TargetApproachingProperties getTargetApproachingProperties()
Returns target approaching properites if this steering is set or null otherwise.

Returns:

getWalkAlongProperties

public WalkAlongProperties getWalkAlongProperties()
Returns walk along properites if this steering is set or null otherwise.

Returns:

getWallFollowingProperties

public WallFollowingProperties getWallFollowingProperties()
Returns wall following properites if this steering is set or null otherwise.

Returns:

addLeaderFollowingSteering

public void addLeaderFollowingSteering(LeaderFollowingProperties properties)

removeLeaderFollowingSteering

public void removeLeaderFollowingSteering()

setLeaderFollowingSteering

public void setLeaderFollowingSteering(LeaderFollowingProperties properties)

isLeaderFollowingActive

public boolean isLeaderFollowingActive()

addObstacleAvoidanceSteering

public void addObstacleAvoidanceSteering(ObstacleAvoidanceProperties properties)

removeObstacleAvoidanceSteering

public void removeObstacleAvoidanceSteering()

setObstacleAvoidanceSteering

public void setObstacleAvoidanceSteering(ObstacleAvoidanceProperties properties)

isObstacleAvoidanceActive

public boolean isObstacleAvoidanceActive()

addPathFollowingSteering

public void addPathFollowingSteering(PathFollowingProperties properties)

removePathFollowingSteering

public void removePathFollowingSteering()

setPathFollowingSteering

public void setPathFollowingSteering(PathFollowingProperties properties)

isPathFollowingActive

public boolean isPathFollowingActive()

addPeopleAvoidanceSteering

public void addPeopleAvoidanceSteering(PeopleAvoidanceProperties properties)

removePeopleAvoidanceSteering

public void removePeopleAvoidanceSteering()

setPeopleAvoidanceSteering

public void setPeopleAvoidanceSteering(PeopleAvoidanceProperties properties)

isPeopleAvoidanceActive

public boolean isPeopleAvoidanceActive()

addTargetApproachingSteering

public void addTargetApproachingSteering(TargetApproachingProperties properties)

removeTargetApproachingSteering

public void removeTargetApproachingSteering()

setTargetApproachingSteering

public void setTargetApproachingSteering(TargetApproachingProperties properties)

isTargetApproachingActive

public boolean isTargetApproachingActive()

addWalkAlongSteering

public void addWalkAlongSteering(WalkAlongProperties properties)

removeWalkAlongSteering

public void removeWalkAlongSteering()

setWalkAlongSteering

public void setWalkAlongSteering(WalkAlongProperties properties)

isWalkAlongActive

public boolean isWalkAlongActive()

addWallFollowingSteering

public void addWallFollowingSteering(WallFollowingProperties properties)

removeWallFollowingSteering

public void removeWallFollowingSteering()

setWallFollowingSteering

public void setWallFollowingSteering(WallFollowingProperties properties)

isWallFollowingActive

public boolean isWallFollowingActive()

addStickToPathSteering

public void addStickToPathSteering(StickToPathProperties properties)

removeStickToPathSteering

public void removeStickToPathSteering()

setStickToPathSteering

public void setStickToPathSteering(StickToPathProperties properties)

isStickToPathSteeringActive

public boolean isStickToPathSteeringActive()

setFocusSpecific

protected cz.cuni.amis.pogamut.base3d.worldview.object.Location setFocusSpecific(SteeringType steeringType,
                                                                                 boolean wantsToStop,
                                                                                 cz.cuni.amis.pogamut.base3d.worldview.object.Location newFocus,
                                                                                 cz.cuni.amis.pogamut.base3d.worldview.object.Location focusLoc)

setVelocitySpecific

protected javax.vecmath.Vector3d setVelocitySpecific(ISteering steering,
                                                     RefBoolean wantsToGoFaster,
                                                     RefBoolean wantsToStop,
                                                     RefLocation newFocus)
When owerriden can provide different behaviour of steering computation i.e. can tunnel some other information like true distance to target place it is used for the social steerings...



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