Skip to content

Commit 9e5bb0b

Browse files
committed
Add LaunchPrepare
1 parent 6c83117 commit 9e5bb0b

File tree

3 files changed

+68
-2
lines changed

3 files changed

+68
-2
lines changed

.Glass/glass.json

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,30 @@
11
{
22
"NetworkTables": {
3+
"retained": {
4+
"SmartDashboard": {
5+
"Autonomous": {
6+
"open": true
7+
},
8+
"open": true
9+
}
10+
},
311
"transitory": {
12+
"Shuffleboard": {
13+
"open": true
14+
},
415
"SmartDashboard": {
16+
"Driver": {
17+
"open": true
18+
},
519
"Drivetrain": {
620
"open": true
721
},
22+
"Launcher": {
23+
"Amp": {
24+
"open": true
25+
},
26+
"open": true
27+
},
828
"open": true
929
}
1030
},
@@ -19,5 +39,49 @@
1939
"NetworkTables Settings": {
2040
"mode": "Client (NT4)",
2141
"serverTeam": "694"
42+
},
43+
"Plots": {
44+
"Plot <0>": {
45+
"plots": [
46+
{
47+
"backgroundColor": [
48+
0.0,
49+
0.0,
50+
0.0,
51+
0.8500000238418579
52+
],
53+
"height": 332,
54+
"series": [
55+
{
56+
"color": [
57+
0.2980392277240753,
58+
0.44705885648727417,
59+
0.6901960968971252,
60+
1.0
61+
],
62+
"id": "NT:/SmartDashboard/Launcher/Feeder Output Speed"
63+
},
64+
{
65+
"color": [
66+
0.8666667342185974,
67+
0.5176470875740051,
68+
0.32156863808631897,
69+
1.0
70+
],
71+
"id": "NT:/SmartDashboard/Launcher/Launcher Output Speed"
72+
},
73+
{
74+
"color": [
75+
0.3333333432674408,
76+
0.658823549747467,
77+
0.4078431725502014,
78+
1.0
79+
],
80+
"id": "NT:/SmartDashboard/Launcher/Launcher Velocity"
81+
}
82+
]
83+
}
84+
]
85+
}
2286
}
2387
}

src/main/java/com/stuypulse/robot/RobotContainer.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77

88
import com.stuypulse.robot.commands.auton.DoNothingAuton;
99
import com.stuypulse.robot.commands.drivetrain.DrivetrainDrive;
10+
import com.stuypulse.robot.commands.launcher.LaunchPrepare;
1011
import com.stuypulse.robot.commands.launcher.LauncherHoldSpeed;
1112
import com.stuypulse.robot.commands.launcher.LauncherLaunchSpeaker;
1213
import com.stuypulse.robot.commands.launcher.LauncherIntakeNote;
14+
import com.stuypulse.robot.commands.launcher.LauncherLaunch;
1315
import com.stuypulse.robot.commands.launcher.LauncherStop;
1416
import com.stuypulse.robot.constants.Ports;
1517
import com.stuypulse.robot.constants.Settings;
@@ -68,7 +70,7 @@ private void configureDriverBindings() {
6870
.whileTrue(new LauncherIntakeNote());
6971

7072
driver.getBottomButton()
71-
.whileTrue(new LauncherLaunchSpeaker());
73+
.whileTrue(new LaunchPrepare(Settings.Launcher.LAUNCHER_AMP_SPEED, Settings.Launcher.AMP_THRESHOLD_RPM).andThen(new LauncherLaunch(Settings.Launcher.FEEDER_AMP_SPEED, Settings.Launcher.LAUNCHER_AMP_SPEED)));
7274
}
7375

7476
private void configureOperatorBindings() {}

src/main/java/com/stuypulse/robot/commands/launcher/LaunchPrepare.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ public void initialize() {
3030

3131
@Override
3232
public boolean isFinished() {
33-
return launcher.getLauncherVelocity() >= thresholdRPM.doubleValue();
33+
return Math.abs(launcher.getLauncherVelocity() - thresholdRPM.doubleValue()) < 100;
3434
}
3535
}

0 commit comments

Comments
 (0)