Skip to content

Delays

NextFTC has two position-related delays to help you time your commands with PedroPathing.

ProximityDelay

ProximityDelay waits until the robot is within a tolerable distance of a point. In other words, it waits until the robot is in a circle centered at a point with a certain radius.

kotlin
ProximityDelay(Pose(10.0, 12.0), 5.0) // pose(x, y), tolerance
// default tolerance is 4.0

DisplacementDelay

DisplacementDelay is the opposite of ProximityDelay. Instead of waiting until it's close to a point, DisplacementDelay waits until the robot is a certain distance away from a point. In other words, it waits until the robot is outside of a circle centered at a point with a certain radius.

Another difference from ProximityDelay is that instead of specifying the point, the point is wherever the robot was when the command was scheduled.

kotlin
DisplacementDelay(10.0) // distance from starting position

NOTE

See the PedroPathing reference for more information.