Skip to content

Commit

Permalink
Merge branch '8/port-drive-subsystem-to-command-robot' of https://git…
Browse files Browse the repository at this point in the history
…hub.com/Simbotics/Simbot-Base into 8/port-drive-subsystem-to-command-robot
  • Loading branch information
IanTapply22 committed Jan 4, 2024
2 parents fc8f5c3 + a01407a commit f01bdaf
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
38 changes: 20 additions & 18 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,25 @@
import frc.robot.subsystems.led.LEDSubsystem;

public class RobotContainer {
private class Controller {
public static final CommandController driver = new CommandController(0);
public static final CommandController operator = new CommandController(1);
}
private class Controller {
public static final CommandController driver = new CommandController(0);
public static final CommandController operator = new CommandController(1);
}

private final LEDSubsystem ledSubsystem;
private final LEDSubsystem ledSubsystem;

// Set up the base for the drive and drivetrain
final DriveSubsystem drivetrain = DriveConstants.DriveTrain;
private final SwerveRequest.FieldCentric drive = new SwerveRequest.FieldCentric()
.withDeadband(DriveConstants.kMaxAngularRate * 0.1).withRotationalDeadband(DriveConstants.kMaxAngularRate * 0.1)
.withDriveRequestType(DriveRequestType.OpenLoopVoltage);
// Set up the base for the drive and drivetrain
final DriveSubsystem drivetrain = DriveConstants.DriveTrain;
private final SwerveRequest.FieldCentric drive =
new SwerveRequest.FieldCentric()
.withDeadband(DriveConstants.kMaxAngularRate * 0.1)
.withRotationalDeadband(DriveConstants.kMaxAngularRate * 0.1)
.withDriveRequestType(DriveRequestType.OpenLoopVoltage);

/* Path follower */
private Command runAuto = drivetrain.getAutoPath("Tests");

private final Telemetry logger = new Telemetry(DriveConstants.kMaxSpeed);
private final Telemetry logger = new Telemetry(DriveConstants.kMaxSpeed);

private void configureBindings() {
ledSubsystem.setDefaultCommand(new InstantCommand(() -> ledSubsystem.periodic(), ledSubsystem));
Expand All @@ -53,12 +55,12 @@ private void configureBindings() {
.ignoringDisable(true));
}

public RobotContainer() {
configureBindings();
ledSubsystem = new LEDSubsystem();
}
public RobotContainer() {
configureBindings();
ledSubsystem = new LEDSubsystem();
}

public Command getAutonomousCommand() {
return runAuto;
}
public Command getAutonomousCommand() {
return runAuto;
}
}
4 changes: 3 additions & 1 deletion src/main/java/frc/robot/subsystems/drive/DriveConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
public class DriveConstants {
/** Only touch these if you know what you're doing */
private static final SlotGains steerGains = new SlotGains(100.0, 0, 0.05, 0, 0);

private static final SlotGains driveGains = new SlotGains(3.0, 0, 0, 0, 0);

public static final double kMaxSpeed = 6.0; // 6 meters per second desired top speed
public static final double kMaxAngularRate = Math.PI; // Half a rotation per second max angular velocity
public static final double kMaxAngularRate =
Math.PI; // Half a rotation per second max angular velocity

private static final double kCoupleRatio = 3.5;

Expand Down

0 comments on commit f01bdaf

Please sign in to comment.