Skip to content
Open
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
1 change: 1 addition & 0 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ private void addAutos() {

@Override
public void robotPeriodic() {

CommandScheduler.getInstance().run();
superstructure.periodic();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ public static TalonFXConfiguration getKickerConfigs() {

@Override
public void periodic() {

firstCANRangeIO.updateInputs(firstCANRangeInputs);
Logger.processInputs("Indexer/First Beambreak", firstCANRangeInputs);
secondCANRangeIO.updateInputs(secondCANRangeInputs);
Expand Down
80 changes: 80 additions & 0 deletions src/main/java/frc/robot/subsystems/intake/ExtensionSubsystem.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
package frc.robot.subsystems.intake;

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

import com.ctre.phoenix6.configs.TalonFXConfiguration;
import com.ctre.phoenix6.signals.InvertedValue;
import com.ctre.phoenix6.signals.NeutralModeValue;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.Commands;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import edu.wpi.first.wpilibj2.command.sysid.SysIdRoutine;
import edu.wpi.first.wpilibj2.command.sysid.SysIdRoutine.*;
import frc.robot.components.rollers.RollerIO;
import frc.robot.components.rollers.RollerIOInputsAutoLogged;
import org.littletonrobotics.junction.Logger;

public class ExtensionSubsystem extends SubsystemBase {
public static final double GEAR_RATIO = 2.0;




private ExtensionIO io;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lintake also has rollers, so add a roller io as well

private ExtensionIOInputsAutoLogged inputs = new RollerIOInputsAutoLogged();

private SysIdRoutine intakeRollerSysid =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename this because it's sysid for the extension not the rollers.

new SysIdRoutine(
new Config(null, null, null, (state) -> Logger.recordOutput("Extension/SysID State", state)),
new Mechanism((volts) -> io.setExtensionVoltage(volts.in(Volts)), null, this));

public ExtensionSubsystem(ExtensionIO io) {
this.io = io;
}

public void periodic() {
io.updateInputs(inputs);
Logger.processInputs("Extension", inputs);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe log these to Intake/Extension

}

// TODO get actual values
public Command extend() {
return this.run(() -> io.setExtensionVoltage(5));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should probably be on position control?

}

public Command contract() {
return this.run(() -> io.setExtensionVoltage(-2));
}

public Command stop() {
return this.run(() -> io.setExtensionVoltage(0));
}

public Command runRollerSysid() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename this as well

return Commands.sequence(
intakeRollerSysid.quasistatic(Direction.kForward),
intakeRollerSysid.quasistatic(Direction.kReverse),
intakeRollerSysid.dynamic(Direction.kForward),
intakeRollerSysid.dynamic(Direction.kReverse));
}

public static TalonFXConfiguration getExtensionConfig() {
TalonFXConfiguration config = new TalonFXConfiguration();
config.MotorOutput.NeutralMode = NeutralModeValue.Coast;
config.MotorOutput.Inverted = InvertedValue.Clockwise_Positive;

config.Feedback.SensorToMechanismRatio = GEAR_RATIO;

config.Slot0.kS = 0.24;
config.Slot0.kV = 0.6;
config.Slot0.kP = 110.0;
config.Slot0.kD = 0.0;

config.CurrentLimits.StatorCurrentLimit = 80.0;
config.CurrentLimits.StatorCurrentLimitEnable = true;
config.CurrentLimits.SupplyCurrentLimit = 60.0;
config.CurrentLimits.SupplyCurrentLimitEnable = true;

return config;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
public class IntakeSubsystem extends SubsystemBase {
public static final double GEAR_RATIO = 2.0;




private RollerIO io;
private RollerIOInputsAutoLogged inputs = new RollerIOInputsAutoLogged();

Expand Down
71 changes: 71 additions & 0 deletions vendordeps/playingwithfusion2026.json
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file probably shouldn't be in this branch. To remove it, use git rm --cached vendordeps/playingwithfusion2026.json and commit (this will stop tracking the file without deleting it), or just move the file to trash and commit.

Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"fileName": "playingwithfusion2026.json",
"name": "PlayingWithFusion",
"version": "2026.1.16",
"uuid": "14b8ad04-24df-11ea-978f-2e728ce88125",
"frcYear": "2026",
"jsonUrl": "https://www.playingwithfusion.com/frc/playingwithfusion2026.json",
"mavenUrls": [
"https://www.playingwithfusion.com/frc/maven/"
],
"javaDependencies": [
{
"groupId": "com.playingwithfusion.frc",
"artifactId": "PlayingWithFusion-java",
"version": "2026.1.16"
}
],
"jniDependencies": [
{
"groupId": "com.playingwithfusion.frc",
"artifactId": "PlayingWithFusion-driver",
"version": "2026.1.16",
"skipInvalidPlatforms": true,
"isJar": false,
"validPlatforms": [
"windowsx86-64",
"linuxarm64",
"linuxx86-64",
"linuxathena",
"linuxarm32",
"osxuniversal"
]
}
],
"cppDependencies": [
{
"groupId": "com.playingwithfusion.frc",
"artifactId": "PlayingWithFusion-cpp",
"version": "2026.1.16",
"libName": "PlayingWithFusion",
"headerClassifier": "headers",
"sharedLibrary": false,
"skipInvalidPlatforms": true,
"binaryPlatforms": [
"windowsx86-64",
"linuxarm64",
"linuxx86-64",
"linuxathena",
"linuxarm32",
"osxuniversal"
]
},
{
"groupId": "com.playingwithfusion.frc",
"artifactId": "PlayingWithFusion-driver",
"version": "2026.1.16",
"libName": "PlayingWithFusionDriver",
"headerClassifier": "headers",
"sharedLibrary": true,
"skipInvalidPlatforms": true,
"binaryPlatforms": [
"windowsx86-64",
"linuxarm64",
"linuxx86-64",
"linuxathena",
"linuxarm32",
"osxuniversal"
]
}
]
}