-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/redshiftrobotics/crescendo-…
- Loading branch information
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(){ | ||
} | ||
|
||
} |