Basic Swerve Impl
This commit is contained in:
parent
2afbef5052
commit
f3798cf2d4
|
|
@ -1,4 +1,4 @@
|
||||||
frcYear = 2026
|
frcYear = 2026
|
||||||
wpiVersion = 2026.1.1
|
wpiVersion = 2026.2.1
|
||||||
|
|
||||||
ctreVersion = 26.1.0
|
ctreVersion = 26.1.0
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit 12bef1b6a03a820e7a2d4f68e7f7375e040a9245
|
Subproject commit 6f233e586fa8b5882c6346750677276c78c82ff7
|
||||||
|
|
@ -4,13 +4,16 @@
|
||||||
|
|
||||||
package frc.robot;
|
package frc.robot;
|
||||||
|
|
||||||
|
import org.fairportrobotics.frc.robolib.DriveSystems.SwerveDrive.SwerveBuilder;
|
||||||
|
import org.fairportrobotics.frc.robolib.DriveSystems.SwerveDrive.SwerveDriveSubsystem;
|
||||||
|
|
||||||
|
import edu.wpi.first.wpilibj2.command.Command;
|
||||||
|
import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
|
||||||
|
import edu.wpi.first.wpilibj2.command.button.Trigger;
|
||||||
import frc.robot.Constants.OperatorConstants;
|
import frc.robot.Constants.OperatorConstants;
|
||||||
import frc.robot.commands.Autos;
|
import frc.robot.commands.Autos;
|
||||||
import frc.robot.commands.ExampleCommand;
|
import frc.robot.commands.ExampleCommand;
|
||||||
import frc.robot.subsystems.ExampleSubsystem;
|
import frc.robot.subsystems.ExampleSubsystem;
|
||||||
import edu.wpi.first.wpilibj2.command.Command;
|
|
||||||
import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
|
|
||||||
import edu.wpi.first.wpilibj2.command.button.Trigger;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class is where the bulk of the robot should be declared. Since Command-based is a
|
* This class is where the bulk of the robot should be declared. Since Command-based is a
|
||||||
|
|
@ -26,10 +29,25 @@ public class RobotContainer {
|
||||||
private final CommandXboxController m_driverController =
|
private final CommandXboxController m_driverController =
|
||||||
new CommandXboxController(OperatorConstants.kDriverControllerPort);
|
new CommandXboxController(OperatorConstants.kDriverControllerPort);
|
||||||
|
|
||||||
|
public static SwerveDriveSubsystem driveSubsystem;
|
||||||
|
|
||||||
/** The container for the robot. Contains subsystems, OI devices, and commands. */
|
/** The container for the robot. Contains subsystems, OI devices, and commands. */
|
||||||
public RobotContainer() {
|
public RobotContainer() {
|
||||||
// Configure the trigger bindings
|
// Configure the trigger bindings
|
||||||
configureBindings();
|
configureBindings();
|
||||||
|
|
||||||
|
SwerveBuilder swerveBuilder = new SwerveBuilder();
|
||||||
|
|
||||||
|
driveSubsystem = swerveBuilder
|
||||||
|
.withCanbusName("Drive")
|
||||||
|
.withPigeonId(2)
|
||||||
|
.withSwerveModule(
|
||||||
|
swerveBuilder.new SwerveModuleBuilder()
|
||||||
|
.withDriveMotorId(1)
|
||||||
|
// There is a lot more in this object. But hopefully you get the point
|
||||||
|
.build()
|
||||||
|
).build();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue