Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
bafb8ce
LEDs Run Animation ( 1 / 21 / 26 )
GhostR406 Jan 21, 2026
cfa4151
Merge branch 'main' into R2-73-implement-run-animation
rhit-halseysh Jan 22, 2026
d783db1
WIP 1/22/26 Instantiate Hopper Subsystem and Command!
GhostR406 Jan 23, 2026
13d728d
Added shooter constant for aiming
shlap Jan 29, 2026
ed7aafc
Mapped 'setGoal' and instantiated the hopper subsystem in RobotContai…
GhostR406 Jan 29, 2026
f3099a2
Created rough outline for calculating shooter angle
shlap Jan 29, 2026
8377215
Comments + Clean up + hood + logic
shlap Jan 30, 2026
0a42323
1/29/26 Fixed runAnimation type errors!
GhostR406 Jan 30, 2026
1c86d1c
Did the same thing as the other one
shlap Jan 30, 2026
06fb346
1/29/26 Fixed small issues
GhostR406 Jan 30, 2026
ef8c320
Merge branch 'main' into R2-104-fixed-climber-state-additions
rhit-halseysh Jan 30, 2026
d94aa5c
Added spotlessapply cahnges
shlap Jan 31, 2026
6e45cb9
Merge branch 'R2-104-fixed-climber-state-additions' of https://github…
shlap Jan 31, 2026
aace56b
Commented out certain parts
shlap Jan 31, 2026
a5e137d
Added necessary changes + spotlessApply
shlap Jan 31, 2026
65d1fce
One more spotless apply
shlap Jan 31, 2026
74fce6b
Merge branch 'main' of https://github.com/FRC5188/RebuiltCode into R2…
shlap Jan 31, 2026
6feb296
spotless apply
shlap Jan 31, 2026
88537ee
Default hood changes
shlap Jan 31, 2026
8747313
1/31/26
GhostR406 Jan 31, 2026
a89765d
Merge branch 'main' into R2-93-instantiate-hopper-subsystem-and-command
rhit-halseysh Feb 2, 2026
b2a5117
Refactor packages and constants formatting
rhit-halseysh Feb 2, 2026
29adc6d
Merge pull request #34 from FRC5188/R2-93-instantiate-hopper-subsyste…
rhit-halseysh Feb 2, 2026
1948fba
Merge pull request #23 from FRC5188/R2-73-implement-run-animation
rhit-halseysh Feb 2, 2026
0e6b78d
Merge pull request #36 from FRC5188/R2-102-implement-static-shooting-…
rhit-halseysh Feb 2, 2026
147f1d8
Refactor packages and constants formatting
rhit-halseysh Feb 2, 2026
eb9456f
Merge branch 'w8-examples' of https://github.com/rhit-halseysh/Rebuil…
rhit-halseysh Feb 2, 2026
d3d0345
Aded back stuf
shlap Feb 2, 2026
48ac7f6
spot pply
shlap Feb 2, 2026
e21315e
Adding changes
rhit-halseysh Feb 2, 2026
e62d007
Merge pull request #40 from FRC5188/w8-examples
rhit-halseysh Feb 2, 2026
fd283d6
Implemented Pivot Methods 2/2/26
GhostR406 Feb 2, 2026
c6985ec
Needs review; Instantiated intake subsystem!
GhostR406 Feb 5, 2026
2c151c3
used spotlessApply
GhostR406 Feb 6, 2026
3716ff8
Merge pull request #44 from FRC5188/R2-119-instantiate-intake-system-…
rhit-halseysh Feb 6, 2026
361c91c
Merge branch 'main' into R2-100-implement-pivot-methods
rhit-collinkn Feb 7, 2026
434724f
Merge branch 'main' into R2-100-implement-pivot-methods
rhit-collinkn Feb 7, 2026
7f58268
oops spotless
rhit-collinkn Feb 7, 2026
5f616c4
Merge pull request #41 from FRC5188/R2-100-implement-pivot-methods
rhit-collinkn Feb 7, 2026
5c43aca
Did the same thing as the other one
shlap Jan 30, 2026
8fc58a0
Added spotlessapply cahnges
shlap Jan 31, 2026
cbbffa3
Commented out certain parts
shlap Jan 31, 2026
a2db1f7
Aded back stuf
shlap Feb 2, 2026
36d4e06
spot pply
shlap Feb 2, 2026
f98c4db
Merge branch 'R2-104-fixed-climber-state-additions' of https://github…
rhit-halseysh Feb 14, 2026
d7cac84
Clean and merge
rhit-halseysh Feb 14, 2026
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
289 changes: 265 additions & 24 deletions src/main/java/frc/robot/Constants.java

Large diffs are not rendered by default.

91 changes: 88 additions & 3 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

package frc.robot;

