Constraints
Methods in the Path Class that allow you to control the robot's heading interpolation and end path behavior.
Timeout
Sets how long, in milliseconds, the follower has to correct after reaching the end of the path. Increasing it will give the robot more time to correct at the end of the path to improve its accuracy. Decreasing it will reduce the robot's wait time between following paths, but may cause the path following to be slightly more inaccurate.
To set: path.setPathEndTimeoutConstraint(double set)
TValue
Sets the path's parametric end criteria, or how much of the path the robot must follow before it is considered complete. set
should be a double between 0.0 and 1.0, and by default it is 0.995.
To set: path.setPathEndTValueConstraint(double set)
Tip
If the robot gets stuck after reaching the end of the path and is unable to continue following the next one, the follower likely thinks that it is not done following the path. Try decreasing the T value constraint for that path.
Linear Heading Interpolation
This will cause the robot to turn from startHeading
to endHeading
while it is following the path.
The endTime
parameter is a double between 0.0 and 1.0, and it specifies when the robot should finish turning to endHeading. Setting endTime
to somewhere around 0.8 should work
well for most paths. Setting endTime too low will cause the robot to turn too quickly and create too many oscillations, while setting it too high may lower the robot's end heading accuracy.
To set: setLinearHeadingInterpolation(double startHeading, double endHeading, double endTime)
Constant Heading Interpolation
Causes the robot to maintain a constant heading while following the path. If the robot starts a path with a different heading comapared to that set in the path, it will turn to that heading before starting the path.
To set: setConstantHeadingInterpolation(double setHeading)
Tangent Heading Interpolation
Causes the robot to adjust the heading tangental to the path, or adjust the heading to the slope of the curve.
To set: setTangentHeadingInterpolation()
Warning: All heading values must be in radians! To convert degrees to radians, use Math.toRadians(degrees)
.
Last updated on