-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into vision
- Loading branch information
Showing
11 changed files
with
298 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle | ||
|
||
name: Java CI with Gradle | ||
|
||
on: | ||
push: | ||
branches: [ '*' ] | ||
pull_request: | ||
branches: [ '*' ] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
- name: Build with Gradle | ||
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0 | ||
with: | ||
arguments: build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Artemis - 2024 | ||
The repository for Artemis, Team 2976 The Spartabots' robot for the 2024 FIRST Robotics Competition. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package frc.robot.commands; | ||
|
||
import edu.wpi.first.math.controller.ProfiledPIDController; | ||
import edu.wpi.first.math.trajectory.TrapezoidProfile; | ||
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; | ||
import edu.wpi.first.wpilibj2.command.Command; | ||
import frc.robot.subsystems.Pivot; | ||
import frc.robot.subsystems.Pivot.PivotState;; | ||
|
||
public class SetPivot extends Command { | ||
Pivot s_Pivot; | ||
PivotState state; | ||
ProfiledPIDController pivotController = new ProfiledPIDController(0.06, 1e-2, 1e-3, new TrapezoidProfile.Constraints(500000, 3000*1e5)); | ||
|
||
public SetPivot(PivotState state) { | ||
s_Pivot = Pivot.getInstance(); | ||
this.state = state; | ||
addRequirements(s_Pivot); | ||
} | ||
|
||
@Override | ||
public void initialize() { | ||
s_Pivot.setState(state); | ||
pivotController.reset(s_Pivot.getCANcoderPosition()); | ||
} | ||
|
||
@Override | ||
public void execute() { | ||
double voltage = pivotController.calculate(s_Pivot.getCANcoderPosition(), s_Pivot.getSetPoint()); | ||
if (Math.abs(s_Pivot.getCANcoderPosition() - s_Pivot.getSetPoint()) < 15) { | ||
voltage = 0.7; | ||
} | ||
s_Pivot.setVoltage(voltage); | ||
} | ||
|
||
@Override | ||
public boolean isFinished() { | ||
return Math.abs(s_Pivot.getSetPoint() - s_Pivot.getCANcoderPosition()) < 45; | ||
} | ||
|
||
@Override | ||
public void end(boolean interrupted) { | ||
s_Pivot.setVoltage(0); | ||
SmartDashboard.putString("eleEnd", "elevator end"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package frc.robot.commands; | ||
|
||
import edu.wpi.first.wpilibj2.command.Command; | ||
import frc.robot.subsystems.IntakeShooter; | ||
|
||
public class SmartIntake extends Command{ | ||
|
||
private final IntakeShooter s_IntakeShooter; | ||
|
||
public SmartIntake(){ | ||
s_IntakeShooter = IntakeShooter.getInstance(); | ||
addRequirements(s_IntakeShooter); | ||
} | ||
|
||
@Override | ||
public void initialize() { | ||
s_IntakeShooter.setIntake(0.7); | ||
} | ||
|
||
@Override | ||
public void execute() { | ||
} | ||
|
||
@Override | ||
public void end(boolean interrupted) { | ||
s_IntakeShooter.setIntake(0); | ||
} | ||
|
||
@Override | ||
public boolean isFinished() { | ||
return s_IntakeShooter.hasNote(); | ||
} | ||
|
||
|
||
|
||
} |
16 changes: 16 additions & 0 deletions
16
src/main/java/frc/robot/commands/TeleopCommandFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package frc.robot.commands; | ||
|
||
import edu.wpi.first.wpilibj2.command.Command; | ||
import frc.robot.subsystems.IntakeShooter; | ||
import frc.robot.subsystems.Swerve; | ||
|
||
public class TeleopCommandFactory extends Command{ | ||
private static Command selectedTeleopCommand; | ||
|
||
private static IntakeShooter s_IntakeShooter = IntakeShooter.getInstance(); | ||
private static Swerve s_Swerve = Swerve.getInstance(); | ||
|
||
public TeleopCommandFactory(){ | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.