import com.ctre.phoenix6.hardware.TalonFX;
import com.pathplanner.lib.auto.AutoBuilder;
import edu.wpi.first.math.geometry.Pose2d;
import edu.wpi.first.math.geometry.Rotation2d;
Expand All @@ -23,14 +22,26 @@
import edu.wpi.first.wpilibj2.command.Commands;
import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
import edu.wpi.first.wpilibj2.command.sysid.SysIdRoutine;
import frc.lib.W8.io.absoluteencoder.AbsoluteEncoderIOCANCoderSim;
import frc.lib.W8.io.motor.*;
import frc.lib.W8.mechanisms.flywheel.*;
import frc.lib.W8.mechanisms.rotary.RotaryMechanism;
import frc.lib.W8.mechanisms.rotary.RotaryMechanismReal;
import frc.lib.W8.mechanisms.rotary.RotaryMechanismSim;
import frc.robot.Constants.HopperConstants;
import frc.robot.Constants.IntakeConstants;
import frc.robot.Constants.Ports;
import frc.robot.commands.DriveCommands;
import frc.robot.generated.TunerConstants;
import frc.robot.subsystems.Hopper;
import frc.robot.subsystems.Intake;
import frc.robot.subsystems.drive.Drive;
import frc.robot.subsystems.drive.GyroIO;
import frc.robot.subsystems.drive.GyroIOPigeon2;
import frc.robot.subsystems.drive.ModuleIO;
import frc.robot.subsystems.drive.ModuleIOSim;
import frc.robot.subsystems.drive.ModuleIOTalonFX;
import java.util.Optional;
import org.littletonrobotics.junction.networktables.LoggedDashboardChooser;

