File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
choreolib/src/main/java/choreo/auto Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -277,7 +277,10 @@ <ST extends TrajectorySample<ST>> AutoTrajectory trajectory(
277277 * @return A new {@link AutoTrajectory}.
278278 */
279279 public Command trajectoryCmd (String trajectoryName ) {
280- return trajectory (trajectoryName , voidRoutine ).cmd ();
280+ AutoRoutine routine = newRoutine ("Routine" );
281+ AutoTrajectory trajectory = routine .trajectory (trajectoryName );
282+ routine .active ().onTrue (trajectory .cmd ());
283+ return routine .cmd ().until (trajectory .done ());
281284 }
282285
283286 /**
@@ -296,7 +299,10 @@ public Command trajectoryCmd(String trajectoryName) {
296299 * @return A new {@link AutoTrajectory}.
297300 */
298301 public Command trajectoryCmd (String trajectoryName , final int splitIndex ) {
299- return trajectory (trajectoryName , splitIndex , voidRoutine ).cmd ();
302+ AutoRoutine routine = newRoutine ("Routine" );
303+ AutoTrajectory trajectory = routine .trajectory (trajectoryName , splitIndex );
304+ routine .active ().onTrue (trajectory .cmd ());
305+ return routine .cmd ().until (trajectory .done ());
300306 }
301307
302308 /**
You can’t perform that action at this time.
0 commit comments