mirror of
https://github.com/Team4388/2026KPopRobotHunters.git
synced 2026-06-09 00:38:03 -06:00
Drive input orientation
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user