Merge branch 'DrivingTryouts' of https://github.com/Team4388/2026KPopRobotHunters into DrivingTryouts

This commit is contained in:
SHikhar
2026-02-25 17:14:17 -07:00
2 changed files with 32 additions and 7 deletions
@@ -275,6 +275,31 @@ public class SwerveDrive extends SubsystemBase implements Queryable {
io.setControl(ctrl);
}
public void driveIntakeOrientation(Translation2d leftStick, Translation2d rightStick){
// if (invert){
// Translation2d stick = new Translation2d(-leftStick.getX(), -leftStick.getY());
// driveFieldAngle(stick, heading);
// } else{
// driveFieldAngle(leftStick, heading);
// }
double speed = rightStick.getNorm();
if(speed < 0.3) {
driveWithInput(leftStick, new Translation2d(), true);
} else {
Rotation2d heading = new Rotation2d(rightStick.getX(), rightStick.getY());//.r otateBy(Rotation2d.fromDegrees(90));
heading = heading.rotateBy(Rotation2d.fromDegrees(90));
rotTarget = heading.getDegrees();
driveFieldAngle(leftStick, heading);
}
}
public void driveFieldAngle(Translation2d leftStick, Rotation2d heading) {
if (leftStick.getNorm() < 0.05) // if no imput and the swerve drive is still going:
stopModules(); // stop the swerve