![]() | [using it] | Interface Manipulation Package v4.0 (2008-06-25) | ![]() | ©copyright | ![]() |
java.lang.Objectimp.trajectory.Trajectory
public class Trajectory
Defines a trajectory generator.
Vector getTrajectory(double x0[]) { Vector trajectory = new Vector(); trajectory.add(x0); double x1[] = x0; do { x0 = x1; trajectory.add(x1 = get(x1)); } while(x0 != x1); if (!trajectory.isAtEnd(x1)) throw new IllegalStateException("Trajectory generation fails"); return trajectory; }returns the whole trajectory, given an initial state x0[].
Nested Class Summary | |
---|---|
static class |
Trajectory.Constraint
Defines an obstacle from an equation: c(x) > 0 for x outside the obstacle. |
static class |
Trajectory.Obstacle
Defines a trajectory obstacle. |
Constructor Summary | |
---|---|
Trajectory(int dim,
double step)
Constructs a trajectory. |
Method Summary | |
---|---|
Trajectory |
add(Trajectory.Obstacle obstacle)
Adds an obstacle for the trajectory and return this. |
double[] |
get(double[] x0)
Returns the point next to x0[] for this trajectory or x0[] if on the goal or if it fails. |
boolean |
isAtEnd(double[] x0)
Test if the trajectory point reaches the goal |
Trajectory |
remove(Trajectory.Obstacle obstacle)
Deletes an obstacle for the trajectory and return this. |
Trajectory |
setEnd(double[] x_oo,
boolean goal)
Defines the goal, i.e. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Trajectory(int dim, double step)
dim
- Problem dimensionstep
- Minimal distance between two distinguishable points.Method Detail |
---|
public Trajectory add(Trajectory.Obstacle obstacle)
public double[] get(double[] x0)
public boolean isAtEnd(double[] x0)
public Trajectory remove(Trajectory.Obstacle obstacle)
public Trajectory setEnd(double[] x_oo, boolean goal)
x_oo
- End point coordinatesgoal
- [optional, default is true] If true this is the final goal and the trajectory ends, else it is an intermediate temporary goal.