Skip to content

Commit

Permalink
testing changes
Browse files Browse the repository at this point in the history
  • Loading branch information
penguin212 committed Feb 1, 2024
1 parent c65fa48 commit 228908c
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 30 deletions.
14 changes: 7 additions & 7 deletions src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public static class ElevatorConstants {

public static final float EXTENSION_LIMIT_METERS = 0;

public static final int ZERO_LIMIT_ID = 0;
public static final int ZERO_LIMIT_ID = 2;

public static final int GROUND_POSITION = 0;
public static final int SPEAKER_POSITION = 0;
Expand Down Expand Up @@ -78,8 +78,8 @@ public static class IntakeConstants {
public static final int PIVOT_MOTOR_ID = 16;

public static final int sensorID = 0;
public static final int extendedlimitswitchID = 1;
public static final int retractedlimitswitchID = 2;
public static final int extendedlimitswitchID = 5;
public static final int retractedlimitswitchID = 6;
//public static final int intakeencoderID = 3;

public static final double rollersclockwise = 1;
Expand All @@ -94,11 +94,11 @@ public static class IntakeConstants {


public static class ClimbConstants {
public static final int LEFT_WINCH_MOTOR_ID = 21;
public static final int LEFT_ZERO_LIMIT_ID = 11;
public static final int LEFT_WINCH_MOTOR_ID = 10;
public static final int LEFT_ZERO_LIMIT_ID = 0;

public static final int RIGHT_WINCH_MOTOR_ID = 22;
public static final int RIGHT_ZERO_LIMIT_ID = 12;
public static final int RIGHT_WINCH_MOTOR_ID = 11;
public static final int RIGHT_ZERO_LIMIT_ID = 1;

public static final double WINCH_REDUCTION = 9.49;
public static final double AXLE_PERIMETER_METERS = 6 * Units.inchesToMeters(.289) ;
Expand Down
25 changes: 8 additions & 17 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public RobotContainer() {
//construct Test
// module = new SwerveModule(6, 7, 0);
// baseSwerveSubsystem = new TestSingleModuleSwerveSubsystem(module);
baseSwerveSubsystem = new SwerveSubsystem();
baseSwerveSubsystem = null;// new SwerveSubsystem();
intakePivotSubsystem = new IntakePivotSubsystem();
shooterFeederSubsystem = new ShooterFeederSubsystem();

Expand All @@ -88,21 +88,11 @@ public RobotContainer() {
}


private void configureBindings() {
private void configureBindings() {


elevatorSubsystem.setDefaultCommand(new InstantCommand(() -> {
if(mechController.getLeftTriggerAxis() != 0 && mechController.getRightTriggerAxis() != 0){
elevatorSubsystem.setManual();
elevatorSubsystem.setManualPower(mechController.getRightTriggerAxis()-mechController.getLeftTriggerAxis());
}
else{
elevatorSubsystem.setAuto();
}
}));

bButton.onTrue(new InstantCommand(() -> {
shooterFeederSubsystem.setFeederMotorSpeed(.7);
shooterFeederSubsystem.setFeederMotorSpeed(.4);
}));

bButton.onFalse(new InstantCommand(() -> {
Expand Down Expand Up @@ -132,13 +122,15 @@ private void configureBindings() {

intakeRollerSubsystem.setDefaultCommand(new InstantCommand(() -> {
if(mechController.getPOV() == 90){
intakeRollerSubsystem.setAllRollSpeed(.3, .3);
intakeRollerSubsystem.setAllRollSpeed(1, .8);
} else if (mechController.getPOV() == 270){
intakeRollerSubsystem.setAllRollSpeed(-.3, -.3);
intakeRollerSubsystem.setAllRollSpeed(-.8, -.5);
} else {
intakeRollerSubsystem.setAllRollSpeed(0, 0);
}
}));
}, intakeRollerSubsystem));





Expand Down Expand Up @@ -189,7 +181,6 @@ private void configureBindings() {
}));

}


}

Expand Down
20 changes: 20 additions & 0 deletions src/main/java/frc/robot/commands/ShootModeCommand.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package frc.robot.commands;

import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
import frc.robot.commands.intake.pivot.IntakePivotVerticalCommand;
import frc.robot.commands.shooter.feed.ShooterFeedShootCommand;
import frc.robot.commands.shooter.flywheel.ShooterFlywheelReadyCommand;
import frc.robot.subsystems.intake.IntakePivotSubsystem;
import frc.robot.subsystems.shooter.ShooterFeederSubsystem;
import frc.robot.subsystems.shooter.ShooterFlywheelSubsystem;

public class ShootModeCommand extends SequentialCommandGroup {
IntakePivotSubsystem intakePivotSubsystem;
ShooterFlywheelSubsystem shooterFlywheelSubsystem;
ShooterFeederSubsystem shooterFeederSubsystem;

public ShootModeCommand(){
addCommands(new IntakePivotVerticalCommand(intakePivotSubsystem).alongWith(new ShooterFlywheelReadyCommand(shooterFlywheelSubsystem)),
new ShooterFeedShootCommand(shooterFeederSubsystem));
}
}
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/subsystems/climb/ClimbArm.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public ClimbArm(int WINCH_MOTOR_ID, int ZERO_LIMIT_ID) {
sparkMax.enableSoftLimit(SoftLimitDirection.kReverse, true);
});

zeroLimitSwitch = new DigitalInput(LEFT_ZERO_LIMIT_ID);
zeroLimitSwitch = new DigitalInput(ZERO_LIMIT_ID);
}

public void update() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class IntakeRollersSubsystem extends SubsystemBase {
public IntakeRollersSubsystem() {
integrationMotor = new TalonSRX(INTEGRATION_MOTOR_ID);
frontMotor = new TalonSRX(FRONT_MOTOR_ID);
frontMotor.setInverted(true);
backMotor = new TalonSRX(BACK_MOTOR_ID);
sensor = new AnalogPotentiometer(sensorID);
}
Expand All @@ -44,8 +45,8 @@ public void setRollSpeed(double top, double bottom){

public void setAllRollSpeed(double topone, double bottomone){
frontMotor.set(TalonSRXControlMode.PercentOutput, topone);
integrationMotor.set(TalonSRXControlMode.PercentOutput, topone);
backMotor.set(TalonSRXControlMode.PercentOutput, bottomone);
integrationMotor.set(TalonSRXControlMode.PercentOutput, bottomone);
backMotor.set(TalonSRXControlMode.PercentOutput, topone);
}

public void setRollersOutwards(Boolean pressedA){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ public class ShooterFeederSubsystem extends SubsystemBase{

public ShooterFeederSubsystem(){
//motors
feederMotor = new TalonSRX(10);
feederMotor = new TalonSRX(15);

feederMotor.setInverted(true);

//sensors
shooterSensor = new ColorSensorV3(I2C.Port.kMXP);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class ShooterPivotSubsystem extends SubsystemBase {
public final double PIVOT_SPEED = 0.1;
final double GEARBOX_RATIO = 18.16; //ask cadders
public final int ERRORTOLERANCE = 5; //error tolerance for pid
final int LIMIT_SWITCH_ID = 1; //placeholder
final int LIMIT_SWITCH_ID = 3; //placeholder
final double CONVERSION_FACTOR = Math.PI/(2*4.57);

//motors
Expand Down Expand Up @@ -142,7 +142,7 @@ public void periodic(){
setAngle(getAutoAimAngle(getDistance()));
}

printCurrentAngle();
// printCurrentAngle();

// System.out.println("current pos" + rotationEncoder.getPosition());

Expand Down

0 comments on commit 228908c

Please sign in to comment.