public class Motion
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Motion.MotionOption
Contains all possible options for a motion.
|
class |
Motion.MoveToCommand |
Constructor and Description |
---|
Motion(HeadMountable headMountable,
AxesLocation location0,
AxesLocation location1,
double nominalSpeed,
double feedrateOverride,
double accelerationOverride,
double jerkOverride,
int options) |
Motion(HeadMountable headMountable,
AxesLocation location0,
AxesLocation location1,
double nominalSpeed,
int options) |
Motion(HeadMountable headMountable,
AxesLocation location0,
AxesLocation location1,
double nominalSpeed,
Motion.MotionOption... options) |
Motion(Motion motion) |
Modifier and Type | Method and Description |
---|---|
void |
clearOption(Motion.MotionOption option) |
protected void |
computeLimitsAndProfile(double feedrateOverride,
double accelerationOverride,
double jerkOverride)
Compute the limits (maximum axis velocity, acceleration, jerk) and the initial raw axis motion profile.
|
java.lang.Double |
getAccelerationPerSecond2(Driver driver) |
MotionProfile[] |
getAxesProfiles() |
java.lang.Integer |
getAxisIndex(ControllerAxis axis) |
double |
getEffectiveSpeed() |
double |
getEuclideanDistance() |
java.lang.Double |
getFeedRatePerMinute(Driver driver) |
java.lang.Double |
getFeedRatePerSecond(Driver driver) |
HeadMountable |
getHeadMountable() |
java.lang.Double |
getJerkPerSecond3(Driver driver) |
AxesLocation |
getLocation0() |
AxesLocation |
getLocation1() |
AxesLocation |
getMomentaryAcceleration(double time) |
AxesLocation |
getMomentaryJerk(double time) |
AxesLocation |
getMomentaryLocation(double time) |
AxesLocation |
getMomentaryVelocity(double time) |
AxesLocation |
getMovingAxesTargetLocation(Driver driver)
Get the target location of this Motion with only the moved axes of the given driver in it.
|
double |
getNominalSpeed() |
int |
getOptions() |
double |
getPlannedTime0() |
double |
getPlannedTime1() |
Triplet<java.lang.Double,java.lang.Double,java.lang.Double> |
getRate(Driver driver,
java.util.function.BiFunction<ControllerAxis,MotionProfile,java.lang.Double> f)
Get the rate function of a motion from the planned profile.
|
java.lang.Double |
getRS274NGCRate(Driver driver,
java.util.function.BiFunction<ControllerAxis,MotionProfile,java.lang.Double> f,
java.lang.Double defaultRate)
Get the rate according to NIST RS274NGC Interpreter - Version 3, Section 2.1.2.5 (p.
|
double |
getTime() |
boolean |
hasOption(Motion.MotionOption option) |
java.util.List<Motion.MoveToCommand> |
interpolatedMoveToCommands(Driver driver,
boolean retiming)
Interpolate the Motion using the given parameters and return a list of moveToCommands with waypoints and
envelope feed-rate and acceleration limits as needed.
|
boolean |
isEmpty() |
protected java.util.List<Motion.MoveToCommand> |
moderatedMoveTo(Driver driver)
Create a constant acceleration move out of a move planned with 3rd order/jerk control.
|
static int |
optionFlags(Motion.MotionOption... options) |
void |
setOption(Motion.MotionOption option) |
void |
setPlannedTime1(double plannedTime1) |
java.util.List<Motion.MoveToCommand> |
singleMoveTo(Driver driver)
Creates a single move out of the motion.
|
java.lang.String |
toString() |
public Motion(HeadMountable headMountable, AxesLocation location0, AxesLocation location1, double nominalSpeed, double feedrateOverride, double accelerationOverride, double jerkOverride, int options)
public Motion(HeadMountable headMountable, AxesLocation location0, AxesLocation location1, double nominalSpeed, int options)
public Motion(HeadMountable headMountable, AxesLocation location0, AxesLocation location1, double nominalSpeed, Motion.MotionOption... options)
public Motion(Motion motion)
public static int optionFlags(Motion.MotionOption... options)
public HeadMountable getHeadMountable()
public boolean hasOption(Motion.MotionOption option)
public void setOption(Motion.MotionOption option)
public void clearOption(Motion.MotionOption option)
public int getOptions()
public double getTime()
public double getPlannedTime0()
public double getPlannedTime1()
public void setPlannedTime1(double plannedTime1)
public java.lang.String toString()
toString
in class java.lang.Object
public double getNominalSpeed()
public double getEffectiveSpeed()
public boolean isEmpty()
protected void computeLimitsAndProfile(double feedrateOverride, double accelerationOverride, double jerkOverride)
jerkOverride
- accelerationOverride
- feedrateOverride
- public AxesLocation getLocation0()
public AxesLocation getLocation1()
public MotionProfile[] getAxesProfiles()
public java.lang.Integer getAxisIndex(ControllerAxis axis)
public double getEuclideanDistance()
public AxesLocation getMomentaryLocation(double time)
public AxesLocation getMomentaryVelocity(double time)
public AxesLocation getMomentaryAcceleration(double time)
public AxesLocation getMomentaryJerk(double time)
public AxesLocation getMovingAxesTargetLocation(Driver driver)
driver
- public Triplet<java.lang.Double,java.lang.Double,java.lang.Double> getRate(Driver driver, java.util.function.BiFunction<ControllerAxis,MotionProfile,java.lang.Double> f)
driver
- The driver for which the rate is calculated i.e. for the axes mapped to it.f
- The function to be applied to the motion profile to obtain the rate.public java.lang.Double getRS274NGCRate(Driver driver, java.util.function.BiFunction<ControllerAxis,MotionProfile,java.lang.Double> f, java.lang.Double defaultRate)
driver
- The driver for which the rate is calculated i.e. for the axes mapped to it.f
- The function to be applied to the motion profile to obtain the rate.defaultRate
- https://tsapps.nist.gov/publication/get_pdf.cfm?pub_id=823374
public java.lang.Double getFeedRatePerSecond(Driver driver)
driver
- The driver for which the rate is calculated i.e. for the axes mapped to it.public java.lang.Double getFeedRatePerMinute(Driver driver)
driver
- The driver for which the rate is calculated i.e. for the axes mapped to it.public java.lang.Double getAccelerationPerSecond2(Driver driver)
driver
- The driver for which the rate is calculated i.e. for the axes mapped to it.public java.lang.Double getJerkPerSecond3(Driver driver)
driver
- The driver for which the rate is calculated i.e. for the axes mapped to it.public java.util.List<Motion.MoveToCommand> interpolatedMoveToCommands(Driver driver, boolean retiming) throws java.lang.Exception
driver
- java.lang.Exception
protected java.util.List<Motion.MoveToCommand> moderatedMoveTo(Driver driver)
driver
- time
- public java.util.List<Motion.MoveToCommand> singleMoveTo(Driver driver)
driver
-