Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 0 additions & 35 deletions src/main/java/frc/robot/commands/states/PrepCorner.java

This file was deleted.

35 changes: 0 additions & 35 deletions src/main/java/frc/robot/commands/states/PrepHub.java

This file was deleted.

This file was deleted.

35 changes: 0 additions & 35 deletions src/main/java/frc/robot/commands/states/PrepTower.java

This file was deleted.

32 changes: 0 additions & 32 deletions src/main/java/frc/robot/commands/states/PrepTrench.java

This file was deleted.

2 changes: 1 addition & 1 deletion src/main/java/frc/robot/commands/states/Shooting.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public void initialize() {
@Override
public void execute() {

RobotContainer.rotorsInstance.setFlywheelSpeeds(ConstRotors.FLYWHEEL_SHOOTING_SPEED);
RobotContainer.rotorsInstance.setFlyWheelSpeeds(ConstRotors.FLYWHEEL_SHOOTING_SPEED);
if (RobotContainer.rotorsInstance.isFlyWheelAtSpeed(ConstRotors.FLYWHEEL_SHOOTING_SPEED)) {
RobotContainer.rotorsInstance.setTransferRollersSpeeds(ConstRotors.INTAKE_TRANSFER_SPEED);
RobotContainer.rotorsInstance.setSerializerRollersPercentOutput(ConstRotors.SERIALIZER_SHOOTING_SPEED);
Expand Down
52 changes: 52 additions & 0 deletions src/main/java/frc/robot/commands/states/preps/BasePrep.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.

package frc.robot.commands.states.preps;

import edu.wpi.first.units.measure.*;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.Robot;
import frc.robot.RobotContainer;
import frc.robot.subsystems.StateMachine.RobotState;

/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class BasePrep extends Command {
AngularVelocity globalFlyWheelSpeed;
Angle globalHoodAngle;
RobotState globalState;
Comment thread
TaylerUva marked this conversation as resolved.

/** Creates a new BasePrep. */
public BasePrep(AngularVelocity flyWheelSpeed, Angle hoodAngle, RobotState state) {
addRequirements(RobotContainer.stateMachineInstance);
globalFlyWheelSpeed = flyWheelSpeed;
globalHoodAngle = hoodAngle;
globalState = state;
Comment thread
TaylerUva marked this conversation as resolved.

// Use addRequirements() here to declare subsystem dependencies.
}

// Called when the command is initially scheduled.
@Override
public void initialize() {
RobotContainer.rotorsInstance.setFlyWheelSpeeds(globalFlyWheelSpeed);
RobotContainer.motionInstance.setHoodPivotAngle(globalHoodAngle);
RobotContainer.stateMachineInstance.setRobotState(globalState);
}

// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {
}

// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
}

// Returns true when the command should end.
@Override
public boolean isFinished() {
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.

package frc.robot.commands.states;
package frc.robot.commands.states.preps;

import edu.wpi.first.wpilibj2.command.Command;

Expand All @@ -15,15 +15,18 @@ public PrepAnywhere() {

// Called when the command is initially scheduled.
@Override
public void initialize() {}
public void initialize() {
}

// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {}
public void execute() {
}

// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {}
public void end(boolean interrupted) {
}

// Returns true when the command should end.
@Override
Expand Down
20 changes: 20 additions & 0 deletions src/main/java/frc/robot/commands/states/preps/PrepCorner.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.

package frc.robot.commands.states.preps;

import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.constants.ConstMotion;
import frc.robot.constants.ConstRotors;
import frc.robot.subsystems.StateMachine.RobotState;

public class PrepCorner extends BasePrep {
/** Creates a new PrepNonOutpost. */
public PrepCorner() {
Comment thread
TaylerUva marked this conversation as resolved.
super(ConstRotors.FLYWHEEL_CORNER_SPEED, ConstMotion.HOOD_CORNER_ANGLE, RobotState.PREP_CORNER);

// Use addRequirements() here to declare subsystem dependencies.
}

}
22 changes: 22 additions & 0 deletions src/main/java/frc/robot/commands/states/preps/PrepHub.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.

package frc.robot.commands.states.preps;

import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.RobotContainer;
import frc.robot.constants.ConstMotion;
import frc.robot.constants.ConstRotors;
import frc.robot.subsystems.StateMachine.RobotState;

public class PrepHub extends BasePrep {
/** Creates a new PrepDepot. */
public PrepHub() {

super(ConstRotors.FLYWHEEL_HUB_SPEED, ConstMotion.HOOD_HUB_ANGLE, RobotState.PREP_HUB);

// setState
// Use addRequirements() here to declare subsystem dependencies.
}
Comment thread
TaylerUva marked this conversation as resolved.
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,22 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.

package frc.robot.commands.states;
package frc.robot.commands.states.preps;

import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.constants.ConstMotion;
import frc.robot.constants.ConstRotors;
import frc.robot.subsystems.StateMachine.RobotState;

/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class PrepNeautralToAlliance extends Command {
public class PrepNeutralToAlliance extends BasePrep {
/** Creates a new PrepNeautralToAlliance. */
public PrepNeautralToAlliance() {
// Use addRequirements() here to declare subsystem dependencies.
}

// Called when the command is initially scheduled.
@Override
public void initialize() {}
public PrepNeutralToAlliance() {

// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {}
super(ConstRotors.FLYWHEEL_NEUTRAL_TO_ALLIANCE_SPEED, ConstMotion.HOOD_NEUTRAL_TO_ALLIANCE_ANGLE,
RobotState.PREP_NEUTRAL_TO_ALLIANCE);

// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {}

// Returns true when the command should end.
@Override
public boolean isFinished() {
return false;
// Use addRequirements() here to declare subsystem dependencies.
}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.

package frc.robot.commands.states.preps;

import frc.robot.constants.ConstMotion;
import frc.robot.constants.ConstRotors;
import frc.robot.subsystems.StateMachine.RobotState;

/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class PrepOpponentToAlliance extends BasePrep {
/** Creates a new PrepOpponentToAlliance. */
public PrepOpponentToAlliance() {

super(ConstRotors.FLYWHEEL_OPPONENT_TO_ALLIANCE_SPEED, ConstMotion.HOOD_OPPENENT_TO_ALLIANCE_ANGLE,
RobotState.PREP_OPPONENT_TO_ALLIANCE);

// Use addRequirements() here to declare subsystem dependencies.
}

}
Loading
Loading