Skip to content
This repository was archived by the owner on May 19, 2024. It is now read-only.

Commit 29bd5aa

Browse files
committed
feat(shooter): Get ready to test shooter.
1 parent 7b8c17b commit 29bd5aa

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

Diff for: simgui-ds.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,7 @@
101101
"useGamepad": true
102102
},
103103
{
104-
"guid": "030000006d0400001dc2000014400000",
105-
"useGamepad": true
104+
"guid": "Keyboard0"
106105
}
107106
]
108107
}

Diff for: simgui.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@
188188
0.0,
189189
0.8500000238418579
190190
],
191-
"height": 338,
191+
"height": 0,
192192
"series": [
193193
{
194194
"color": [

Diff for: src/main/java/frc/robot/shooter/FlywheelMotorIOTalonFX.java

+9-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import com.ctre.phoenix6.configs.TalonFXConfiguration;
55
import com.ctre.phoenix6.hardware.TalonFX;
66
import com.ctre.phoenix6.signals.NeutralModeValue;
7+
8+
import edu.wpi.first.math.controller.SimpleMotorFeedforward;
79
import frc.lib.Configurator;
810

911
/** Flywheel motor using TalonFX. */
@@ -13,11 +15,15 @@ public class FlywheelMotorIOTalonFX implements FlywheelMotorIO {
1315

1416
private final StatusSignal<Double> velocityRotationsPerSecond, statorCurrentAmps;
1517

18+
private final SimpleMotorFeedforward velocityFeedforward;
19+
1620
public FlywheelMotorIOTalonFX() {
1721
talonFX = new TalonFX(30);
1822

1923
velocityRotationsPerSecond = talonFX.getVelocity();
2024
statorCurrentAmps = talonFX.getStatorCurrent();
25+
26+
velocityFeedforward = new SimpleMotorFeedforward(0, 0);
2127
}
2228

2329
@Override
@@ -40,6 +46,8 @@ public void update(FlywheelMotorIOValues values) {
4046

4147
@Override
4248
public void setSetpoint(double velocityRotationsPerSecond) {
43-
// TODO Implement velocity setpoint
49+
double volts = velocityFeedforward.calculate(velocityRotationsPerSecond);
50+
51+
talonFX.setVoltage(volts);
4452
}
4553
}

0 commit comments

Comments
 (0)