Drive input orientation

This commit is contained in:
Michael Mikovsky
2026-02-14 12:49:33 -08:00
parent abc3dc6b14
commit 736d7ef823
6 changed files with 43 additions and 20 deletions
@@ -306,12 +306,33 @@ public class SwerveDrive extends SubsystemBase implements Queryable {
Rotation2d heading = new Rotation2d(leftStick.getX(), -leftStick.getY());//.r otateBy(Rotation2d.fromDegrees(90));
// if (invertRotation){
heading = heading.rotateBy(Rotation2d.fromDegrees(270));
// }
heading = heading.rotateBy(Rotation2d.fromDegrees(270));
driveFieldAngle(leftStick, heading);
}
}
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();
// Only drive forward in robot direction (no strafe)
// Translation2d forwardOnly = new Translation2d(speed, 0.0);
driveFieldAngle(leftStick, heading);
}
}