Skip to content

Commit

Permalink
ran fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
oh-yes-0-fps committed Nov 27, 2024
1 parent b74c4f3 commit 932296a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
8 changes: 4 additions & 4 deletions choreolib/src/main/java/choreo/Choreo.java
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,10 @@ public void clear() {
* robot.
* @param controller A function that receives the current {@link SampleType} and controls the
* robot.
* @param mirrorTrajectory If this returns empty your auto routines and trajectories will do nothing,
* if this returns true then path will be mirrored to the opposite side,
* while keeping the same coordinate system origin. This will be called multiple times
* every loop while auto routines are running.
* @param mirrorTrajectory If this returns empty your auto routines and trajectories will do
* nothing, if this returns true then path will be mirrored to the opposite side, while
* keeping the same coordinate system origin. This will be called multiple times every loop
* while auto routines are running.
* @param driveSubsystem The drive {@link Subsystem} to require for {@link AutoTrajectory} {@link
* Command}s.
* @param bindings Universal trajectory event bindings.
Expand Down
3 changes: 2 additions & 1 deletion choreolib/src/main/java/choreo/auto/AutoFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ public <SampleType extends TrajectorySample<SampleType>> AutoTrajectory trajecto
// type solidify everything
final Trajectory<SampleType> solidTrajectory = trajectory;
final Consumer<SampleType> solidController = (Consumer<SampleType>) this.controller;
final Optional<TrajectoryLogger<SampleType>> solidLogger = this.trajectoryLogger.map(logger -> (TrajectoryLogger<SampleType>) logger);
final Optional<TrajectoryLogger<SampleType>> solidLogger =
this.trajectoryLogger.map(logger -> (TrajectoryLogger<SampleType>) logger);
return new AutoTrajectory(
trajectory.name(),
solidTrajectory,
Expand Down
12 changes: 7 additions & 5 deletions choreolib/src/main/java/choreo/auto/AutoTrajectory.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ private void cmdInitialize() {

@SuppressWarnings("unchecked")
private void cmdExecute() {
if (!isActive) { return; }
if (!isActive) {
return;
}
var sample = trajectory.sampleAt(timer.get(), mirrorTrajectory.getAsBoolean());
if (sample instanceof SwerveSample swerveSample) {
var swerveController = (Consumer<SwerveSample>) this.controller;
Expand All @@ -149,7 +151,9 @@ private void cmdExecute() {
}

private void cmdEnd(boolean interrupted) {
if (!isActive) { return; }
if (!isActive) {
return;
}
timer.stop();
isActive = false;
isCompleted = !interrupted;
Expand All @@ -158,9 +162,7 @@ private void cmdEnd(boolean interrupted) {
}

private boolean cmdIsFinished() {
return timer.get() > trajectory.getTotalTime()
|| routine.isKilled
|| !isActive;
return timer.get() > trajectory.getTotalTime() || routine.isKilled || !isActive;
}

/**
Expand Down

0 comments on commit 932296a

Please sign in to comment.