Skip to content
Closed
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
2 changes: 1 addition & 1 deletion .github/workflows/javadoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
uses: actions/deploy-pages@v4
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# FRC Team 199 Library

This projects builds `lib199.jar` which contains code that reuse across projects/years. The javadocs can be found [here](https://docs.carlmontrobotics.org/lib199/).
This projects builds `lib199.jar` which contains code that reuse across projects/years. The javadocs can be found [here](https://deepbluerobotics.github.io/lib199/).

## Changelog
A changelog is automatically generated with each release and is available on the [Releases](https://github.com/DeepBlueRobotics/lib199/releases) page. Please write documentation for all changes and, if significant enough, add appropriate information to the [programming training website](https://deep-blue-training.readthedocs.io/en/latest/).
37 changes: 37 additions & 0 deletions src/main/java/org/carlmontrobotics/lib199/Lib199Subsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ public class Lib199Subsystem implements Subsystem {
private static final CopyOnWriteArrayList<Runnable> periodicSimulationMethods = new CopyOnWriteArrayList<>();
private static final Consumer<Runnable> RUN_RUNNABLE = Runnable::run;

@Deprecated
public static final long asyncSleepTime = 20;

static {
ensureRegistered();
}
Expand Down Expand Up @@ -40,10 +43,37 @@ public static void registerPeriodic(Runnable method) {
periodicMethods.add(method);
}

@Deprecated
/**
* @deprecated Use registerSimulationPeriodic
* @param method
*/
public static void simulationPeriodic(Runnable method) {
registerSimulationPeriodic(method);
}

public static void registerSimulationPeriodic(Runnable method) {
periodicSimulationMethods.add(method);
}

@Deprecated
/**
* @deprecated Use registerPeriodic
* @param method
*/
public static void registerAsyncPeriodic(Runnable method) {
registerPeriodic(method);
}

@Deprecated
/**
* @deprecated Use registerSimulationPeriodic
* @param method
*/
public static void registerAsyncSimulationPeriodic(Runnable method) {
registerSimulationPeriodic(method);
}

@Override
public void periodic() {
periodicMethods.forEach(RUN_RUNNABLE);
Expand All @@ -54,6 +84,13 @@ public void simulationPeriodic() {
periodicSimulationMethods.forEach(RUN_RUNNABLE);
}

@Deprecated
/**
* No longer does anything.
*/
public synchronized void asyncPeriodic() {
}

private Lib199Subsystem() {}

}
5 changes: 5 additions & 0 deletions src/main/java/org/carlmontrobotics/lib199/Limelight.java
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,11 @@ public Pose3d getTransform(Transform transform) {
return new Pose3d(rawData[0], rawData[1], rawData[2], new Rotation3d(Math.toRadians(rawData[3]), Math.toRadians(rawData[4]), Math.toRadians(rawData[5])));
}

/**
* Gets Limelight Network Tables
* @param key id of the NT
* @return the NT
*/
public NetworkTableEntry getNTEntry(String key) {
return NetworkTableInstance.getDefault().getTable(config.ntName).getEntry(key);
}
Expand Down
15 changes: 4 additions & 11 deletions src/main/java/org/carlmontrobotics/lib199/MotorConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,20 @@

public class MotorConfig {

public static final MotorConfig NEO = new MotorConfig(70, 40, MotorControllerType.SPARK_MAX);
public static final MotorConfig NEO_550 = new MotorConfig(70, 40, MotorControllerType.SPARK_MAX);
public static final MotorConfig NEO_2 = new MotorConfig(70, 40, MotorControllerType.SPARK_MAX); //TODO: find the max temp for NEO 2.0
public static final MotorConfig NEO = new MotorConfig(70, 40);
public static final MotorConfig NEO_550 = new MotorConfig(40, 20);

// The temp limit of 100C for the Vortex is based on the fact that its temp sensors are mounted directly on the
// windings (which is not the case for the Neo or Neo550, causing them to have very delayed temp readings) and the
// fact that the winding enamel will melt at 140C.
// See: https://www.chiefdelphi.com/t/rev-robotics-spark-flex-and-neo-vortex/442595/349?u=brettle
// As a result I think 100C should be safe. I wouldn't increase it past 120. --Dean
public static final MotorConfig NEO_VORTEX = new MotorConfig(100, 40, MotorControllerType.SPARK_FLEX);
public static final MotorConfig NEO_SOLO_VORTEX = new MotorConfig(100, 40, MotorControllerType.SPARK_MAX);
public static final MotorConfig NEO_VORTEX = new MotorConfig(100, 60);
public final int temperatureLimitCelsius, currentLimitAmps;
public final MotorControllerType controllerType;

public MotorConfig(int temperatureLimitCelsius, int currentLimitAmps, MotorControllerType controllerType) {
public MotorConfig(int temperatureLimitCelsius, int currentLimitAmps) {
this.temperatureLimitCelsius = temperatureLimitCelsius;
this.currentLimitAmps = currentLimitAmps;
this.controllerType = controllerType;
}

public MotorControllerType getControllerType() {
return controllerType;
}
}
Loading
Loading