Skip to content

Commit fb7c914

Browse files
Merge pull request fairviewrobotics#29 from edwardwawrzynek/master
Update to 2021 gradleRIO, and run shooter during gate pulse in CompositeShoot
2 parents 9d0fa3c + 35ee3e7 commit fb7c914

File tree

4 files changed

+7
-11
lines changed

4 files changed

+7
-11
lines changed

.wpilib/wpilib_preferences.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"enableCppIntellisense": false,
33
"currentLanguage": "java",
4-
"projectYear": "2020",
4+
"projectYear": "2021",
55
"teamNumber": 2036
6-
}
6+
}

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id "java"
3-
id "edu.wpi.first.GradleRIO" version "2020.3.2"
3+
id "edu.wpi.first.GradleRIO" version "2021.3.1"
44
id "org.jetbrains.kotlin.jvm" version "1.3.50"
55
}
66

src/main/kotlin/frc/robot/RobotContainer.kt

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,9 @@ class RobotContainer {
209209
gate.defaultCommand = SensoredFixedGateSpeed(gate, {
210210
if (controller0.xButton) Constants.kGateSpeed else (
211211
if (controller0.bButton) -Constants.kGateSpeed else (
212-
if (controller0.getBumper(kLeft)) Constants.kGateLoadSpeed else 0.0
212+
if (controller0.getBumper(kLeft)) Constants.kGateLoadSpeed else (
213+
if (controller0.getTriggerAxis(kLeft) >= Constants.kTriggerThresh) -Constants.kGateLoadSpeed else 0.0
214+
)
213215
))
214216
}, {
215217
/* only run in sensored mode if controller0 left bumper held */
@@ -254,13 +256,6 @@ class RobotContainer {
254256
}
255257

256258
fun getAutonomousCommand(): Command {
257-
if (gate.isBallTriggered()) {
258-
return pathPlanningCommand("paths/") // update
259-
} else{
260-
return pathPlanningCommand("paths/")
261-
}
262-
263-
264259
// Return the selected command
265260
return m_autoCommandChooser.selected
266261
}

src/main/kotlin/frc/robot/commands/CompositeShoot.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ class CompositeShoot(val intakeSubsystem: IntakeSubsystem, val indexerSubsystem:
4141
/* run shooter full speed */
4242
/* wait for a time to run gate to allow */
4343
if (timer.get() > Constants.kShooterSpinUpTime) {
44+
shooterSubsystem.setSpeed(Constants.kShooterSpeed)
4445
/* pulse gate to slow down balls going into shooter */
4546
if (timer.get() % Constants.kGatePulseTime < Constants.kGatePulseTime / 2) {
4647
gateSubsystem.setSpeed(Constants.kGateSpeed)

0 commit comments

Comments
 (0)