Search in sources :

Example 1 with ArcTrajectory

use of me.wobblyyyy.pathfinder2.trajectory.ArcTrajectory in project Pathfinder2 by Wobblyyyy.

the class TestSimulatedChassis method testArcTrajectory.

@SuppressWarnings("deprecation")
public void testArcTrajectory() {
    ArcTrajectory arc = new ArcTrajectory(new PointXYZ(5, 5, 0), 5, 0.5, Angle.fromDeg(-5), Angle.fromDeg(0), Angle.fromDeg(180), Angle.fromDeg(90));
    pathfinder.followTrajectory(arc);
    pathfinder.tickUntil(500);
    assertPositionIs(new PointXYZ(5, 5, 0));
}
Also used : ArcTrajectory(me.wobblyyyy.pathfinder2.trajectory.ArcTrajectory) PointXYZ(me.wobblyyyy.pathfinder2.geometry.PointXYZ)

Example 2 with ArcTrajectory

use of me.wobblyyyy.pathfinder2.trajectory.ArcTrajectory in project Pathfinder2 by Wobblyyyy.

the class TestArcTrajectory method testSingleArcTrajectory.

@SuppressWarnings("deprecation")
private void testSingleArcTrajectory(Angle startAngle, Angle size, Angle targetHeading) {
    Trajectory trajectory = new ArcTrajectory(new PointXYZ(), RADIUS, speed, ANGLE_STEP, targetHeading, startAngle, startAngle.add(size));
    pathfinder.followTrajectory(trajectory);
    PointXYZ end = new PointXY().inDirection(RADIUS, startAngle.add(size)).withHeading(targetHeading);
    pathfinder.tickUntil(1_000);
    assertPositionIs(end);
}
Also used : PointXY(me.wobblyyyy.pathfinder2.geometry.PointXY) PointXYZ(me.wobblyyyy.pathfinder2.geometry.PointXYZ)

Aggregations

PointXYZ (me.wobblyyyy.pathfinder2.geometry.PointXYZ)2 PointXY (me.wobblyyyy.pathfinder2.geometry.PointXY)1 ArcTrajectory (me.wobblyyyy.pathfinder2.trajectory.ArcTrajectory)1