-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
399 additions
and
15 deletions.
There are no files selected for viewing
60 changes: 60 additions & 0 deletions
60
Big-Bad-Wolf-2025/src/main/java/frc/robot/commands/ElevatorDown.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// 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; | ||
|
||
import edu.wpi.first.wpilibj2.command.Command; | ||
import frc.robot.constants.ElevatorConstants; | ||
import frc.robot.constants.Global; | ||
import frc.robot.subsystems.Elevator; | ||
|
||
/* 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 ElevatorDown extends Command | ||
{ | ||
private final Elevator m_Elevator; | ||
/** | ||
* Creates a new ElevatorDown. | ||
*/ | ||
public ElevatorDown(Elevator p_Elevator) | ||
{ | ||
this.m_Elevator = p_Elevator; | ||
addRequirements(this.m_Elevator); | ||
} | ||
|
||
/** | ||
* Called when the command is initially scheduled. | ||
*/ | ||
@Override | ||
public void initialize() | ||
{ | ||
m_Elevator.elevatorRequest(Global.MODE.VOLTAGE, ElevatorConstants.ELEVATOR_DOWN_VOLTAGE);// Applies negative voltage | ||
} | ||
|
||
/** | ||
* Called every time the scheduler runs while the command is scheduled. | ||
*/ | ||
@Override | ||
public void execute() | ||
{ | ||
// intentionally empty | ||
} | ||
|
||
/** | ||
* Called once the command ends or is interrupted. | ||
*/ | ||
@Override | ||
public void end(boolean interrupted) | ||
{ | ||
m_Elevator.elevatorRequest(Global.MODE.VOLTAGE, 0);// Shuts off voltage | ||
} | ||
|
||
/** | ||
* Returns true when the command should end. | ||
*/ | ||
@Override | ||
public boolean isFinished() | ||
{ | ||
return false; | ||
} | ||
} |
61 changes: 61 additions & 0 deletions
61
Big-Bad-Wolf-2025/src/main/java/frc/robot/commands/ElevatorGoHome.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
|
||
// 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; | ||
|
||
import edu.wpi.first.wpilibj2.command.Command; | ||
import frc.robot.constants.ElevatorConstants; | ||
import frc.robot.constants.Global; | ||
import frc.robot.subsystems.Elevator; | ||
|
||
/* 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 ElevatorGoHome extends Command | ||
{ | ||
private final Elevator m_Elevator; | ||
/** | ||
* Creates a new ElevatorGoHome. | ||
*/ | ||
public ElevatorGoHome(Elevator p_Elevator) | ||
{ | ||
this.m_Elevator = p_Elevator; | ||
addRequirements(this.m_Elevator); | ||
} | ||
|
||
/** | ||
* Called when the command is initially scheduled. | ||
*/ | ||
@Override | ||
public void initialize() | ||
{ | ||
m_Elevator.elevatorRequest(Global.MODE.POSITION, ElevatorConstants.ELEVATOR_ZERO_POSITION);// Will set elevator to the home position | ||
} | ||
|
||
/** | ||
* Called every time the scheduler runs while the command is scheduled. | ||
*/ | ||
@Override | ||
public void execute() | ||
{ | ||
//intentionally empty | ||
} | ||
|
||
/** | ||
* Called once the command ends or is interrupted. | ||
*/ | ||
@Override | ||
public void end(boolean interrupted) | ||
{ | ||
m_Elevator.elevatorRequest(Global.MODE.VOLTAGE, 0);// Once command ends shuts off motor voltage | ||
} | ||
|
||
/** | ||
* Returns true when the command should end. | ||
*/ | ||
@Override | ||
public boolean isFinished() | ||
{ | ||
return false; | ||
} | ||
} |
60 changes: 60 additions & 0 deletions
60
Big-Bad-Wolf-2025/src/main/java/frc/robot/commands/ElevatorLevelFour.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// 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; | ||
|
||
import edu.wpi.first.wpilibj2.command.Command; | ||
import frc.robot.constants.ElevatorConstants; | ||
import frc.robot.constants.Global; | ||
import frc.robot.subsystems.Elevator; | ||
|
||
/* 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 ElevatorLevelFour extends Command | ||
{ | ||
private final Elevator m_Elevator; | ||
/** | ||
* Creates a new ElevatorLevelFour. | ||
*/ | ||
public ElevatorLevelFour(Elevator p_Elevator) | ||
{ | ||
this.m_Elevator = p_Elevator; | ||
addRequirements(this.m_Elevator); | ||
} | ||
|
||
/** | ||
* Called when the command is initially scheduled. | ||
*/ | ||
@Override | ||
public void initialize() | ||
{ | ||
m_Elevator.elevatorRequest(Global.MODE.POSITION, ElevatorConstants.ELEVATOR_LEVEL_FOUR);// Sets elevator to Level 4 | ||
} | ||
|
||
/** | ||
* Called every time the scheduler runs while the command is scheduled. | ||
*/ | ||
@Override | ||
public void execute() | ||
{ | ||
// Intentionally empty | ||
} | ||
|
||
/** | ||
* Called once the command ends or is interrupted. | ||
*/ | ||
@Override | ||
public void end(boolean interrupted) | ||
{ | ||
m_Elevator.elevatorRequest(Global.MODE.VOLTAGE, 0);// Once command ends shuts off motor voltage | ||
} | ||
|
||
/** | ||
* Returns true when the command should end. | ||
*/ | ||
@Override | ||
public boolean isFinished() | ||
{ | ||
return false; | ||
} | ||
} |
60 changes: 60 additions & 0 deletions
60
Big-Bad-Wolf-2025/src/main/java/frc/robot/commands/ElevatorLevelThree.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// 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; | ||
|
||
import edu.wpi.first.wpilibj2.command.Command; | ||
import frc.robot.constants.ElevatorConstants; | ||
import frc.robot.constants.Global; | ||
import frc.robot.subsystems.Elevator; | ||
|
||
/* 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 ElevatorLevelThree extends Command | ||
{ | ||
private final Elevator m_Elevator; | ||
/** | ||
* Creates a new ElevatorLevelThree. | ||
*/ | ||
public ElevatorLevelThree(Elevator p_Elevator) | ||
{ | ||
this.m_Elevator = p_Elevator; | ||
addRequirements(this.m_Elevator); | ||
} | ||
|
||
/** | ||
* Called when the command is initially scheduled. | ||
*/ | ||
@Override | ||
public void initialize() | ||
{ | ||
m_Elevator.elevatorRequest(Global.MODE.POSITION, ElevatorConstants.ELEVATOR_LEVEL_THREE);// Sets elevator to Level 3 | ||
} | ||
|
||
/** | ||
* Called every time the scheduler runs while the command is scheduled. | ||
*/ | ||
@Override | ||
public void execute() | ||
{ | ||
// Intentionally empty | ||
} | ||
|
||
/** | ||
* Called once the command ends or is interrupted. | ||
*/ | ||
@Override | ||
public void end(boolean interrupted) | ||
{ | ||
m_Elevator.elevatorRequest(Global.MODE.VOLTAGE, 0);// Once command ends shuts off motor voltage | ||
} | ||
|
||
/** | ||
* Returns true when the command should end. | ||
*/ | ||
@Override | ||
public boolean isFinished() | ||
{ | ||
return false; | ||
} | ||
} |
60 changes: 60 additions & 0 deletions
60
Big-Bad-Wolf-2025/src/main/java/frc/robot/commands/ElevatorLevelTwo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// 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; | ||
|
||
import edu.wpi.first.wpilibj2.command.Command; | ||
import frc.robot.constants.ElevatorConstants; | ||
import frc.robot.constants.Global; | ||
import frc.robot.subsystems.Elevator; | ||
|
||
/* 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 ElevatorLevelTwo extends Command | ||
{ | ||
private final Elevator m_Elevator; | ||
/** | ||
* Creates a new ElevatorLevelTwo. | ||
*/ | ||
public ElevatorLevelTwo(Elevator p_Elevator) | ||
{ | ||
this.m_Elevator = p_Elevator; | ||
addRequirements(this.m_Elevator); | ||
} | ||
|
||
/** | ||
* Called when the command is initially scheduled. | ||
*/ | ||
@Override | ||
public void initialize() | ||
{ | ||
m_Elevator.elevatorRequest(Global.MODE.POSITION, ElevatorConstants.ELEVATOR_LEVEL_TWO);// Sets elevator to Level 2 | ||
} | ||
|
||
/** | ||
* Called every time the scheduler runs while the command is scheduled. | ||
*/ | ||
@Override | ||
public void execute() | ||
{ | ||
// Intentionally empty | ||
} | ||
|
||
/** | ||
* Called once the command ends or is interrupted. | ||
*/ | ||
@Override | ||
public void end(boolean interrupted) | ||
{ | ||
m_Elevator.elevatorRequest(Global.MODE.VOLTAGE, 0);// Once command ends shuts off motor voltage | ||
} | ||
|
||
/** | ||
* Returns true when the command should end. | ||
*/ | ||
@Override | ||
public boolean isFinished() | ||
{ | ||
return false; | ||
} | ||
} |
60 changes: 60 additions & 0 deletions
60
Big-Bad-Wolf-2025/src/main/java/frc/robot/commands/ElevatorUp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// 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; | ||
|
||
import edu.wpi.first.wpilibj2.command.Command; | ||
import frc.robot.constants.ElevatorConstants; | ||
import frc.robot.constants.Global; | ||
import frc.robot.subsystems.Elevator; | ||
|
||
/* 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 ElevatorUp extends Command | ||
{ | ||
private final Elevator m_Elevator; | ||
/** | ||
* Creates a new ElevatorUp. | ||
*/ | ||
public ElevatorUp(Elevator p_Elevator) | ||
{ | ||
this.m_Elevator = p_Elevator; | ||
addRequirements(this.m_Elevator); | ||
} | ||
|
||
/** | ||
* Called when the command is initially scheduled. | ||
*/ | ||
@Override | ||
public void initialize() | ||
{ | ||
m_Elevator.elevatorRequest(Global.MODE.VOLTAGE, ElevatorConstants.ELEVATOR_UP_VOLTAGE);// Applies voltage for elevator to go up | ||
} | ||
|
||
/** | ||
* Called every time the scheduler runs while the command is scheduled. | ||
*/ | ||
@Override | ||
public void execute() | ||
{ | ||
// Intentionally empty | ||
} | ||
|
||
/** | ||
* Called once the command ends or is interrupted. | ||
*/ | ||
@Override | ||
public void end(boolean interrupted) | ||
{ | ||
m_Elevator.elevatorRequest(Global.MODE.VOLTAGE, 0);// Once command ends shuts off motor voltage | ||
} | ||
|
||
/** | ||
* Returns true when the command should end. | ||
*/ | ||
@Override | ||
public boolean isFinished() | ||
{ | ||
return false; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
Big-Bad-Wolf-2025/src/main/java/frc/robot/constants/ElevatorConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// 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.constants; | ||
|
||
/** Add your docs here. */ | ||
public class ElevatorConstants | ||
{ | ||
//All values are filler values and units until further testing | ||
public static final double ELEVATOR_ZERO_POSITION = 0; | ||
public static final double ELEVATOR_LEVEL_TWO = 10; | ||
public static final double ELEVATOR_LEVEL_THREE = 20; | ||
public static final double ELEVATOR_LEVEL_FOUR = 30; | ||
|
||
public static final double ELEVATOR_UP_VOLTAGE = 4; | ||
public static final double ELEVATOR_DOWN_VOLTAGE = -4; | ||
} |
Oops, something went wrong.