Skip to content

Commit a3520dc

Browse files
committed
2 parents 04f28f6 + 82521b4 commit a3520dc

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/main/java/frc/robot/vision/commands/LineupCommand.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,17 @@ public class LineupCommand extends Command {
6767
public LineupCommand() {
6868
//set tolerances of all PID controllers
6969
xDistanceController.setTolerance(VisionConfig.AlignmentConfig.DISTANCE_TOLERANCE.in(Meters));
70+
xDistanceController.setIntegratorRange(-.15, .15);
7071
yDistanceController.setTolerance(VisionConfig.AlignmentConfig.LATERAL_TOLERANCE.in(Meters));
72+
yDistanceController.setIntegratorRange(-.15, .15);
7173
thetaController.enableContinuousInput(Units.degreesToRadians(-180), Units.degreesToRadians(180));
7274

7375
currentPose = PoseEstimatorSubsystem.getInstance().getCurrentPose();
76+
Pose2d targetPose = getTargetReefPose(true);
77+
78+
xDistanceController.reset(0);
79+
yDistanceController.reset(0);
80+
thetaController.reset(0);
7481

7582
addRequirements(CommandSwerveDrivetrain.getInstance());
7683
}
@@ -82,7 +89,12 @@ public void initialize() {
8289

8390
@Override
8491
public void execute() {
85-
92+
currentPose = PoseEstimatorSubsystem.getInstance().getCurrentPose();
93+
ChassisSpeeds currentSpeeds = CommandSwerveDrivetrain.getInstance().getState().Speeds;
94+
double xPose = currentPose.getTranslation().getX();
95+
double yPose = currentPose.getTranslation().getY();
96+
97+
8698
}
8799

88100
@Override
@@ -107,6 +119,7 @@ private Pose2d getTargetReefPose(boolean left){
107119
var currAlliance = DriverStation.getAlliance();
108120

109121
//TODO: map currentPose to a Reef Zone and then finding closest lineup based on heading
122+
//joey... what the actual god-loving heck is this
110123

111124
if(currAlliance.get() == Alliance.Blue) {
112125

0 commit comments

Comments
 (0)