Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wpimath] Remove units from trapezoid profile classes #7276

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading