Skip to content
Closed
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
6 changes: 3 additions & 3 deletions yagsl/java/swervelib/SwerveInputStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public class SwerveInputStream implements Supplier<ChassisSpeeds>
/**
* Target to aim at.
*/
private Optional<Pose2d> aimTarget = Optional.empty();
private Optional<Supplier<Pose2d>> aimTarget = Optional.empty();
/**
* Target {@link Supplier<Pose2d>} to drive towards when driveToPose is enabled.
*/
Expand Down Expand Up @@ -568,7 +568,7 @@ public SwerveInputStream headingWhile(boolean headingState)
* @param aimTarget {@link Pose2d} to point at.
* @return this
*/
public SwerveInputStream aim(Pose2d aimTarget)
public SwerveInputStream aim(Supplier<Pose2d> aimTarget)
{
this.aimTarget = aimTarget.equals(Pose2d.kZero) ? Optional.empty() : Optional.of(aimTarget);
return this;
Expand Down Expand Up @@ -1120,7 +1120,7 @@ public ChassisSpeeds get()
}
case AIM ->
{
var targetVector = getTargetVector(aimTarget.orElseThrow());
var targetVector = getTargetVector(aimTarget.orElseThrow().get());
var targetDistance = targetVector.getNorm();
// TODO: Shoot on the move, using
// targetVector = targetVector.div(targetDistance).times(sotmDistanceToRPSMap.get(targetDistance)*flyWheelCircumference)
Expand Down