public class RandomPathFinder extends java.lang.Object implements PathFinder
Modifier and Type | Field and Description |
---|---|
private float |
clearance |
private java.util.ArrayList<WaypointListener> |
listeners |
private RangeMap |
map |
private float |
maxDistance |
private int |
maxIterations |
private float |
maxRange |
private float |
minGain |
private RangeReadings |
readings |
private static long |
serialVersionUID |
Constructor and Description |
---|
RandomPathFinder(RangeMap map,
RangeReadings readings) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(WaypointListener wpl) |
Path |
findRoute(Pose start,
Waypoint destination) |
private Pose |
generatePose()
Generate a random pose within the mapped area, not too close to the edge
|
void |
setClearance(float clearance)
Set the clearance around the edge of the map.
|
void |
setMaxDistance(float distance)
Set the maximum distance between waypoints
|
void |
setMaxIterations(int iterations)
Set the maximum number of iterations before giving up when searching for a path
|
void |
setMaxRange(float range)
Set the maximum valid range readings
|
void |
startPathFinding(Pose start,
Waypoint end) |
private static final long serialVersionUID
private float minGain
private float clearance
private RangeMap map
private RangeReadings readings
private float maxRange
private float maxDistance
private int maxIterations
private java.util.ArrayList<WaypointListener> listeners
public RandomPathFinder(RangeMap map, RangeReadings readings)
public void setMaxRange(float range)
range
- the maximum rangepublic void setMaxDistance(float distance)
distance
- the maximum distancepublic void setMaxIterations(int iterations)
iterations
- the maximum number of iterationspublic void setClearance(float clearance)
clearance
- the clearancepublic Path findRoute(Pose start, Waypoint destination) throws DestinationUnreachableException
findRoute
in interface PathFinder
DestinationUnreachableException
private Pose generatePose()
public void addListener(WaypointListener wpl)
addListener
in interface PathFinder
public void startPathFinding(Pose start, Waypoint end)
startPathFinding
in interface PathFinder