Search in sources :

Example 1 with me.wobblyyyy.pathfinder2.utils

use of me.wobblyyyy.pathfinder2.utils in project Pathfinder2 by Wobblyyyy.

the class CircleSurrounder method fastSurround.

/**
 * Surround the circle. This will find the closest point, create a new
 * {@link me.wobblyyyy.pathfinder2.trajectory.FastTrajectory} to that
 * point, and then instruct Pathfinder to follow it.
 */
public void fastSurround() {
    PointXYZ robotPosition = pathfinder.getPosition();
    double speed = pathfinder.getSpeed();
    double tolerance = pathfinder.getTolerance();
    Angle angleTolerance = pathfinder.getAngleTolerance();
    Trajectory trajectory = CircleSurround.fastTrajectoryToClosestPoint(robotPosition, center, radius, speed);
    pathfinder.followTrajectory(trajectory);
}
Also used : Angle(me.wobblyyyy.pathfinder2.geometry.Angle) PointXYZ(me.wobblyyyy.pathfinder2.geometry.PointXYZ) Trajectory(me.wobblyyyy.pathfinder2.trajectory.Trajectory)

Example 2 with me.wobblyyyy.pathfinder2.utils

use of me.wobblyyyy.pathfinder2.utils in project Pathfinder2 by Wobblyyyy.

the class CircleSurrounder method surround.

/**
 * Surround the circle. This will find the closest point, create a new
 * {@link me.wobblyyyy.pathfinder2.trajectory.LinearTrajectory} to that
 * point, and then instruct Pathfinder to follow it.
 */
public void surround() {
    PointXYZ robotPosition = pathfinder.getPosition();
    double speed = pathfinder.getSpeed();
    double tolerance = pathfinder.getTolerance();
    Angle angleTolerance = pathfinder.getAngleTolerance();
    Trajectory trajectory = CircleSurround.trajectoryToClosestPoint(robotPosition, center, radius, speed, tolerance, angleTolerance);
    pathfinder.followTrajectory(trajectory);
}
Also used : Angle(me.wobblyyyy.pathfinder2.geometry.Angle) PointXYZ(me.wobblyyyy.pathfinder2.geometry.PointXYZ) Trajectory(me.wobblyyyy.pathfinder2.trajectory.Trajectory)

Aggregations

Angle (me.wobblyyyy.pathfinder2.geometry.Angle)2 PointXYZ (me.wobblyyyy.pathfinder2.geometry.PointXYZ)2 Trajectory (me.wobblyyyy.pathfinder2.trajectory.Trajectory)2