Skip to content

Commit

Permalink
Explicitly make the flywheel an example subsystem
Browse files Browse the repository at this point in the history
	renamed:    src/main/java/frc/robot/subsystems/flywheel/Flywheel.java -> src/main/java/frc/robot/subsystems/flywheel_example/Flywheel.java
	renamed:    src/main/java/frc/robot/subsystems/flywheel/FlywheelIO.java -> src/main/java/frc/robot/subsystems/flywheel_example/FlywheelIO.java
	renamed:    src/main/java/frc/robot/subsystems/flywheel/FlywheelIOSim.java -> src/main/java/frc/robot/subsystems/flywheel_example/FlywheelIOSim.java
	renamed:    src/main/java/frc/robot/subsystems/flywheel/FlywheelIOSparkMax.java -> src/main/java/frc/robot/subsystems/flywheel_example/FlywheelIOSparkMax.java
	renamed:    src/main/java/frc/robot/subsystems/flywheel/FlywheelIOTalonFX.java -> src/main/java/frc/robot/subsystems/flywheel_example/FlywheelIOTalonFX.java
	new file:   src/main/java/frc/robot/subsystems/flywheel_example/README
  • Loading branch information
tbowers7 committed Oct 11, 2024
1 parent a7efee6 commit 0ba542c
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

package frc.robot.subsystems.flywheel;
package frc.robot.subsystems.flywheel_example;

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

package frc.robot.subsystems.flywheel;
package frc.robot.subsystems.flywheel_example;

import org.littletonrobotics.junction.AutoLog;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

package frc.robot.subsystems.flywheel;
package frc.robot.subsystems.flywheel_example;

import edu.wpi.first.math.MathUtil;
import edu.wpi.first.math.controller.PIDController;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

package frc.robot.subsystems.flywheel;
package frc.robot.subsystems.flywheel_example;

import com.revrobotics.CANSparkBase.ControlType;
import com.revrobotics.CANSparkLowLevel.MotorType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

package frc.robot.subsystems.flywheel;
package frc.robot.subsystems.flywheel_example;

import com.ctre.phoenix6.BaseStatusSignal;
import com.ctre.phoenix6.StatusSignal;
Expand Down
33 changes: 33 additions & 0 deletions src/main/java/frc/robot/subsystems/flywheel_example/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
This directory contains an example generic flywheel subsystem, as distributed
with AdvantageKit. The structure of the subsystem directory is:

* Flywheel.java
The base subsystem definitions and outward-facing (public) hardware-
agnostic functions for interacting with the subsystem. The idea is
that any of the hardware-specific (i.e. motor controller API calls)
functionality is insulated from the rest of the robot code within
the library-specific modules in this directory.

* FlywheelIO.java
The base subsystem I/O (input/output) interface that contains the
structure and class varibales needed by the library-specific modules.

* FlywheelIOSim.java
Simulated flywheel module, for use with robot simulations, does not
control actual hardware.

* FlywheelIOSparkMax.java
An example implementation of a flywheel using Rev SparkMax motor
controllers (and their associated library APIs).

* FlywheelIOTalonFX.java
An example implementation of a flywheel using CTRE TalonFX motor
controllers (and their associated library APIs).

--------------------
When creating a new mechanism subsystem, consider using this generic framework
for public vs. private functions and API calls to make your code more modular
and reusable from year to year. Additionally, the I/O framework given here
interfaces with AdvantageKit's logging to allow for replay of inputs and
testing of code changes in simulation.

0 comments on commit 0ba542c

Please sign in to comment.