Skip to content

Commit

Permalink
Fixed autobuilder error
Browse files Browse the repository at this point in the history
  • Loading branch information
TimB-87 authored and msoucy committed Jan 18, 2025
1 parent 823c151 commit fe702e5
Showing 1 changed file with 3 additions and 21 deletions.
24 changes: 3 additions & 21 deletions src/main/java/frc/robot/subsystems/Drive.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,24 +85,6 @@ public Drive(SwerveDriveMap map, DoubleSupplier xSpeed, DoubleSupplier ySpeed, D
() -> !isBlue,
this);

// Auto Stuff!!

AutoBuilder.configure(
() -> estimator.getEstimatedPosition(), // Robot pose supplier
this::setPose, // Method to reset odometry (will be called if your auto has a
// starting pose)
this::getSpeeds, // ChassisSpeeds supplier. MUST BE ROBOT RELATIVE
(speeds, feedforwards) -> move(speeds), // Method that will drive the robot given ROBOT RELATIVE
// ChassisSpeeds. Also optionally outputs individual module
// feedforwards
new PPHolonomicDriveController(
new PIDConstants(2, 0.0, 0.05), // Translation PID constants
new PIDConstants(1, 0.0, 0.0)), // Rotation PID constants)
getMap().config, // The robot configuration
() -> !isBlue,
this // Reference to this subsystem to set requirements
);

rotationPID.enableContinuousInput(-180, 180);

this.xSpeed = xSpeed;
Expand Down Expand Up @@ -136,9 +118,9 @@ private void periodicMove(final double xSpeed, final double ySpeed,
* maxDriveSpeedMetersPerSecond * speedCoef;
double rotationSpeed = rotationInput
* maxRotationRadiansPerSecond * rotationCoef;
if (aimAtSpeaker) {
rotationSpeed = calculateRotateSpeedToTarget(this::getSpeakerTarget);
}
// if (aimAtSpeaker) {
// rotationSpeed = calculateRotateSpeedToTarget(this::getSpeakerTarget);
// }

move(translateXSpeed, translateYSpeed, rotationSpeed, isRobotCentric);
}
Expand Down

0 comments on commit fe702e5

Please sign in to comment.