public class MotionProfile
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
MotionProfile.ErrorState |
static class |
MotionProfile.ProfileOption |
Modifier and Type | Field and Description |
---|---|
static int |
segments |
Constructor and Description |
---|
MotionProfile(double s0,
double s1,
double v0,
double v1,
double a0,
double a1,
double sMin,
double sMax,
double vMax,
double aMaxEntry,
double aMaxExit,
double jMax,
double tMin,
double tMax,
int profileOptions) |
MotionProfile(MotionProfile template) |
Modifier and Type | Method and Description |
---|---|
boolean |
assertSolved() |
MotionProfile.ErrorState |
checkValidity() |
void |
clearOption(MotionProfile.ProfileOption option) |
void |
computeBounds() |
void |
computeProfile(double vPeak,
double vEffEntry,
double vEffExit,
double tMin) |
protected void |
computeTime(double tMin) |
static void |
coordinateProfiles(MotionProfile[] profiles) |
static void |
coordinateProfilesToLead(MotionProfile[] profiles,
MotionProfile leadProfile) |
void |
coordinateProfileToLead(MotionProfile leadProfile) |
void |
copyProfileSolution(MotionProfile template)
Copy the profile solution from the template.
|
static double |
dotProduct(double[] unitVector1,
double[] unitVector2) |
void |
extractProfileSectionFrom(MotionProfile solvedProfile,
double t0,
double t7)
Extract the (fractional) segments from solvedProfile between t0 and t1 and save them in this profile.
|
double |
getAcceleration(int segment) |
double |
getAccelerationMax() |
java.lang.Double |
getBackwardCrossingTime(double sCross,
boolean halfProfile) |
double |
getEffectiveEntryVelocity(double jMax) |
double |
getEffectiveExitVelocity(double jMax) |
double |
getEntryAccelerationMax() |
double |
getExitAccelerationMax() |
java.lang.Double |
getForwardCrossingTime(double sCross,
boolean halfProfile) |
double |
getHigherABoundary() |
double |
getHigherABoundaryTime() |
double |
getHigherSBoundary() |
double |
getHigherSBoundaryTime() |
double |
getHigherVBoundary() |
double |
getHigherVBoundaryTime() |
double |
getJerk(int segment) |
double |
getJerkMax() |
static int |
getLeadAxisIndex(double[] vector) |
static int |
getLeadAxisIndex(MotionProfile[] profiles) |
double |
getLocation(int segment) |
double |
getLocationMax() |
double |
getLocationMin() |
double |
getLowerABoundary() |
double |
getLowerABoundary0Time() |
double |
getLowerSBoundary() |
double |
getLowerSBoundary0Time() |
double |
getLowerVBoundary() |
double |
getLowerVBoundary0Time() |
protected double |
getMomentary(double ts,
double f0,
double f7,
java.util.function.BiFunction<java.lang.Integer,java.lang.Double,java.lang.Double> f) |
double |
getMomentaryAcceleration(double time) |
double |
getMomentaryJerk(double time) |
double |
getMomentaryLocation(double time) |
double |
getMomentaryVelocity(double time) |
int |
getOptions() |
double |
getProfileAcceleration(Driver.MotionControlType motionControlType) |
double |
getProfileJerk(Driver.MotionControlType motionControlType) |
double |
getProfileVelocity(Driver.MotionControlType motionControlType) |
double |
getSegmentBeginTime(int segment) |
protected java.lang.Double |
getSegmentCrossingTime(double sCross,
double tSeg,
int i,
boolean forward) |
double |
getSolvingTime() |
double |
getTime() |
double |
getTimeMax() |
double |
getTimeMin() |
static double[] |
getUnitVector(MotionProfile[] profiles) |
double |
getVelocity(int segment) |
double |
getVelocityMax() |
boolean |
hasOption(MotionProfile.ProfileOption option) |
boolean |
isConstantAcceleration() |
static boolean |
isCoordinated(MotionProfile[] profiles) |
boolean |
isEmpty() |
boolean |
isSolved() |
boolean |
isSupportingUncoordinated() |
protected java.lang.Double |
newtonSolve(double x0,
double x1,
java.util.function.Function<java.lang.Double,java.lang.Double> f,
java.util.function.Function<java.lang.Double,java.lang.Double> g,
boolean zeroes) |
double |
profileSignum(double vEffEntry,
double vEffExit) |
boolean |
retimeProfile()
Recalculate the profile to make sure it takes the given amount of time.
|
void |
setEntryAccelerationMax(double aMaxEntry) |
void |
setExitAccelerationMax(double aMaxExit) |
void |
setJerkMax(double jMax) |
void |
setLocationMax(double sMax) |
void |
setLocationMin(double sMin) |
void |
setOption(MotionProfile.ProfileOption option) |
void |
setTimeMax(double tMax) |
void |
setTimeMin(double tMin) |
void |
setVelocityMax(double vMax) |
void |
solve() |
void |
solve(int iterations,
double vtol,
double ttol) |
void |
solveByExpansion(double signum,
boolean expandEntry,
boolean expandExit) |
boolean |
solveForVelocity(int iterations,
double vtol,
double ttol) |
boolean |
solveIfNullMove() |
protected boolean |
solveRegion(double vPeak0,
double vPeak1,
double sResult0,
double sResult1,
double tResult0,
double tResult1,
double vEffEntry,
double vEffExit,
double tMin,
double bestTime,
int iterations,
double stol,
double vtol,
double ttol) |
static void |
synchronizeProfiles(MotionProfile[] profiles) |
java.lang.String |
toString() |
void |
toSvg() |
void |
validate(java.lang.String label) |
static void |
validateProfiles(MotionProfile[] profiles) |
public static final int segments
public MotionProfile(double s0, double s1, double v0, double v1, double a0, double a1, double sMin, double sMax, double vMax, double aMaxEntry, double aMaxExit, double jMax, double tMin, double tMax, int profileOptions)
public MotionProfile(MotionProfile template)
public boolean hasOption(MotionProfile.ProfileOption option)
public void setOption(MotionProfile.ProfileOption option)
public void clearOption(MotionProfile.ProfileOption option)
public int getOptions()
public double getLocation(int segment)
public double getVelocity(int segment)
public double getAcceleration(int segment)
public double getJerk(int segment)
public double getSegmentBeginTime(int segment)
public double getLocationMin()
public void setLocationMin(double sMin)
public double getLocationMax()
public void setLocationMax(double sMax)
public double getVelocityMax()
public void setVelocityMax(double vMax)
public double getEntryAccelerationMax()
public void setEntryAccelerationMax(double aMaxEntry)
public double getExitAccelerationMax()
public void setExitAccelerationMax(double aMaxExit)
public double getAccelerationMax()
public double getJerkMax()
public void setJerkMax(double jMax)
public double getTimeMin()
public void setTimeMin(double tMin)
public double getTimeMax()
public void setTimeMax(double tMax)
public double getSolvingTime()
public double getLowerSBoundary()
public double getHigherSBoundary()
public double getLowerSBoundary0Time()
public double getHigherSBoundaryTime()
public double getLowerVBoundary()
public double getHigherVBoundary()
public double getLowerVBoundary0Time()
public double getHigherVBoundaryTime()
public double getLowerABoundary()
public double getHigherABoundary()
public double getLowerABoundary0Time()
public double getHigherABoundaryTime()
public boolean isSolved()
public boolean isEmpty()
public double getProfileVelocity(Driver.MotionControlType motionControlType)
public double getProfileAcceleration(Driver.MotionControlType motionControlType)
public double getProfileJerk(Driver.MotionControlType motionControlType)
public double getTime()
protected double getMomentary(double ts, double f0, double f7, java.util.function.BiFunction<java.lang.Integer,java.lang.Double,java.lang.Double> f)
public double getMomentaryLocation(double time)
public double getMomentaryVelocity(double time)
public double getMomentaryAcceleration(double time)
public double getMomentaryJerk(double time)
public MotionProfile.ErrorState checkValidity()
public void validate(java.lang.String label)
public static void validateProfiles(MotionProfile[] profiles)
public java.lang.String toString()
toString
in class java.lang.Object
public void solve()
public void solve(int iterations, double vtol, double ttol)
public boolean isConstantAcceleration()
public boolean solveForVelocity(int iterations, double vtol, double ttol)
public boolean solveIfNullMove()
public double profileSignum(double vEffEntry, double vEffExit)
protected boolean solveRegion(double vPeak0, double vPeak1, double sResult0, double sResult1, double tResult0, double tResult1, double vEffEntry, double vEffExit, double tMin, double bestTime, int iterations, double stol, double vtol, double ttol)
public boolean retimeProfile()
newTime
- public boolean assertSolved()
public static void coordinateProfiles(MotionProfile[] profiles)
public static void coordinateProfilesToLead(MotionProfile[] profiles, MotionProfile leadProfile)
public void coordinateProfileToLead(MotionProfile leadProfile)
public static void synchronizeProfiles(MotionProfile[] profiles)
public void solveByExpansion(double signum, boolean expandEntry, boolean expandExit)
public void extractProfileSectionFrom(MotionProfile solvedProfile, double t0, double t7)
solvedProfile
- t0
- t7
- public void copyProfileSolution(MotionProfile template)
template
- public static int getLeadAxisIndex(double[] vector)
public static int getLeadAxisIndex(MotionProfile[] profiles)
public static double dotProduct(double[] unitVector1, double[] unitVector2)
public static double[] getUnitVector(MotionProfile[] profiles)
public static boolean isCoordinated(MotionProfile[] profiles)
public void computeProfile(double vPeak, double vEffEntry, double vEffExit, double tMin)
protected void computeTime(double tMin)
public java.lang.Double getForwardCrossingTime(double sCross, boolean halfProfile)
public java.lang.Double getBackwardCrossingTime(double sCross, boolean halfProfile)
protected java.lang.Double getSegmentCrossingTime(double sCross, double tSeg, int i, boolean forward)
protected java.lang.Double newtonSolve(double x0, double x1, java.util.function.Function<java.lang.Double,java.lang.Double> f, java.util.function.Function<java.lang.Double,java.lang.Double> g, boolean zeroes)
public void computeBounds()
public double getEffectiveEntryVelocity(double jMax)
public double getEffectiveExitVelocity(double jMax)
public void toSvg()
public boolean isSupportingUncoordinated()