-
Notifications
You must be signed in to change notification settings - Fork 0
2026 cleanup PR #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
2026 cleanup PR #26
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| package tagalong.devices; | ||
|
|
||
| import com.ctre.phoenix6.CANBus; | ||
| import java.util.Map; | ||
|
|
||
| /** | ||
| * Tagalong CANBus manager instance manager, only CTRE devices are currently registered or supported | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| */ | ||
| public class TagalongCANBus { | ||
| /** | ||
| * Map of all instances with a CTRE device registered to them | ||
| */ | ||
| private static final Map<String, CANBus> _ctreCANBus = Map.of(); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using Map.of() with no parameters creates an UnsupportedOperationException when we try to put stuff in it on line 25 https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.html#unmodifiable
|
||
|
|
||
| /** | ||
| * Gets or registers a CTRE CANBus instance with the given name | ||
| * | ||
| * @param canBusName Name of the CANBus | ||
| * @return CTRE CANBus instance | ||
| */ | ||
| public static CANBus getOrRegisterPhoenixCANBus(String canBusName) { | ||
| CANBus bus = _ctreCANBus.get(canBusName); | ||
| if (bus == null) { | ||
| bus = new CANBus(canBusName); | ||
| _ctreCANBus.put(canBusName, bus); | ||
| } | ||
| return bus; | ||
| } | ||
|
|
||
| /** | ||
| * Gets the map of all registered CTRE CANBus instances | ||
| * | ||
| * @return Map of CANBus instances | ||
| */ | ||
| public static Map<String, CANBus> getPhoenixCANBusMap() { | ||
| return _ctreCANBus; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,10 +12,10 @@ public class ElevatorIOInputsAutoLogged | |
| extends ElevatorIO.ElevatorIOInputs implements LoggableInputs, Cloneable { | ||
| @Override | ||
| public void toLog(LogTable table) { | ||
| table.put("ElevatorHeightM", elevatorHeightM); | ||
| table.put("ElevatorVelocityMPS", elevatorVelocityMPS); | ||
| table.put("ElevatorAppliedVolts", elevatorAppliedVolts); | ||
| table.put("ElevatorCurrentAmps", elevatorCurrentAmps); | ||
| table.put("ElevatorHeightM", elevatorHeightM, "meters"); | ||
| table.put("ElevatorVelocityMPS", elevatorVelocityMPS, "meters/second"); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. mps? (I think?) |
||
| table.put("ElevatorAppliedVolts", elevatorAppliedVolts, "volts"); | ||
| table.put("ElevatorCurrentAmps", elevatorCurrentAmps, "amps"); | ||
| } | ||
|
|
||
| @Override | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,10 +12,10 @@ public class PivotIOInputsAutoLogged | |
| extends PivotIO.PivotIOInputs implements LoggableInputs, Cloneable { | ||
| @Override | ||
| public void toLog(LogTable table) { | ||
| table.put("PivotPositionRot", pivotPositionRot); | ||
| table.put("PivotVelocityRPS", pivotVelocityRPS); | ||
| table.put("PivotAppliedVolts", pivotAppliedVolts); | ||
| table.put("PivotCurrentAmps", pivotCurrentAmps); | ||
| table.put("PivotPositionRot", pivotPositionRot, "rotations"); | ||
| table.put("PivotVelocityRPS", pivotVelocityRPS, "rotations/second"); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. rps? (I think?) |
||
| table.put("PivotAppliedVolts", pivotAppliedVolts, "volts"); | ||
| table.put("PivotCurrentAmps", pivotCurrentAmps, "amps"); | ||
| } | ||
|
|
||
| @Override | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,10 +12,10 @@ public class RollerIOInputsAutoLogged | |
| extends RollerIO.RollerIOInputs implements LoggableInputs, Cloneable { | ||
| @Override | ||
| public void toLog(LogTable table) { | ||
| table.put("RollerPositionRot", rollerPositionRot); | ||
| table.put("RollerVelocityRPS", rollerVelocityRPS); | ||
| table.put("RollerAppliedVolts", rollerAppliedVolts); | ||
| table.put("RollerCurrentAmps", rollerCurrentAmps); | ||
| table.put("RollerPositionRot", rollerPositionRot, "rotations"); | ||
| table.put("RollerVelocityRPS", rollerVelocityRPS, "rotations/second"); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. rps? (I think?) |
||
| table.put("RollerAppliedVolts", rollerAppliedVolts, "volts"); | ||
| table.put("RollerCurrentAmps", rollerCurrentAmps, "amps"); | ||
| } | ||
|
|
||
| @Override | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops..