Skip to content

Commit

Permalink
Gil - changes
Browse files Browse the repository at this point in the history
  • Loading branch information
greenblitz4590 committed Jun 15, 2024
1 parent 6318d2d commit e959e80
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
package org.firstinspires.ftc.teamcode.subsystems.launcher;

import com.arcrobotics.ftclib.command.SubsystemBase;
import com.arcrobotics.ftclib.hardware.SimpleServo;
import com.qualcomm.robotcore.hardware.HardwareMap;
import com.qualcomm.robotcore.hardware.Servo;

import org.firstinspires.ftc.robotcore.external.Telemetry;

public class Launcher extends SubsystemBase {
private SimpleServo servo;
private final Servo servo;

public Launcher(HardwareMap hardwareMap) {
this.servo = new SimpleServo(hardwareMap,
LauncherConstants.SERVO_ID,
LauncherConstants.MIN_ANGLE,
LauncherConstants.MAX_ANGLE
);
this.servo = hardwareMap.servo.get(LauncherConstants.SERVO_ID);
servo.setPosition(LauncherConstants.CLOSED_POSITION);
}

Expand All @@ -26,7 +22,7 @@ protected void launchPlane() {
servo.setPosition(LauncherConstants.RELEASED_POSITION);
}

public boolean isFullyReleased() {
public boolean isPlaneLaunched() {
return getPosition() == LauncherConstants.RELEASED_POSITION;
}

Expand All @@ -36,7 +32,7 @@ public boolean isClosed() {

public void telemetry(Telemetry telemetry) {
telemetry.addData("launcher servo currentPos: ", getPosition());
telemetry.addData("is launcher fully released: ", isFullyReleased());
telemetry.addData("is launcher fully released: ", isPlaneLaunched());
telemetry.addData("is launcher closed: ", isClosed());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@ class LauncherConstants {
protected static final String SERVO_ID = "launcher_servo";
protected static final double RELEASED_POSITION = 0;
protected static final double CLOSED_POSITION = 0.5;
protected static final double MIN_ANGLE = 0;
protected static final double MAX_ANGLE = 360;
}

0 comments on commit e959e80

Please sign in to comment.