Skip to content

Commit

Permalink
first time in 5 months this code acutally builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Ani-8712 committed Aug 20, 2024
1 parent 1f5b231 commit 7760242
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,24 +60,24 @@ public Command driveVisionTeleop(
-turnSpeedFunction.getAsDouble() * maxRotationRadpS * triggerSlow;

if (mode == DriveMode.SHOOT_AT_AMP && enabeld) {
motionXComponent = autoDriveTwist2d.dx + motionXComponent *0.1;
motionXComponent = autoDriveTwist2d.dx + motionXComponent * 0.1;
motionTurnComponent = autoDriveTwist2d.dtheta + motionTurnComponent * 0.1;

var translation = new Translation2d(motionXComponent, motionYComponent);

var rotation = motionTurnComponent;
swerve.driveFieldOriented(translation.getX(), translation.getY(), rotation);
} else if (mode == DriveMode.INTAKE_IN_AUTO && enabeld) {
motionXComponent = autoDriveTwist2d.dx + 0.1 * motionXComponent;
motionYComponent = autoDriveTwist2d.dy + 0.1 * motionYComponent;
motionXComponent = autoDriveTwist2d.dx;
motionYComponent = autoDriveTwist2d.dy;

var translation = new Translation2d(motionXComponent, motionYComponent);

var rotation = motionTurnComponent;
swerve.drive(translation.getX(), translation.getY(), rotation);
} else {
if (mode != DriveMode.NONE && enabeld) {
motionTurnComponent = autoDriveTwist2d.dtheta + motionTurnComponent * 0.1;
motionTurnComponent = autoDriveTwist2d.dtheta;
}
SmartDashboard.putNumber("theta", autoDriveTwist2d.dtheta);

Expand Down
3 changes: 0 additions & 3 deletions src/main/java/team3647/frc2024/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,6 @@ private void configureButtonBindings() {
mainController.dPadDown.and(goodToClimb).whileTrue(climbCommands.goDown());
mainController.dPadDown.onFalse(climbCommands.kill());




climbing.onTrue(superstructure.setIsClimbing());
climbing.onFalse(superstructure.setIsNotClimbing());

Expand Down
41 changes: 21 additions & 20 deletions src/main/java/team3647/frc2024/subsystems/Superstructure.java
Original file line number Diff line number Diff line change
Expand Up @@ -226,25 +226,27 @@ public boolean swerveReady() {
return swerveAimed.getAsBoolean();
}

public boolean readyForShot(){
public boolean readyForShot() {
return aimedAtSpeaker() && !dontShoot.getAsBoolean();
}

public Command shoot() {
return Commands.parallel(
prep(), spinUp()
// Commands.sequence(
// // Commands.waitSeconds(2.5),
// Commands.waitUntil(
// () ->
// shooterLeft.velocityReached(30, 2)
// && pivot.angleReached(
// pivotAngleSupplier.getAsDouble(),
// 5)
// && swerveAimed.getAsBoolean())
// .withTimeout(1.2),
// feed())
).until(this::readyForShot)
prep(), spinUp()
// Commands.sequence(
// // Commands.waitSeconds(2.5),
// Commands.waitUntil(
// () ->
// shooterLeft.velocityReached(30, 2)
// && pivot.angleReached(
//
// pivotAngleSupplier.getAsDouble(),
// 5)
// && swerveAimed.getAsBoolean())
// .withTimeout(1.2),
// feed())
)
.until(this::readyForShot)
.andThen(stowFromShoot());
}

Expand Down Expand Up @@ -381,14 +383,13 @@ public Command stowFromShoot() {
.withTimeout(0.1));
}

public Command stowNoShoot(){
public Command stowNoShoot() {
return Commands.parallel(
pivotCommands.setAngle(() -> pivotAngleSupplier.getAsDouble()),
shooterCommands.kill(),
kickerCommands.kill())
.withTimeout(0.1);
pivotCommands.setAngle(() -> pivotAngleSupplier.getAsDouble()),
shooterCommands.kill(),
kickerCommands.kill())
.withTimeout(0.1);
}


public Command stowFromAmpShoot() {
return Commands.sequence(
Expand Down

0 comments on commit 7760242

Please sign in to comment.