public abstract class WorldObject extends Object
Modifier and Type | Field and Description |
---|---|
protected double[] |
potentialVector
Container 2 x 1 array for a potential field vector for driving the vehicle away from this object and towards a goal point
|
Constructor and Description |
---|
WorldObject(double[] position,
double standoff)
Constructor
|
WorldObject(double x,
double y,
double standoff)
Constructor
|
WorldObject(Point position,
double standoff)
Constructor
|
Modifier and Type | Method and Description |
---|---|
double |
getDistance(double[] point) |
double |
getDistance(double[] end1,
double[] end2) |
double |
getDistance(double x,
double y) |
double |
getDistance(double x1,
double y1,
double x2,
double y2) |
double |
getDistance(LineSegment segment) |
double |
getDistance(Point point) |
double |
getDistance(Point end1,
Point end2) |
double |
getDistanceOfConcern() |
protected Point |
getPosit() |
protected double |
getPotentialForce(double[] position)
Computes the of the potential vector directing the owning vehicle away from this object
|
protected double |
getPotentialForce(double x,
double y)
Computes the of the potential vector directing the owning vehicle away from this object
|
protected double |
getPotentialForce(Point position)
Computes the of the potential vector directing the owning vehicle away from this object
|
protected double |
getPotentialForceDirection(double[] point)
Computes the direction that a potential vector will steer the owning vehicle to avoid this object
Default is for the force to be oriented directly away from the point defining the location.
|
protected double |
getPotentialForceDirection(double x,
double y)
Computes the direction that a potential vector will steer the owning vehicle to avoid this object
Default is for the force to be oriented directly away from the point defining the location.
|
protected double |
getPotentialForceDirection(Point point)
Computes the direction that a potential vector will steer the owning vehicle to avoid this object
Default is for the force to be oriented directly away from the point defining the location.
|
double[] |
getPotentialVector(double[] position,
double maxDofConcern)
Computes and returns a potential vector for directing the owning vehicle
towards a goal point while avoiding this object
|
double[] |
getPotentialVector(double x,
double y)
Computes and returns a potential vector for directing the owning vehicle away from this object
|
double[] |
getPotentialVector(Point position)
Computes and returns a potential vector for directing the owning vehicle
towards a goal point while avoiding this object
|
double |
getStandoff() |
double |
getXPosit() |
double |
getYPosit() |
void |
setPosit(double[] newPosit)
Resets the object's position in the world
|
void |
setPosit(double newX,
double newY)
Resets the object's position in the world
|
void |
setPosit(Point newPosit)
Resets the object's position in the world
|
void |
setStandoff(double newStandoff)
Resets the standoff distance (meters) that the vehicle must maintain from this object
|
String |
toString()
Generates a string representation of the wall object
|
protected double[] potentialVector
public WorldObject(double x, double y, double standoff)
x
- north/south Cartesian coordinate of the object's location in the worldy
- east/west Cartesian coordinate of the object's location in the worldstandoff
- required distance (meters) that the vehicle must remain clear from this objectpublic WorldObject(double[] position, double standoff)
position
- 2-element array with the Cartesian coordinates of the object's location in the worldstandoff
- required distance (meters) that the vehicle must remain clear from this objectpublic WorldObject(Point position, double standoff)
position
- 2-element array with the Cartesian coordinates of the object's location in the worldstandoff
- required distance (meters) that the vehicle must remain clear from this objectpublic void setPosit(double newX, double newY)
newX
- newY
- public void setPosit(double[] newPosit)
newPosit
- 2-element array containing the new Cartesian positionpublic void setPosit(Point newPosit)
newPosit
- 2-element array containing the new Cartesian positionprotected Point getPosit()
public double getXPosit()
public double getYPosit()
public void setStandoff(double newStandoff)
newStandoff
- new standoff distancepublic double getStandoff()
public double getDistance(Point point)
point
- an object containing the Cartesian coordinates of the point being testedpublic double getDistance(double[] point)
point
- a 2x1 double[] containing the Cartesian coordinates of the point being testedpublic double getDistance(double x, double y)
x
- the north/south Cartesian coordinate of the point being testedy
- the east/west Cartesian coordinate of the point being testedpublic double getDistance(LineSegment segment)
segment
- an object containing the line segmentpublic double getDistance(Point end1, Point end2)
end1
- an object containing the Cartesian coordinates of the first end pointend2
- an object containing the Cartesian coordinates of the second end pointpublic double getDistance(double[] end1, double[] end2)
end1
- a 2x1 double[] containing the Cartesian coordinates of the first segment end pointend2
- a 2x1 double[] containing the Cartesian coordinates of the second segment end pointpublic double getDistance(double x1, double y1, double x2, double y2)
x1
- the north/south Cartesian coordinate of the first segment end pointy1
- the east/west Cartesian coordinate of the first segment end pointx2
- the north/south Cartesian coordinate of the second segment end pointy2
- the east/west Cartesian coordinate of the second segment end pointpublic double getDistanceOfConcern()
public double[] getPotentialVector(double[] position, double maxDofConcern)
position
- Cartesian coordinates (2x1 double[]) defining the owning vehicle's current positionmaxDofConcern
- the maximum distance at which this object is relevant for obstacle avoidance purposespublic double[] getPotentialVector(Point position)
position
- Cartesian coordinates (2x1 double[]) defining the owning vehicle's current positionpublic double[] getPotentialVector(double x, double y)
x
- north/south Cartesian coordinates defining the owning vehicle's current positiony
- east/west Cartesian coordinates defining the owning vehicle's current positionprotected double getPotentialForce(double[] position)
position
- Cartesian coordinates (2x1 double[]) defining the owning vehicle's current positionprotected double getPotentialForce(Point position)
position
- Cartesian coordinates (2x1 double[]) defining the owning vehicle's current positionprotected double getPotentialForce(double x, double y)
x
- north/south Cartesian coordinates defining the owning vehicle's current positiony
- east/west Cartesian coordinates defining the owning vehicle's current positionprotected double getPotentialForceDirection(double[] point)
point
- Cartesian coordinates (2x1 double[]) defining the owning vehicle's current positionprotected double getPotentialForceDirection(Point point)
point
- Cartesian coordinates (2x1 double[]) defining the owning vehicle's current positionprotected double getPotentialForceDirection(double x, double y)
x
- north/south Cartesian coordinates defining the owning vehicle's current positiony
- east/west Cartesian coordinates defining the owning vehicle's current position