Skip to content

Commit

Permalink
regional code
Browse files Browse the repository at this point in the history
  • Loading branch information
MorphaxTheDeveloper committed Mar 22, 2024
1 parent 59c871d commit 7a7293b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
14 changes: 10 additions & 4 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ private void configureBindings() {
//buton 1
new JoystickButton(driverJoytick, 1).whileTrue(new InstantCommand(()-> m_feeder.forward()));
new JoystickButton(driverJoytick, 1).whileFalse(new InstantCommand(()-> m_feeder.stop()));
new JoystickButton(driverJoytick, 1).whileTrue(new InstantCommand(()-> m_shooter.ShooterThrowMotorOutput(0.2)));
new JoystickButton(driverJoytick, 1).whileTrue(new InstantCommand(()-> m_shooter.ShooterThrowMotorOutput(0.5)));
new JoystickButton(driverJoytick, 1).whileFalse(new InstantCommand(()-> m_shooter.ShooterThrow1MotorStop()));
new JoystickButton(driverJoytick, 1).whileFalse(new InstantCommand(()-> m_shooter.ShooterThrow2MotorStop()));

Expand Down Expand Up @@ -372,6 +372,12 @@ public Command getAutonomousCommand(int mode) {
new Pose2d(-1.28, -0.02, new Rotation2d(0.0)),
new Pose2d(0.0, 0.0, new Rotation2d(0.0))),
trajectoryConfig);

var trajectory5 =
TrajectoryGenerator.generateTrajectory(
List.of(new Pose2d(0.0, 0.0, new Rotation2d(0.0)),
new Pose2d(-2.28, -0.02, new Rotation2d(0.0))),
trajectoryConfig);

// var trajectoryOne =
// TrajectoryGenerator.generateTrajectory(
Expand Down Expand Up @@ -546,10 +552,10 @@ else if(mode == 1){
.andThen(new AutoNoteShoot(m_shooter, m_feeder, ()-> 73)).withTimeout(8);
}
else if(mode == 0){
return new AutoNoteShoot(m_shooter, m_feeder, () -> 55).withTimeout(3);
return new AutoNoteShoot(m_shooter, m_feeder, () -> 55).withTimeout(3)
.andThen(pathCommand(trajectory5));
}



else{
return new AutoNoteShoot(m_shooter, m_feeder, () -> 64).withTimeout(2)
.andThen(pathCommand(trajectoryOne).alongWith(new pickupforAuto(m_intake, m_joystick).withTimeout(3.75))
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/frc/robot/subsystems/SwerveSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import edu.wpi.first.wpilibj.SPI;
import edu.wpi.first.wpilibj.SerialPort;
import edu.wpi.first.wpilibj.DriverStation;
import edu.wpi.first.wpilibj.I2C;
import edu.wpi.first.wpilibj.I2C.Port;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
Expand Down Expand Up @@ -61,7 +62,8 @@ public class SwerveSubsystem extends SubsystemBase {
DriveConstants.kBackRightDriveAbsoluteEncoderOffsetRad,
DriveConstants.kBackRightDriveAbsoluteEncoderReversed);

private final AHRS gyro = new AHRS(SerialPort.Port.kUSB);
private final AHRS gyro = new AHRS(SerialPort.Port.kUSB);
//private final AHRS gyro = new AHRS(I2C.Port.kOnboard);

private SwerveModule[] modules = {frontLeft, frontRight, backLeft, backRight};

Expand Down

0 comments on commit 7a7293b

Please sign in to comment.