Skip to content

Commit

Permalink
Merge branch 'led'
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahSimon8 committed Feb 10, 2025
2 parents 7064b14 + 2602c4c commit f698be0
Show file tree
Hide file tree
Showing 23 changed files with 656 additions and 11 deletions.
Empty file modified Team-3749-2025/gradlew
100644 → 100755
Empty file.
1 change: 0 additions & 1 deletion Team-3749-2025/simgui-ds.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@
],
"robotJoysticks": [
{

"guid": "Keyboard0"
}
]
Expand Down
19 changes: 19 additions & 0 deletions Team-3749-2025/src/main/java/frc/robot/BuildConstants.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package frc.robot;

/**
* Automatically generated file containing build version information.
*/
public final class BuildConstants {
public static final String MAVEN_GROUP = "";
public static final String MAVEN_NAME = "Team-3749-2025";
public static final String VERSION = "unspecified";
public static final int GIT_REVISION = 160;
public static final String GIT_SHA = "036d8e339f0832bf1e0a3fe05cee0f4b0c16d30f";
public static final String GIT_DATE = "2025-01-25 01:05:41 GMT";
public static final String GIT_BRANCH = "advantage_kit";
public static final String BUILD_DATE = "2025-01-25 01:13:53 GMT";
public static final long BUILD_UNIX_TIME = 1737767633951L;
public static final int DIRTY = 0;

private BuildConstants(){}
}
4 changes: 2 additions & 2 deletions Team-3749-2025/src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.CommandScheduler;
import frc.robot.subsystems.elevator.Elevator;

import frc.robot.subsystems.led.LED;
import frc.robot.subsystems.arm.climb.ClimbArm;
import frc.robot.subsystems.arm.coral.CoralArm;

