-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stopoff on the way toward CTRE-centric swerve
modified: src/main/java/frc/robot/Constants.java modified: src/main/java/frc/robot/RobotContainer.java modified: src/main/java/frc/robot/commands/swervedrive/auto/AutoBalanceCommand.java modified: src/main/java/frc/robot/commands/swervedrive/drivebase/AbsoluteDrive.java modified: src/main/java/frc/robot/commands/swervedrive/drivebase/AbsoluteDriveAdv.java modified: src/main/java/frc/robot/commands/swervedrive/drivebase/AbsoluteFieldDrive.java new file: src/main/java/frc/robot/generated/README modified: src/main/java/frc/robot/generated/TunerConstants.java new file: src/main/java/frc/robot/subsystems/swervedrive/SwerveSubsystem.java renamed: src/main/java/frc/robot/subsystems/swervedrive_phoenix/CommandSwerveDrivetrain.java -> src/main/java/frc/robot/subsystems/swervedrive/underlying/Phoenix6Swerve.java renamed: src/main/java/frc/robot/subsystems/swervedrive_yagsl/SwerveSubsystem.java -> src/main/java/frc/robot/subsystems/swervedrive/underlying/YAGSLSwerve.java deleted: src/main/java/frc/robot/util/YAGSL_AzRBSI/CANCoderSwerve_RBSI.java deleted: src/main/java/frc/robot/util/YAGSL_AzRBSI/DeviceJson_RBSI.java deleted: src/main/java/frc/robot/util/YAGSL_AzRBSI/Pigeon2Swerve_RBSI.java deleted: src/main/java/frc/robot/util/YAGSL_AzRBSI/README deleted: src/main/java/frc/robot/util/YAGSL_AzRBSI/SwerveDriveJson_RBSI.java deleted: src/main/java/frc/robot/util/YAGSL_AzRBSI/SwerveParser_RBSI.java deleted: src/main/java/frc/robot/util/YAGSL_AzRBSI/TalonFXSwerve_RBSI.java
- Loading branch information
Showing
18 changed files
with
101 additions
and
1,337 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
This directory, and in particular the TunerConstants.java file, are the | ||
Phoenix6 equivalent of the ``src/main/deploy/swerve`` directory for YAGSL. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
src/main/java/frc/robot/subsystems/swervedrive/SwerveSubsystem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// Copyright (c) 2024 Az-FIRST | ||
// http://github.com/AZ-First | ||
// | ||
// This program is free software; you can redistribute it and/or | ||
// modify it under the terms of the GNU General Public License | ||
// version 3 as published by the Free Software Foundation or | ||
// available in the root directory of this project. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// Copyright (c) FIRST and other WPILib contributors. | ||
// Open Source Software; you can modify and/or share it under the terms of | ||
// the WPILib BSD license file in the root directory of this project. | ||
|
||
package frc.robot.subsystems.swervedrive; | ||
|
||
import edu.wpi.first.wpilibj.Filesystem; | ||
import frc.robot.Constants.SwerveType; | ||
import frc.robot.generated.TunerConstants; | ||
import frc.robot.subsystems.swervedrive.underlying.Phoenix6Swerve; | ||
import frc.robot.subsystems.swervedrive.underlying.YAGSLSwerve; | ||
import java.io.File; | ||
|
||
/** | ||
* Az-RBSI swerve class that generalizes the swerve subsystem to allow for the use of either | ||
* Phoenix6 or YAGSL underlying libraries | ||
*/ | ||
public class SwerveSubsystem extends Phoenix6Swerve { | ||
|
||
private YAGSLSwerve y_swerve; | ||
|
||
public SwerveSubsystem(Enum<SwerveType> swerveType) { | ||
|
||
if (swerveType == SwerveType.YAGSL) { | ||
|
||
// Load up the YASGL things into this class | ||
y_swerve = new YAGSLSwerve(new File(Filesystem.getDeployDirectory(), "swerve")); | ||
|
||
} else if (swerveType == SwerveType.PHOENIX6) { | ||
|
||
// Load up the Phoenix6 things into this class | ||
p_swerve = TunerConstants.DriveTrain; | ||
|
||
} else { | ||
|
||
// Raise an error because something unknown was passed | ||
|
||
} | ||
} | ||
|
||
// | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.