use of me.wobblyyyy.pathfinder2.trajectory.multi.segment.MultiSegmentTrajectory in project Pathfinder2 by Wobblyyyy.
the class MultiSegmentTrajectory method toString.
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("MultiSegmentTrajectory (");
for (Trajectory trajectory : trajectories) {
builder.append(trajectory);
builder.append(',');
}
if (trajectories.size() > 0)
builder.setLength(builder.length() - 1);
builder.append(')');
return builder.toString();
}
use of me.wobblyyyy.pathfinder2.trajectory.multi.segment.MultiSegmentTrajectory in project Pathfinder2 by Wobblyyyy.
the class TestSimulatedChassis method testMultiSegmentTrajectory.
@Test
public void testMultiSegmentTrajectory() {
List<Trajectory> trajectories = new LinearTrajectoryBuilder().setSpeed(0.5).setTolerance(DEFAULT_TOLERANCE).setAngleTolerance(Angle.fromDeg(1)).goTo(new PointXYZ(0, 0, 0)).goTo(new PointXYZ(0, 10, 0)).goTo(new PointXYZ(10, 10, 0)).goTo(new PointXYZ(10, 0, 0)).goTo(new PointXYZ(0, 0, 0)).getTrajectories();
Trajectory trajectory = new MultiSegmentTrajectory(trajectories);
pathfinder.followTrajectory(trajectory);
pathfinder.tickUntil(500);
assertPositionIs(new PointXYZ());
}
Aggregations