src/robolib/trajectory/ballistics: BCResult Combines Penalty and BCEvalParams

This commit is contained in:
Ray Healy 2026-02-10 19:39:18 -05:00
parent 7c7b44d3e4
commit f8cfd19747
1 changed files with 9 additions and 15 deletions

View File

@ -1,27 +1,21 @@
package org.fairportrobotics.frc.robolib.trajectory.ballistics.calculators; package org.fairportrobotics.frc.robolib.trajectory.ballistics.calculators;
import org.fairportrobotics.frc.robolib.trajectory.Velocity3d; import org.fairportrobotics.frc.robolib.trajectory.ballistics.constraints.BCEvalParams;
public class BCResult<P> { public class BCResult {
public final Double velPenalty; /// The penalty for the computed launcher velocity (null if invalid) public final Double penalty; /// The penalty for the computed launcher velocity (null if invalid)
public final Velocity3d velGlobal; /// The computed launcher velocity (in the global coorinate space) public final BCEvalParams evalParams; /// The BCEvalParams instance that produced the best penalty
public final Velocity3d velRelative; /// The computed launcher velocity (in the robot-relative coordinate space)
public final P velParam; /// The model parameter that yielded velGlobal
public BCResult( public BCResult(
Double velPenalty, Double penalty,
Velocity3d velGlobal, BCEvalParams evalParams
Velocity3d velRelative,
P velParam
) { ) {
this.velPenalty = velPenalty; this.penalty = penalty;
this.velGlobal = velGlobal; this.evalParams = evalParams;
this.velRelative = velRelative;
this.velParam = velParam;
} }
public boolean isValid() { public boolean isValid() {
return this.velPenalty != null; return this.penalty != null;
} }
} }