Skip to content

Commit 37d4467

Browse files
committed
summary
1 parent 813a15f commit 37d4467

17 files changed

+1183
-16
lines changed
Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,58 @@
11
package frc.robot.subsystems.algae;
22

3-
public class AlgaeSubsystem {}
3+
import static edu.wpi.first.units.Units.Rotations;
4+
5+
import edu.wpi.first.units.measure.Angle;
6+
import frc.robot.constants.AlgaeConstants;
7+
import frc.robot.constants.ExampleConstants;
8+
import frc.robot.standards.ClosedLoopPosSubsystem;
9+
import frc.robot.subsystems.algae.algaeIO.IOInputs;
10+
11+
import java.util.Set;
12+
import org.littletonrobotics.junction.Logger;
13+
import org.strykeforce.telemetry.TelemetryService;
14+
import org.strykeforce.telemetry.measurable.MeasurableSubsystem;
15+
import org.strykeforce.telemetry.measurable.Measure;
16+
17+
public class AlgaeSubsystem implements ClosedLoopPosSubsystem {
18+
private final algaeIO io;
19+
private final IOInputsAutoLogged inputs = new IOInputsAutoLogged();
20+
private Angle setpoint = Rotations.of(0.0);
21+
22+
public AlgaeSubsystem(algaeIO io) {
23+
this.io = io;
24+
}
25+
26+
public Angle getPosition() {
27+
return getPosition();
28+
}
29+
30+
public void setPosition(Angle position) {
31+
setPosition(position);
32+
setpoint = position;
33+
}
34+
35+
public boolean isFinished() {
36+
return setpoint.minus(getPosition()).abs(Rotations) <= AlgaeConstants.kCloseEnough.in(Rotations);
37+
}
38+
39+
// Periodic Function
40+
public void periodic() {
41+
io.updateInputs(inputs);
42+
Logger.processInputs(getName(), inputs);
43+
Logger.recordOutput("Algae/setpoint", setpoint.in(Rotations));
44+
}
45+
46+
// Grapher
47+
@Override
48+
public void registerWith(TelemetryService telemetryService) {
49+
50+
super.registerWith(telemetryService);
51+
io.registerWith(telemetryService);
52+
}
53+
54+
@Override
55+
public Set<Measure> getMeasures() {
56+
return Set.of(new Measure("State", () -> curState.ordinal()));
57+
}
58+
}

src/main/java/frc/robot/subsystems/algae/algaeIO.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package frc.robot.subsystems.algae;
22

