Skip to content

Commit

Permalink
Merge branch '2024-beta' into 36/create-vision-subsystem
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Tapply authored Dec 4, 2023
2 parents e10568e + 5896726 commit 7c5a6ed
Show file tree
Hide file tree
Showing 21 changed files with 802 additions and 223 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ jobs:

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
- uses: actions/setup-java@v2
with:
java-version: 17
- uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'oracle'
- uses: axel-op/googlejavaformat-action@v3
with:
args: "--skip-sorting-imports --replace"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ Thank you to the following who has contributed, supplied the tools to make this
- [CTR Electronics](https://github.com/CrossTheRoadElec) - Provided an example and starter [repository](https://github.com/CrossTheRoadElec/Phoenix6-Examples/tree/main/java/SwerveWithPathPlanner) to build from
- [Ian Tapply](https://github.com/IanTapply22) - Main student contributor
- [Kaleb Dodd](https://github.com/kaleb-dodd) - Project coordinator
- [Cole MacPhail](https://github.com/colemacphail) - Project coordinator
- [Cole MacPhail](https://github.com/colemacphail) - Project coordinator
6 changes: 5 additions & 1 deletion src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.InstantCommand;
import frc.robot.generated.TunerConstants;
import frc.robot.subsystems.led.LEDSubsystem;

public class RobotContainer {
final double MaxSpeed = 6; // 6 meters per second desired top speed
Expand All @@ -20,6 +21,7 @@ public class RobotContainer {
CommandController driver = new CommandController(0); // Driver Controller
CommandController operator = new CommandController(1); // Operator Controller
CommandSwerveDrivetrain drivetrain = TunerConstants.DriveTrain; // My drivetrain
private final LEDSubsystem ledSubsystem;
SwerveRequest.FieldCentric drive =
new SwerveRequest.FieldCentric()
.withIsOpenLoop(true)
Expand All @@ -39,6 +41,8 @@ public class RobotContainer {
Pose2d odomStart = new Pose2d(0, 0, new Rotation2d(0, 0));

private void configureBindings() {
ledSubsystem.setDefaultCommand(new InstantCommand(() -> ledSubsystem.periodic(), ledSubsystem));

drivetrain.setDefaultCommand( // Drivetrain will execute this command periodically
drivetrain
.applyRequest(
Expand Down Expand Up @@ -67,7 +71,6 @@ private void configureBindings() {
// drivetrain.seedFieldRelative(new Pose2d(new Translation2d(), Rotation2d.fromDegrees(90)));
// }
drivetrain.registerTelemetry(logger::telemeterize);

driver.POVUp()
.whileTrue(
drivetrain.applyRequest(() -> forwardStraight.withVelocityX(0.5).withVelocityY(0)));
Expand All @@ -78,6 +81,7 @@ private void configureBindings() {

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

public Command getAutonomousCommand() {
Expand Down
60 changes: 29 additions & 31 deletions src/main/java/frc/robot/subsystems/intake/IntakeConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,33 @@

public class IntakeConstants {

/** Used when scoring/outtaking */
public class OuttakeSpeeds {
public static final double LOW_CUBE = 0.3;
public static final double LOW_CONE = 0.6;
public static final double LOW_CUBE_AUTO = 0.3;
public static final double LOW_CONE_AUTO = 1.0;

public static final double MID_CONE = 0.1;
public static final double MID_CONE_TIPPED = 0.8;
public static final double MID_CUBE = 0.25;
public static final double MID_CUBE_AUTO = 0.2;

public static final double HIGH_CONE = 0.15;
public static final double HIGH_CONE_AUTO = 0.15;
public static final double HIGH_CUBE = 0.55;
public static final double HIGH_CUBE_AUTO = 0.6;
}

public static final double INTAKING_SPEED = 0.95;

public static final int INTAKE_MOTOR_CHANNEL = 6;
public static final double INTAKE_AMP_THRESHOLD = 16;

// 20ms per periodic cycle * number of periodic cycles / 1000 to get as milliseconds
public static final double INTAKE_CUBE_DELAY = (20 * 15) / 1000;
public static final double INTAKE_CONE_DELAY = (20 * 18) / 1000;

public static final double HOLD_CONE_SPEED = 0.18;
public static final double HOLD_CUBE_SPEED = 0.15;


/** Used when scoring/outtaking */
public class OuttakeSpeeds {
public static final double LOW_CUBE = 0.3;
public static final double LOW_CONE = 0.6;
public static final double LOW_CUBE_AUTO = 0.3;
public static final double LOW_CONE_AUTO = 1.0;

public static final double MID_CONE = 0.1;
public static final double MID_CONE_TIPPED = 0.8;
public static final double MID_CUBE = 0.25;
public static final double MID_CUBE_AUTO = 0.2;

public static final double HIGH_CONE = 0.15;
public static final double HIGH_CONE_AUTO = 0.15;
public static final double HIGH_CUBE = 0.55;
public static final double HIGH_CUBE_AUTO = 0.6;
}

public static final double INTAKING_SPEED = 0.95;

public static final int INTAKE_MOTOR_CHANNEL = 6;
public static final double INTAKE_AMP_THRESHOLD = 16;

// 20ms per periodic cycle * number of periodic cycles / 1000 to get as milliseconds
public static final double INTAKE_CUBE_DELAY = (20 * 15) / 1000;
public static final double INTAKE_CONE_DELAY = (20 * 18) / 1000;

public static final double HOLD_CONE_SPEED = 0.18;
public static final double HOLD_CUBE_SPEED = 0.15;
}
Loading

0 comments on commit 7c5a6ed

Please sign in to comment.