Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

package frc.robot;

import static edu.wpi.first.units.Units.MetersPerSecond;
import static edu.wpi.first.units.Units.RadiansPerSecond;

import org.littletonrobotics.junction.LoggedRobot;
import org.littletonrobotics.junction.Logger;

Expand All @@ -23,6 +26,7 @@
import frc.robot.drivetrain.CommandSwerveDrivetrain;
import frc.robot.drivetrain.TunerConstants;
import frc.robot.operator.OperatorXbox;
import frc.robot.RobotContainer.*;

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

Expand Down Expand Up @@ -119,6 +123,8 @@ public void autonomousInit() {

}



/**
* This function is called periodically during autonomous.
*/
Expand Down Expand Up @@ -148,14 +154,7 @@ private Command runDrivetrain() {

@Override
public void autonomousPeriodic() {
// CommandSwerveDrivetrain.getInstance().applyRequest(() ->
// drive.withVelocityX(5.0 * kMaxVelocity)
// .withVelocityY(0.0)
// .withRotationalRate(0.0)
// );

// runDrivetrain();


}

@Override
Expand Down
16 changes: 5 additions & 11 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,21 @@
import frc.robot.subsystems.CoralSubsystem;
import frc.robot.subsystems.ElevatorSubsystem;


/**
* This class is where the bulk of the robot should be declared. Since Command-based is a
* "declarative" paradigm, very little robot logic should actually be handled in the {@link Robot}
* periodic methods (other than the scheduler calls). Instead, the structure of the robot (including
* subsystems, commands, and trigger mappings) should be declared here.
*/
public class RobotContainer {
private final double kMaxVelocity = TunerConstants.kSpeedAt12Volts.in(MetersPerSecond);
private final double kMaxAngularVelocity = RotationsPerSecond.of(0.75).in(RadiansPerSecond);
public static double kMaxVelocity = TunerConstants.kSpeedAt12Volts.in(MetersPerSecond);
public static double kMaxAngularVelocity = RotationsPerSecond.of(0.75).in(RadiansPerSecond);

public static boolean modeFast = true;

/* Setting up bindings for necessary control of the swerve drive platform */
private final SwerveRequest.FieldCentric drive = new SwerveRequest.FieldCentric()
public static SwerveRequest.FieldCentric drive = new SwerveRequest.FieldCentric()
.withDeadband(kMaxVelocity * 0.1)
.withRotationalDeadband(kMaxAngularVelocity * 0.1) // Add a 10% deadband
.withDriveRequestType(DriveRequestType.OpenLoopVoltage); // Use open-loop control for drive motors
Expand All @@ -41,14 +42,7 @@ public RobotContainer() {
setDefaultCommands();
}

// /**
// * Use this to pass the autonomous command to the main {@link Robot} class.
// *
// * @return the command to run in autonomous
// */
// public Command getAutonomousCommand() {
// return mAutonChooser.getSelected();
// }


public void setDefaultCommands() {
final var driver = DriverXbox.getInstance();
Expand Down