3+
import edu.wpi.first.units.measure.Angle;
34
import edu.wpi.first.units.measure.AngularVelocity;
45
import org.littletonrobotics.junction.AutoLog;
56
import org.strykeforce.telemetry.TelemetryService;
@@ -10,6 +11,7 @@ public interface algaeIO {
1011
@AutoLog
1112
public static class IOInputs {
1213
public AngularVelocity velocity;
14+
public Angle location;
1315
public ReverseLimitValue reverseLimitSwitch;
1416
}
1517

src/main/java/frc/robot/subsystems/algae/algaeIOFX.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import com.ctre.phoenix6.hardware.TalonFX;
1212
import com.ctre.phoenix6.signals.ReverseLimitValue;
1313

14+
import edu.wpi.first.units.measure.Angle;
1415
import edu.wpi.first.units.measure.AngularVelocity;
1516
import frc.robot.constants.AlgaeConstants;
1617

@@ -20,6 +21,7 @@ public class algaeIOFX implements algaeIO {
2021
private final TalonFX talonFX;
2122
private StatusSignal<AngularVelocity> currVelocity;
2223
private StatusSignal<ReverseLimitValue> reverseLimitSwitch;
24+
private StatusSignal<Angle> currAngle;
2325

2426
// FX Access objects
2527
TalonFXConfigurator configurator;
@@ -32,24 +34,27 @@ public algaeIOFX() {
3234
talonFX = new TalonFX(AlgaeConstants.kFxId);
3335
reverseLimitSwitch = talonFX.getReverseLimit();
3436
currVelocity = talonFX.getVelocity();
37+
currAngle = talonFX.getPosition();
3538
}
3639

3740
@Override
3841
public void updateInputs(IOInputs inputs) {
39-
// Update the velocity input in the IOInputs structure
42+
// inputs.reverseLimitSwitch = reverseLimitSwitch.refresh().getValue().value == 1;
4043
inputs.velocity = currVelocity.refresh().getValue();
44+
inputs.location = currAngle.refresh().getValue();
4145
}
4246

4347
@Override
4448
public void setPosition(double position) {
45-
// In case you want to use the position control in your system
4649
talonFX.setPosition(position);
4750
}
51+
public Angle getPosition() {
52+
return currAngle.getValue();
53+
}
4854

4955
@Override
5056
public void zero() {
51-
// This can reset the encoder or clear other state as needed
52-
talonFX.clearStickyFaults();
57+
// not doing one for now
5358
}
5459

5560
@Override

vendordeps/ChoreoLib-2025.0.0.json renamed to vendordeps/ChoreoLib-2025.0.1.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"fileName": "ChoreoLib-2025.0.0.json",
2+
"fileName": "ChoreoLib-2025.0.1.json",
33
"name": "ChoreoLib",
4-
"version": "2025.0.0",
4+
"version": "2025.0.1",
55
"uuid": "b5e23f0a-dac9-4ad2-8dd6-02767c520aca",
66
"frcYear": "2025",
77
"mavenUrls": [
@@ -13,7 +13,7 @@
1313
{
1414
"groupId": "choreo",
1515
"artifactId": "ChoreoLib-java",
16-
"version": "2025.0.0"
16+
"version": "2025.0.1"
1717
},
1818
{
1919
"groupId": "com.google.code.gson",
@@ -26,7 +26,7 @@
2626
{
2727
"groupId": "choreo",
2828
"artifactId": "ChoreoLib-cpp",
29-
"version": "2025.0.0",
29+
"version": "2025.0.1",
3030
"libName": "ChoreoLib",
3131
"headerClassifier": "headers",
3232
"sharedLibrary": false,

vendordeps/DogLog.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"javaDependencies": [
3+
{
4+
"groupId": "com.github.jonahsnider",
5+
"artifactId": "doglog",
6+
"version": "2025.3.0"
7+
}
8+
],
9+
"fileName": "DogLog.json",
10+
"frcYear": "2025",
11+
"jsonUrl": "https://doglog.dev/vendordep.json",
12+
"name": "DogLog",
13+
"jniDependencies": [],
14+
"mavenUrls": [
15+
"https://jitpack.io"
16+
],
17+
"cppDependencies": [],
18+
"version": "2025.3.0",
19+
"uuid": "65592ce1-2251-4a31-8e4b-2df20dacebe4"
20+
}

vendordeps/LumynLabs-2025.0.0.json

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{
2+
"fileName": "LumynLabs-2025.0.0.json",
3+
"name": "LumynLabs",
4+
"version": "2025.0.0",
5+
"frcYear": "2025",
6+
"uuid": "eebd34fc-a6d3-48a2-a286-ac1cec59ab89",
7+
"mavenUrls": [
8+
"https://packages.lumynlabs.com/repo"
9+
],
10+
"jsonUrl": "https://packages.lumynlabs.com/LumynLabs.json",
11+
"javaDependencies": [
12+
{
13+
"groupId": "com.lumynlabs.frc",
14+
"artifactId": "LumynLabs-java",
15+
"version": "2025.0.0"
16+
}
17+
],
18+
"jniDependencies": [
19+
{
20+
"groupId": "com.lumynlabs.frc",
21+
"artifactId": "LumynLabs-driver",
22+
"version": "2025.0.0",
23+
"skipInvalidPlatforms": true,
24+
"isJar": false,
25+
"validPlatforms": [
26+
"windowsx86-64",
27+
"linuxarm64",
28+
"linuxx86-64",
29+
"linuxathena",
30+
"linuxarm32",
31+
"osxuniversal"
32+
]
33+
}
34+
],
35+
"cppDependencies": [
36+
{
37+
"groupId": "com.lumynlabs.frc",
38+
"artifactId": "LumynLabs-cpp",
39+
"version": "2025.0.0",
40+
"libName": "Lumyn",
41+
"headerClassifier": "headers",
42+
"sharedLibrary": false,
43+
"skipInvalidPlatforms": true,
44+
"binaryPlatforms": [
45+
"windowsx86-64",
46+
"linuxarm64",
47+
"linuxx86-64",
48+
"linuxathena",
49+
"linuxarm32",
50+
"osxuniversal"
51+
]
52+
},
53+
{
54+
"groupId": "com.lumynlabs.frc",
55+
"artifactId": "LumynLabs-driver",
56+
"version": "2025.0.0",
57+
"libName": "LumynDriver",
58+
"headerClassifier": "headers",
59+
"sharedLibrary": false,
60+
"skipInvalidPlatforms": true,
61+
"binaryPlatforms": [
62+
"windowsx86-64",
63+
"linuxarm64",
64+
"linuxx86-64",
65+
"linuxathena",
66+
"linuxarm32",
67+
"osxuniversal"
68+
]
69+
}
70+
]
71+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"fileName": "PathplannerLib-2025.2.1.json",
3+
"name": "PathplannerLib",
4+
"version": "2025.2.1",
5+
"uuid": "1b42324f-17c6-4875-8e77-1c312bc8c786",
6+
"frcYear": "2025",
7+
"mavenUrls": [
8+
"https://3015rangerrobotics.github.io/pathplannerlib/repo"
9+
],
10+
"jsonUrl": "https://3015rangerrobotics.github.io/pathplannerlib/PathplannerLib.json",
11+
"javaDependencies": [
12+
{
13+
"groupId": "com.pathplanner.lib",
14+
"artifactId": "PathplannerLib-java",
15+
"version": "2025.2.1"
16+
}
17+
],
18+
"jniDependencies": [],
19+
"cppDependencies": [
20+
{
21+
"groupId": "com.pathplanner.lib",
22+
"artifactId": "PathplannerLib-cpp",
23+
"version": "2025.2.1",
24+
"libName": "PathplannerLib",
25+
"headerClassifier": "headers",
26+
"sharedLibrary": false,
27+
"skipInvalidPlatforms": true,
28+
"binaryPlatforms": [
29+
"windowsx86-64",
30+
"linuxx86-64",
31+
"osxuniversal",
32+
"linuxathena",
33+
"linuxarm32",
34+
"linuxarm64"
35+
]
36+
}
37+
]
38+
}

0 commit comments

Comments
 (0)