This repository has been archived by the owner on Nov 10, 2024. It is now read-only.
-
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
1 parent
8315c6d
commit 42425d9
Showing
15 changed files
with
355 additions
and
258 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,19 +1,78 @@ | ||
// 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; | ||
|
||
/** | ||
* The Constants class provides a convenient place for teams to hold robot-wide numerical or boolean | ||
* constants. This class should not be used for any other purpose. All constants should be declared | ||
* globally (i.e. public static). Do not put anything functional in this class. | ||
* | ||
* <p>It is advised to statically import this class (or one of its inner classes) wherever the | ||
* constants are needed, to reduce verbosity. | ||
*/ | ||
public final class Constants { | ||
public static class OperatorConstants { | ||
public static final int kDriverControllerPort = 0; | ||
|
||
public static class ports { | ||
public static final int intake_motor_1 = 0; | ||
public static final int intake_motor_2 = 0; | ||
public static final int shooter_motor_1 = 0; | ||
public static final int shooter_motor_2 = 0; | ||
|
||
} | ||
|
||
public static class controller { | ||
public static final int controller = 0; | ||
} | ||
|
||
/* | ||
___ __ _ _ _ _____ _ _ | ||
/ __|___ _ _ / _(_)__ _ _ _ _ _ __ _| |_(_)___ _ _ |_ _|_ _| |__| |___ | ||
| (__/ _ \ ' \| _| / _` | || | '_/ _` | _| / _ \ ' \ | |/ _` | '_ \ / -_) | ||
\___\___/_||_|_| |_\__, |\_,_|_| \__,_|\__|_\___/_||_| |_|\__,_|_.__/_\___| | ||
|___/ | ||
*/ | ||
|
||
public static class values { | ||
|
||
public static class intake { | ||
public static final double GetNoteValue = 1; | ||
public static final double PidIntakeTolerance = 5; | ||
public static final double PidIntakeKP = 1; | ||
public static final double PidIntakeKI = 0; | ||
public static final double PidIntakeKD = 0; | ||
} | ||
|
||
|
||
|
||
public static class shooter { | ||
public static final double AngleMotorOpenLoopRampRate = 0.5; | ||
public static final double PidShooterAngleTolerance = 5; | ||
public static final double PidShooterAngleKP = 1; | ||
public static final double PidShooterAngleKI = 0; | ||
public static final double PidShooterAngleKD = 0; | ||
|
||
public static final double PidShooterShootKP = 1; | ||
public static final double PidShooterShootKI = 0; | ||
public static final double PidShooterShootKD = 0; | ||
public static final double PidShooterRPMTolerance = 5; | ||
|
||
} | ||
|
||
|
||
public static class positions { | ||
|
||
public static final double FeedingPositionIntake = 1; | ||
public static final double FeedingPositionShooter = 1; | ||
|
||
} | ||
|
||
|
||
|
||
|
||
public static class feeder { | ||
|
||
public static final double FeederForwardSpeed = 0.7; | ||
public static final double FeederBackwardSpeed = -0.7; | ||
|
||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
} | ||
|
||
} |
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
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 |
---|---|---|
@@ -1,63 +1,27 @@ | ||
// 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; | ||
|
||
import frc.robot.Constants.OperatorConstants; | ||
import frc.robot.commands.Autos; | ||
import frc.robot.commands.ExampleCommand; | ||
import frc.robot.subsystems.ExampleSubsystem; | ||
import edu.wpi.first.wpilibj.DriverStation; | ||
import edu.wpi.first.wpilibj.Joystick; | ||
import edu.wpi.first.wpilibj.XboxController; | ||
import edu.wpi.first.wpilibj2.command.Command; | ||
import edu.wpi.first.wpilibj2.command.button.CommandXboxController; | ||
import edu.wpi.first.wpilibj2.command.button.Trigger; | ||
|
||
/** | ||
* This class is where the bulk of the robot should be declared. Since Command-based is a | ||
* "declarative" paradigm, very little robot logic should actually be handled in the {@link Robot} | ||
* periodic methods (other than the scheduler calls). Instead, the structure of the robot (including | ||
* subsystems, commands, and trigger mappings) should be declared here. | ||
*/ | ||
public class RobotContainer { | ||
// The robot's subsystems and commands are defined here... | ||
private final ExampleSubsystem m_exampleSubsystem = new ExampleSubsystem(); | ||
import frc.robot.Constants.controller; | ||
|
||
// Replace with CommandPS4Controller or CommandJoystick if needed | ||
private final CommandXboxController m_driverController = | ||
new CommandXboxController(OperatorConstants.kDriverControllerPort); | ||
public class RobotContainer { | ||
XboxController controller = new XboxController(Constants.controller.controller); | ||
|
||
|
||
/** The container for the robot. Contains subsystems, OI devices, and commands. */ | ||
public RobotContainer() { | ||
// Configure the trigger bindings | ||
|
||
configureBindings(); | ||
|
||
} | ||
|
||
/** | ||
* Use this method to define your trigger->command mappings. Triggers can be created via the | ||
* {@link Trigger#Trigger(java.util.function.BooleanSupplier)} constructor with an arbitrary | ||
* predicate, or via the named factories in {@link | ||
* edu.wpi.first.wpilibj2.command.button.CommandGenericHID}'s subclasses for {@link | ||
* CommandXboxController Xbox}/{@link edu.wpi.first.wpilibj2.command.button.CommandPS4Controller | ||
* PS4} controllers or {@link edu.wpi.first.wpilibj2.command.button.CommandJoystick Flight | ||
* joysticks}. | ||
*/ | ||
|
||
private void configureBindings() { | ||
// Schedule `ExampleCommand` when `exampleCondition` changes to `true` | ||
new Trigger(m_exampleSubsystem::exampleCondition) | ||
.onTrue(new ExampleCommand(m_exampleSubsystem)); | ||
|
||
// Schedule `exampleMethodCommand` when the Xbox controller's B button is pressed, | ||
// cancelling on release. | ||
m_driverController.b().whileTrue(m_exampleSubsystem.exampleMethodCommand()); | ||
} | ||
|
||
/** | ||
* Use this to pass the autonomous command to the main {@link Robot} class. | ||
* | ||
* @return the command to run in autonomous | ||
*/ | ||
|
||
public Command getAutonomousCommand() { | ||
// An example command will be run in autonomous | ||
return Autos.exampleAuto(m_exampleSubsystem); | ||
return null; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
28 changes: 15 additions & 13 deletions
28
src/main/java/frc/robot/commands/Intake/PidIntakeCommand.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
Oops, something went wrong.