File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Hoops/src/main/java/org/firstinspires/ftc/hoops/subsystems Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -12,8 +12,9 @@ public class LauncherSubsystem {
12
12
13
13
public static double MAX_MOTOR_VELOCITY = 1.0 ;
14
14
15
- boolean hasHardware ;
15
+ public static double MIN_MOTOR_VELOCITY = 0.25 ;
16
16
17
+ boolean hasHardware ;
17
18
EncodedMotor <DcMotorEx > top ;
18
19
EncodedMotor <DcMotorEx > bottom ;
19
20
@@ -38,8 +39,16 @@ public void Launch(double angleInDegrees) {
38
39
// Spin the motors
39
40
// TODO: make the motors spit the thing at the right angle
40
41
if (hasHardware ) {
41
- top .setVelocity (MAX_MOTOR_VELOCITY );
42
- bottom .setVelocity (MAX_MOTOR_VELOCITY );
42
+ if (angleInDegrees > 0 ) {
43
+ top .setVelocity (MAX_MOTOR_VELOCITY );
44
+ bottom .setVelocity (MIN_MOTOR_VELOCITY );
45
+ } else if (angleInDegrees < 0 ) {
46
+ top .setVelocity (MIN_MOTOR_VELOCITY );
47
+ bottom .setVelocity (MAX_MOTOR_VELOCITY );
48
+ } else {
49
+ top .setVelocity (MAX_MOTOR_VELOCITY );
50
+ bottom .setVelocity (MAX_MOTOR_VELOCITY );
51
+ }
43
52
}
44
53
}
45
54
You can’t perform that action at this time.
0 commit comments