use of me.wobblyyyy.pathfinder2.geometry.PointXYZ in project Pathfinder2 by Wobblyyyy.
the class EasyOdometry method buildOdometry.
public static Odometry buildOdometry(Supplier<Double> xPos, Supplier<Double> yPos, Supplier<Angle> zPos) {
return new AbstractOdometry() {
@Override
public PointXYZ getRawPosition() {
double x = xPos.get();
double y = yPos.get();
Angle z = zPos.get();
return new PointXYZ(x, y, z);
}
};
}
use of me.wobblyyyy.pathfinder2.geometry.PointXYZ in project Pathfinder2 by Wobblyyyy.
the class SimulatedOdometry method setRawPosition.
public void setRawPosition(double x, double y, double zDegrees) {
ValidationUtils.validate(x, "x");
ValidationUtils.validate(y, "y");
ValidationUtils.validate(zDegrees, "zDegrees");
setRawPosition(new PointXYZ(x, y, zDegrees));
}
use of me.wobblyyyy.pathfinder2.geometry.PointXYZ in project Pathfinder2 by Wobblyyyy.
the class TestValidationUtils method testValidateNonNullObject.
@Test
public void testValidateNonNullObject() {
ValidationUtils.validate(new PointXYZ());
ValidationUtils.validate(new PointXYZ(), "hello");
}
use of me.wobblyyyy.pathfinder2.geometry.PointXYZ in project Pathfinder2 by Wobblyyyy.
the class TestSimulatedChassis method testTurningRectangle.
@Test
public void testTurningRectangle() {
pathfinder.followTrajectories(new LinearTrajectory(new PointXYZ(0, 0, 0), 0.5, 0.1, Angle.fromDeg(5)), new LinearTrajectory(new PointXYZ(10, 0, 90), 0.5, 0.1, Angle.fromDeg(5)), new LinearTrajectory(new PointXYZ(10, 10, 180), 0.5, 0.1, Angle.fromDeg(5)), new LinearTrajectory(new PointXYZ(0, 10, 270), 0.5, 0.1, Angle.fromDeg(5)), new LinearTrajectory(new PointXYZ(0, 0, 0), 0.5, 0.1, Angle.fromDeg(5)));
pathfinder.tickUntil(500);
assertPositionIs(new PointXYZ());
}
use of me.wobblyyyy.pathfinder2.geometry.PointXYZ in project Pathfinder2 by Wobblyyyy.
the class TestSimulatedChassis method testAkimaSplineInterpolation.
@Test
public void testAkimaSplineInterpolation() {
Trajectory trajectory = new AdvancedSplineTrajectoryBuilder().setStep(0.5).setTolerance(DEFAULT_TOLERANCE).setAngleTolerance(Angle.fromDeg(1)).setInterpolationMode(InterpolationMode.AKIMA).setSpeed(0.5).add(new PointXYZ(0, 0, 0)).add(new PointXYZ(4, 10, 0)).add(new PointXYZ(8, 12, 0)).add(new PointXYZ(10, 13, 0)).add(new PointXYZ(12, 14, 0)).add(new PointXYZ(14, 15, 0)).build();
pathfinder.followTrajectory(trajectory);
pathfinder.tickUntil(500);
assertPositionIs(new PointXYZ(14, 15, 0));
}
Aggregations