use of me.wobblyyyy.pathfinder2.geometry.PointXYZ in project Pathfinder2 by Wobblyyyy.
the class TestMovementCommands method testSplineToWithParameters.
@Test
public void testSplineToWithParameters() {
registry.execute("splineTo", "0.5", "2", "5 deg", "0,0,15", "5,10,30", "10,15,45", "15,25,60");
pathfinder.tickUntil(100);
AssertionUtils.assertIsNear(new PointXYZ(15, 25, 60), pathfinder.getPosition(), 2, Angle.fromDeg(5));
}
use of me.wobblyyyy.pathfinder2.geometry.PointXYZ in project Pathfinder2 by Wobblyyyy.
the class TestMovementCommands method testGoToWithPointXY.
@Test
public void testGoToWithPointXY() {
registry.execute("goTo", "10, ", "0");
pathfinder.tickUntil(1_000);
AssertionUtils.assertIsNear(new PointXYZ(10, 0, 0), pathfinder.getPosition(), 2, Angle.fromDeg(5));
registry.execute("goTo", "0, 10");
pathfinder.tickUntil(1_000);
AssertionUtils.assertIsNear(new PointXYZ(0, 10, 0), pathfinder.getPosition(), 2, Angle.fromDeg(5));
registry.execute("goTo", "10, 10");
pathfinder.tickUntil(1_000);
AssertionUtils.assertIsNear(new PointXYZ(10, 10, 0), pathfinder.getPosition(), 2, Angle.fromDeg(5));
}
use of me.wobblyyyy.pathfinder2.geometry.PointXYZ in project Pathfinder2 by Wobblyyyy.
the class TestMovementCommands method testNonTurningSplineTo.
@Test
public void testNonTurningSplineTo() {
registry.execute("splineTo", "0,0,0", "5,10,0", "10,15,0", "15,25,0");
pathfinder.tickUntil(100);
AssertionUtils.assertIsNear(new PointXYZ(15, 25, 0), pathfinder.getPosition(), 2, Angle.fromDeg(5));
}
use of me.wobblyyyy.pathfinder2.geometry.PointXYZ in project Pathfinder2 by Wobblyyyy.
the class TestScript method testSetValuesAndSplineToScript.
@Test
public void testSetValuesAndSplineToScript() {
pathfinder.setSpeed(0.2);
pathfinder.setTolerance(0.1);
pathfinder.setAngleTolerance(Angle.fromDeg(45));
Script script = Script.load(registry, "me/wobblyyyy/pathfinder2/commands/testSetValuesAndSplineTo.pf");
script.execute();
Assertions.assertEquals(0.5, pathfinder.getSpeed());
Assertions.assertEquals(2, pathfinder.getTolerance());
Assertions.assertEquals(Angle.fromDeg(5), pathfinder.getAngleTolerance());
AssertionUtils.assertIsNear(new PointXYZ(0, 0, 0), pathfinder.getPosition(), 2, Angle.fromDeg(5));
}
use of me.wobblyyyy.pathfinder2.geometry.PointXYZ in project Pathfinder2 by Wobblyyyy.
the class Pathfinder method goTo.
/**
* Go to a specific point. This method will create a new linear trajectory.
*
* @param point the target point to go to.
* @return this instance of Pathfinder, used for method chaining.
* @see #setSpeed(double)
* @see #setTolerance(double)
* @see #setAngleTolerance(Angle)
*/
public Pathfinder goTo(PointXYZ point) {
NullPointException.throwIfInvalid("Attempted to navigate to a null point.", point);
checkForMissingDefaultValues();
followTrajectory(new LinearTrajectory(point, speed, tolerance, angleTolerance));
return this;
}
Aggregations