/**
Expand All @@ -42,6 +53,8 @@
public class RobotContainer {
// Subsystems
private final Drive drive;
private final Hopper hopper;
private final Intake intake;

// Controller
private final CommandXboxController controller = new CommandXboxController(0);
Expand All @@ -61,6 +74,33 @@ public RobotContainer() {
new ModuleIOTalonFX(TunerConstants.FrontRight),
new ModuleIOTalonFX(TunerConstants.BackLeft),
new ModuleIOTalonFX(TunerConstants.BackRight));

hopper =
new Hopper(
new FlywheelMechanismReal(
new MotorIOTalonFX(
HopperConstants.MOTOR_NAME,
HopperConstants.getFXConfig(),
Ports.HopperRoller)));

intake =
new Intake(
new FlywheelMechanismReal(
new MotorIOTalonFX(
IntakeConstants.MOTOR_NAME,
IntakeConstants.getFXConfig(),
Ports.IntakeRoller)),
new RotaryMechanismReal(
new MotorIOTalonFX(
IntakeConstants.MOTOR_NAME,
IntakeConstants.getFXConfig(),
Ports.IntakeRoller),
IntakeConstants.CONSTANTS,
Optional.of(
new AbsoluteEncoderIOCANCoderSim(
Ports.IntakeRoller,
IntakeConstants.MOTOR_NAME + " Encoder",
IntakeConstants.getCANcoderConfig(false)))));
break;

case SIM:
Expand All @@ -72,6 +112,42 @@ public RobotContainer() {
new ModuleIOSim(TunerConstants.FrontRight),
new ModuleIOSim(TunerConstants.BackLeft),
new ModuleIOSim(TunerConstants.BackRight));

hopper =
new Hopper(
new FlywheelMechanismSim(
new MotorIOTalonFXSim(
HopperConstants.MOTOR_NAME,
HopperConstants.getFXConfig(),
Ports.HopperRoller),
HopperConstants.DCMOTOR,
HopperConstants.MOI,
HopperConstants.TOLERANCE));

intake =
new Intake(
new FlywheelMechanismSim(
new MotorIOTalonFXSim(
IntakeConstants.MOTOR_NAME,
IntakeConstants.getFXConfig(),
Ports.IntakeRoller),
IntakeConstants.DCMOTOR,
IntakeConstants.MOI,
IntakeConstants.TOLERANCE),
new RotaryMechanismSim(
new MotorIOTalonFXSim(
IntakeConstants.MOTOR_NAME,
IntakeConstants.getFXConfig(),
Ports.IntakeRoller),
IntakeConstants.DCMOTOR,
IntakeConstants.MOI,
false,
IntakeConstants.CONSTANTS,
Optional.of(
new AbsoluteEncoderIOCANCoderSim(
Ports.IntakeRoller,
IntakeConstants.MOTOR_NAME + " Encoder",
IntakeConstants.getCANcoderConfig(false)))));
break;

default:
Expand All @@ -83,6 +159,13 @@ public RobotContainer() {
new ModuleIO() {},
new ModuleIO() {},
new ModuleIO() {});

hopper = new Hopper(new FlywheelMechanism() {});

intake =
new Intake(
new FlywheelMechanism() {},
new RotaryMechanism(IntakeConstants.MOTOR_NAME, IntakeConstants.CONSTANTS) {});
break;
}

Expand Down Expand Up @@ -147,6 +230,10 @@ private void configureButtonBindings() {
new Pose2d(drive.getPose().getTranslation(), new Rotation2d())),
drive)
.ignoringDisable(true));

controller
.x()
.onTrue(Commands.runOnce(() -> hopper.setGoal(HopperConstants.HOPPER_POSITION), hopper));
}

/**
Expand All @@ -157,6 +244,4 @@ private void configureButtonBindings() {
public Command getAutonomousCommand() {
return autoChooser.get();
}

TalonFX billyBob = new TalonFX(30, TunerConstants.DrivetrainConstants.CANBusName);
}
30 changes: 30 additions & 0 deletions src/main/java/frc/robot/subsystems/Climber.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package frc.robot.subsystems;

import edu.wpi.first.units.Units;
import edu.wpi.first.units.measure.LinearVelocity;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.lib.W8.mechanisms.linear.LinearMechanism;
import frc.robot.Constants.ClimberConstants;

public class Climber extends SubsystemBase {
private LinearMechanism _io;

public Climber(LinearMechanism io) {
io = _io;
}

public enum State {
IDLE(Units.MetersPerSecond.of(0.0)),
ASCENDING(Units.MetersPerSecond.of(ClimberConstants.CLIMB_SPEED)),
DESCENDING(Units.MetersPerSecond.of(-ClimberConstants.CLIMB_SPEED));

private final LinearVelocity velocity;

private State(LinearVelocity velocity) {
this.velocity = velocity;
}
}

@Override
public void periodic() {}
}
45 changes: 45 additions & 0 deletions src/main/java/frc/robot/subsystems/Hopper.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package frc.robot.subsystems;

import static edu.wpi.first.units.Units.*;
import static edu.wpi.first.units.Units.Inches;

import edu.wpi.first.units.measure.*;
import edu.wpi.first.units.measure.Distance;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.lib.W8.io.motor.MotorIO.PIDSlot;
import frc.lib.W8.mechanisms.flywheel.FlywheelMechanism;
import frc.robot.Constants.HopperConstants;

public class Hopper extends SubsystemBase {
private FlywheelMechanism _io;

public enum State {
OFF(RevolutionsPerSecond.of(0.0)),
FORWARD_SLOW(RevolutionsPerSecond.of(HopperConstants.SLOW_SPEED_RPM / 60)),
FORWARD_FAST(RevolutionsPerSecond.of(HopperConstants.FAST_SPEED_RPM / 60)),
REVERSE(RevolutionsPerSecond.of(HopperConstants.REVERSE_SPEED_RPM / 60));

private final AngularVelocity _stateVelocity;

private State(AngularVelocity stateVelocity) {
_stateVelocity = stateVelocity;
}
}

public Hopper(FlywheelMechanism io) {
_io = io;
}

public void setGoal(double position) {
Distance positionInches = Inches.of(position);
_io.runPosition(
HopperConstants.CONVERTER.toAngle(positionInches),
HopperConstants.ANGULAR_VELOCITY,
HopperConstants.ANGULAR_ACCELERATION,
null,
PIDSlot.SLOT_0);
}

@Override
public void periodic() {}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package frc.robot.subsystems.intake;
package frc.robot.subsystems;

import static edu.wpi.first.units.Units.RotationsPerSecond;

Expand All @@ -9,10 +9,12 @@
import frc.lib.W8.mechanisms.flywheel.FlywheelMechanism;
import frc.lib.W8.mechanisms.rotary.RotaryMechanism;
import frc.robot.Constants;
import frc.robot.Constants.IntakePivotConstants;

public class Intake extends SubsystemBase {
private FlywheelMechanism _rollerIO;
private RotaryMechanism _pivotIO;
public double desiredAngle;

public Intake(FlywheelMechanism rollerIO, RotaryMechanism pivotIO) {
_rollerIO = rollerIO;
Expand All @@ -38,6 +40,21 @@ public void stop() {
setVelocity(0);
}

public void setAngle(Angle angle) {
_pivotIO.runPosition(
angle,
getVelocity(),
IntakePivotConstants.ACCELERATION,
IntakePivotConstants.JERK,
PIDSlot.SLOT_0);
desiredAngle = angle.magnitude();
}

public boolean isIntendedAngle() {
return Math.abs(desiredAngle - _pivotIO.getVelocity().in(RotationsPerSecond))
<= IntakePivotConstants.TOLERANCE.magnitude();
}

@Override
public void periodic() {}
}
27 changes: 27 additions & 0 deletions src/main/java/frc/robot/subsystems/LEDs.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package frc.robot.subsystems;

import com.ctre.phoenix6.controls.SolidColor;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.lib.W8.devices.Lights;
import frc.lib.W8.io.lights.LightsIO;
import frc.robot.Constants.LEDConstants;

public class LEDs extends SubsystemBase {
private final LightsIO _io;
private final Lights _lights;

public LEDs(LightsIO io, Lights lights) {
_io = io;
_lights = lights;
}

public Command runAnimation() {
return this.startEnd(
() -> _lights.setAnimation(new SolidColor(0, 3).withColor(LEDConstants.colorPaleBlue)),
() -> _lights.setAnimation(new SolidColor(0, 3).withColor(LEDConstants.colorWheezerBlue)));
}

@Override
public void periodic() {}
}
15 changes: 0 additions & 15 deletions src/main/java/frc/robot/subsystems/LEDs/LEDs.java

This file was deleted.

Loading