Skip to content

Commit

Permalink
[wpimath] Remove units from trapezoid profile classes (#7276)
Browse files Browse the repository at this point in the history
  • Loading branch information
SamCarlberg authored Nov 16, 2024
1 parent 2acf111 commit ded7c87
Showing 1 changed file with 0 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@

import edu.wpi.first.math.MathSharedStore;
import edu.wpi.first.math.MathUsageId;
import edu.wpi.first.units.Measure;
import edu.wpi.first.units.PerUnit;
import edu.wpi.first.units.TimeUnit;
import edu.wpi.first.units.Unit;
import java.util.Objects;

/**
Expand Down Expand Up @@ -72,20 +68,6 @@ public Constraints(double maxVelocity, double maxAcceleration) {
this.maxAcceleration = maxAcceleration;
MathSharedStore.reportUsage(MathUsageId.kTrajectory_TrapezoidProfile, 1);
}

/**
* Constructs constraints for a TrapezoidProfile.
*
* @param <U> Unit type.
* @param maxVelocity maximum velocity
* @param maxAcceleration maximum acceleration
*/
public <U extends Unit> Constraints(
Measure<? extends PerUnit<? extends U, TimeUnit>> maxVelocity,
Measure<? extends PerUnit<? extends PerUnit<? extends U, TimeUnit>, TimeUnit>>
maxAcceleration) {
this(maxVelocity.baseUnitMagnitude(), maxAcceleration.baseUnitMagnitude());
}
}

/** Profile state. */
Expand All @@ -110,18 +92,6 @@ public State(double position, double velocity) {
this.velocity = velocity;
}

/**
* Constructs constraints for a Trapezoid Profile.
*
* @param <U> Unit type.
* @param position The position at this state.
* @param velocity The velocity at this state.
*/
public <U extends Unit> State(
Measure<U> position, Measure<? extends PerUnit<? extends U, TimeUnit>> velocity) {
this(position.baseUnitMagnitude(), velocity.baseUnitMagnitude());
}

@Override
public boolean equals(Object other) {
return other instanceof State rhs
Expand Down

0 comments on commit ded7c87

Please sign in to comment.