Expand All @@ -33,13 +33,13 @@ public class Robot extends TimedRobot {
public static CoralArm coralArm = new CoralArm();
public static ClimbArm climbArm = new ClimbArm();

public static LED leds = new LED(1);

private RobotContainer m_robotContainer;

@Override
public void robotInit() {
m_robotContainer = new RobotContainer();

}

@Override
Expand Down
48 changes: 48 additions & 0 deletions Team-3749-2025/src/main/java/frc/robot/buttons/JoystickIO.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,26 @@
import edu.wpi.first.wpilibj2.command.button.JoystickButton;
import frc.robot.Robot;

<<<<<<< HEAD:Team-3749-2025/src/main/java/frc/robot/buttons/JoystickIO.java
=======
import frc.robot.commands.integration.Handoff;
import frc.robot.commands.integration.IntakeFloor;
import frc.robot.commands.integration.IntakeSource;
import frc.robot.commands.integration.KnockAlgae;
import frc.robot.commands.integration.OuttakeCoral;
import frc.robot.commands.integration.ScoreL1;
import frc.robot.commands.integration.ScoreL234;
import frc.robot.commands.roller.MaintainCommand;
import frc.robot.commands.roller.RunCommand;
import frc.robot.commands.roller.StopCommand;
>>>>>>> led:Team-3749-2025/src/main/java/frc/robot/utils/JoystickIO.java

import frc.robot.commands.swerve.SwerveDefaultCommand;
<<<<<<< HEAD:Team-3749-2025/src/main/java/frc/robot/buttons/JoystickIO.java
=======
import frc.robot.subsystems.arm.coral.CoralArmConstants.ArmStates;
import frc.robot.subsystems.elevator.ElevatorConstants.ElevatorStates;
>>>>>>> led:Team-3749-2025/src/main/java/frc/robot/utils/JoystickIO.java

/**
* Util class for button bindings
Expand All @@ -22,7 +40,29 @@ public class JoystickIO {

private static final CommandXboxController pilot = new CommandXboxController(0);
private static final CommandXboxController operator = new CommandXboxController(1);
<<<<<<< HEAD:Team-3749-2025/src/main/java/frc/robot/buttons/JoystickIO.java
private static final ButtonBoard buttonBoard = new ButtonBoard();
=======
private static final Command DriveStraight = new DriveStraight();
private static final Command MaintainCommand = new MaintainCommand();
private static final Command RunCommand = new RunCommand();
private static final Command StopCommand = new StopCommand();


private static final SetElevatorState l1 = new SetElevatorState(ElevatorStates.L1);
private static final SetElevatorState l2 = new SetElevatorState(ElevatorStates.L2);
private static final SetElevatorState l3 = new SetElevatorState(ElevatorStates.L3);
private static final SetElevatorState l4 = new SetElevatorState(ElevatorStates.L4);
private static final SetElevatorState stow = new SetElevatorState(ElevatorStates.STOW);

private static final KnockAlgae knockAlgae = new KnockAlgae(Robot.elevator, Robot.algaeRoller, ElevatorStates.L2);
private static final Handoff handoff = new Handoff(Robot.chute, Robot.coralArm, Robot.elevator, Robot.coralRoller);
private static final IntakeFloor intakeFloor = new IntakeFloor(Robot.coralArm, Robot.coralRoller);
private static final IntakeSource intakeSource = new IntakeSource(Robot.scoringRoller, Robot.elevator, Robot.chute);
private static final OuttakeCoral outtakeCoral = new OuttakeCoral(Robot.coralArm, Robot.coralRoller);
private static final ScoreL1 scoreL1 = new ScoreL1(Robot.coralArm, Robot.coralRoller, ArmStates.L1);
private static final ScoreL234 scoreL234 = new ScoreL234 (Robot.chute, Robot.coralArm, Robot.elevator, Robot.coralRoller, Robot.scoringRoller, ElevatorStates.L4);
>>>>>>> led:Team-3749-2025/src/main/java/frc/robot/utils/JoystickIO.java

public JoystickIO() {
}
Expand Down Expand Up @@ -63,6 +103,7 @@ public static void pilotAndOperatorBindings() {
buttonBoard.buttonl3.onTrue(Commands.runOnce(() -> System.out.println("3, 1")));
buttonBoard.buttonl4.onTrue(Commands.runOnce(() -> System.out.println("3, 2")));

<<<<<<< HEAD:Team-3749-2025/src/main/java/frc/robot/buttons/JoystickIO.java
buttonBoard.buttonRightSource.onTrue(Commands.runOnce(() -> System.out.println("1, 4")));
buttonBoard.buttonLeftSource.onTrue(Commands.runOnce(() -> System.out.println("1, 7")));

Expand All @@ -85,6 +126,13 @@ public static void pilotAndOperatorBindings() {
buttonBoard.buttonPlayer1Start.onTrue(Commands.runOnce(() -> System.out.println("1, 8")));


=======
operator.a().onTrue(handoff);
operator.b().onTrue(scoreL1);
operator.x().onTrue(intakeFloor);
operator.y().onTrue(outtakeCoral);

>>>>>>> led:Team-3749-2025/src/main/java/frc/robot/utils/JoystickIO.java
}

public static void pilotBindings() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package frc.robot.commands.integration;

import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.arm.coral.CoralArm;
import frc.robot.subsystems.chute.Chute;
import frc.robot.subsystems.elevator.Elevator;
import frc.robot.subsystems.elevator.ElevatorConstants;
import frc.robot.subsystems.elevator.ElevatorConstants.ElevatorStates;
import frc.robot.subsystems.roller.RollerConstants;
import frc.robot.subsystems.arm.coral.CoralArmConstants;
import frc.robot.subsystems.roller.Roller;

/*
* Handoff command for coral intake to chute
*
* @author Dhyan Soni
*/

public class Handoff extends Command {
private final Chute chute;
private final CoralArm coralArm;
private final Elevator elevator;
private final Roller coralRoller;

public Handoff(Chute chute, CoralArm coralArm, Elevator elevator, Roller coralRoller) {
this.chute = chute;
this.coralArm = coralArm;
this.elevator = elevator;
this.coralRoller = coralRoller;
}

@Override
public void initialize() {
coralArm.setState(CoralArmConstants.ArmStates.HAND_OFF);
coralRoller.setState(RollerConstants.RollerStates.MAINTAIN);
}

@Override
public void execute() {
if (coralArm.getState() == CoralArmConstants.ArmStates.HAND_OFF && coralArm.getIsStableState()){
elevator.setState(ElevatorConstants.ElevatorStates.STOW);
}
if (elevator.getState() == ElevatorStates.STOW){ // might need to edit elevator.getIsStableState()
coralRoller.setState(RollerConstants.RollerStates.SCORE); // reverse spinning
}
}

@Override
public void end(boolean interrupted) {
coralArm.setState(CoralArmConstants.ArmStates.STOPPED);
coralRoller.setState(RollerConstants.RollerStates.STOP);
}

@Override
public boolean isFinished() {
return chute.hasPiece();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package frc.robot.commands.integration;

import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.arm.coral.CoralArm;
import frc.robot.subsystems.roller.RollerConstants;
import frc.robot.subsystems.arm.coral.CoralArmConstants;
import frc.robot.subsystems.roller.Roller;

public class IntakeFloor extends Command {
private final CoralArm coralArm;
private final Roller coralRoller;

public IntakeFloor(CoralArm coralArm, Roller coralRoller) {
this.coralArm = coralArm;
this.coralRoller = coralRoller;
}

@Override
public void initialize() {
coralArm.setState(CoralArmConstants.ArmStates.CORAL_PICKUP);
}

@Override
public void execute() {
coralRoller.setState(RollerConstants.RollerStates.RUN);
}

@Override
public void end(boolean interrupted) {
coralArm.setState(CoralArmConstants.ArmStates.STOPPED);
coralRoller.setState(RollerConstants.RollerStates.MAINTAIN);
}

@Override
public boolean isFinished() {
if (coralArm.hasPiece()){
return true;
}
return false;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package frc.robot.commands.integration;

import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.chute.Chute;
import frc.robot.subsystems.elevator.Elevator;
import frc.robot.subsystems.elevator.ElevatorConstants.ElevatorStates;
import frc.robot.subsystems.roller.Roller;
import frc.robot.subsystems.roller.RollerConstants;

public class IntakeSource extends Command {
private final Roller scoringRoller;
private final Elevator elevator;
private final Chute chute;

public IntakeSource(Roller scoringRoller, Elevator elevator, Chute chute) {
this.scoringRoller = scoringRoller;
this.elevator = elevator;
this.chute = chute;
}

@Override
public void initialize() {
elevator.setState(ElevatorStates.SOURCE);
scoringRoller.setState(RollerConstants.RollerStates.MAINTAIN);
}

@Override
public void execute() {
if (elevator.getState() == ElevatorStates.SOURCE && elevator.getIsStableState()) {
scoringRoller.setState(RollerConstants.RollerStates.RUN);
}
}

@Override
public void end(boolean interrupted) {
scoringRoller.setState(RollerConstants.RollerStates.STOP);
}

@Override
public boolean isFinished() {
if (scoringRoller.hasPiece()) {
return true;
}
return false;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package frc.robot.commands.integration;

import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.elevator.Elevator;
import frc.robot.subsystems.elevator.ElevatorConstants.ElevatorStates;
import frc.robot.subsystems.roller.Roller;
import frc.robot.subsystems.roller.RollerConstants;

public class KnockAlgae extends Command {
private final Elevator elevator;
private final Roller algaeRoller;
private final ElevatorStates state;

public KnockAlgae(Elevator elevator, Roller algaeRoller, ElevatorStates state) {
this.elevator = elevator;
this.algaeRoller = algaeRoller;
this.state = state;
}

@Override
public void initialize() {
algaeRoller.setState(RollerConstants.RollerStates.MAINTAIN);
}

@Override
public void execute() {
algaeRoller.setState(RollerConstants.RollerStates.RUN);
elevator.setState(state);
System.out.println(elevator.getState());
}

@Override
public void end(boolean interrupted) {
elevator.setState(ElevatorStates.STOW);
algaeRoller.setState(RollerConstants.RollerStates.STOP);
}

@Override
public boolean isFinished() {
if (elevator.getState() == state && elevator.getIsStableState()) {
return true;
}
return false; // change later to isAlgaeRemoved()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package frc.robot.commands.integration;

import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.arm.coral.CoralArm;
import frc.robot.subsystems.roller.RollerConstants;
import frc.robot.subsystems.roller.Roller;

public class OuttakeCoral extends Command {
private final CoralArm coralArm;
private final Roller coralRoller;

public OuttakeCoral(CoralArm coralArm, Roller coralRoller) {
this.coralArm = coralArm;
this.coralRoller = coralRoller;
}

@Override
public void initialize() {
coralRoller.setState(RollerConstants.RollerStates.SCORE);
}

@Override
public void execute() {
}

@Override
public void end(boolean interrupted) {
coralRoller.setState(RollerConstants.RollerStates.STOP);
}

@Override
public boolean isFinished() {
return !coralArm.hasPiece();
}
}
Loading

0 comments on commit f698be0

Please sign in to comment.