yep heres our code
This is a full featured template repository designed to make setting up a new robot as easy as possible. We use the Phoenix 6 Swerve library to provide top of the line drivetrain responsiveness, along with the new PathPlanner setpoint generation API (based on a version created by team 254) to prevent skidding and wheel slipping.
This template comes with full simulation and replay support built in, which allow you to program the robot, without even having the robot finished yet. More information on replay usage can be found on the AdvantageKit documentation website.
Running the simulator on a fresh version of the code will give you a drivable robot, even without following any steps past step 1 in the "Use the template" section
All of the documentation needed for setup and more can be found on our documentation site.
- Either make a new repository with the "Use this template" button, fork this repository, or just download the zip file.
- Download WPILib
- Download the FRC Game Tools
- Download Tuner X
- Clone the repository you made (or open the downloaded version) and open it in WPILib VSCode.
- Run the
WPILib: Set Team Number
task from the WPILib icon in the VSCode toolbar and set your team number. - Connect to your robot
- Open Tuner X (run the temporary diagnostic server if your RoboRIO doesn't have code yet)
- Follow the swerve setup guide in the mechanisms tab
- In the final step of the swerve setup, choose the
Generate only TunerConstants
option and overwrite the file atsrc/main/java/frc/robot/generated/TunerConstants.java
. - Inside the TunerConstants.java file, change the last import and the last method in the file
- import frc.robot.subsystems.CommandSwerveDrivetrain;
+ import frc.robot.subsystems.drive.DriveIOCTRE;
- public static CommandSwerveDrivetrain createDrivetrain() {
- return new CommandSwerveDrivetrain(
- DrivetrainConstants, FrontLeft, FrontRight, BackLeft, BackRight
- );
- }
+ public static DriveIOCTRE createDrivetrain() {
+ return new DriveIOCTRE(
+ DrivetrainConstants,
+ FrontLeft, FrontRight, BackLeft, BackRight
+ );
+ }
If you followed all of these steps, your robot should be drivable now!
You can improve your driving experience drastically by following the steps in this guide. Make sure you tune your drivetrain again after your robot is assembled, since adding weight to your robot will change a lot of physical properties of how it will act.
Feel free to create a GitHub issue and we'll try to help out as quickly as possible.