Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelLesirge committed Feb 25, 2024
2 parents d306a5c + 8c54ac5 commit 0cc75e7
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions src/main/java/frc/robot/commands/FaceTag.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package frc.robot.commands;
import java.util.Map;

import edu.wpi.first.math.controller.PIDController;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.Constants.RobotMovementConstants;
import frc.robot.subsystems.SwerveDrivetrain;
import frc.robot.subsystems.Vision;

public class FaceTag extends Command {
private final Vision vision;
private final SwerveDrivetrain drivetrain;
private final PIDController rotationPID;

public FaceTag(Vision vision, SwerveDrivetrain drivetrain, Map<Integer,Double> targetTagPos){
this.vision = vision;
this.drivetrain = drivetrain;
rotationPID = new PIDController(
RobotMovementConstants.ROTATION_PID_P,
RobotMovementConstants.ROTATION_PID_I,
RobotMovementConstants.ROTATION_PID_D);
rotationPID.enableContinuousInput(-Math.PI, Math.PI);
rotationPID.setTolerance(RobotMovementConstants.ANGLE_TOLERANCE_RADIANS);

addRequirements(drivetrain);
}

@Override
public void initialize(){
drivetrain.toDefaultStates();
}

@Override
public void execute(){
}

}

0 comments on commit 0cc75e7

Please sign in to comment.