intake coded

This commit is contained in:
DanTheMan-byte
2025-11-01 17:34:47 -05:00
parent 0c81ca6a1a
commit e7c18a671a
4 changed files with 59 additions and 13 deletions

View File

@@ -0,0 +1,16 @@
package org.firstinspires.ftc.teamcode.constants;
import com.acmerobotics.dashboard.config.Config;
@Config
public class ServoVars {
//Standard Naming Convention: servoName_VarInSentenceCase
public static double turret_Range = 355; //In Degrees
public static double turret_GearRatio = 0.9974;
public static double rejecter_Out = 1.0;
public static double rejecter_In = 0.0;
}

View File

@@ -13,17 +13,17 @@ import java.util.Objects;
public class Drivetrain implements Subsystem {
private GamepadEx gamepad;
private final GamepadEx gamepad;
public MultipleTelemetry TELE;
private String Mode = "Default";
private DcMotorEx fl;
private final DcMotorEx fl;
private DcMotorEx fr;
private DcMotorEx bl;
private DcMotorEx br;
private final DcMotorEx fr;
private final DcMotorEx bl;
private final DcMotorEx br;
private double defaultSpeed = 0.7;

View File

@@ -1,27 +1,56 @@
package org.firstinspires.ftc.teamcode.subsystems;
import static org.firstinspires.ftc.teamcode.constants.ServoVars.*;
import com.acmerobotics.dashboard.telemetry.MultipleTelemetry;
import com.arcrobotics.ftclib.gamepad.GamepadEx;
import com.qualcomm.robotcore.hardware.DcMotorEx;
import com.qualcomm.robotcore.hardware.Gamepad;
import com.rowanmcalpin.nextftc.core.Subsystem;
import com.qualcomm.robotcore.hardware.Servo;
import org.firstinspires.ftc.teamcode.utils.Robot;
public class Intake extends Subsystem {
private GamepadEx gamepad;
public class Intake implements Subsystem {
public MultipleTelemetry TELE;
private DcMotorEx intake;
private final DcMotorEx intake;
private final Servo kicker;
public Intake (Robot robot, MultipleTelemetry telemetry, GamepadEx gamepad){
private double intakePower = 0.0;
private double kickerPos = 0.0;
public Intake (Robot robot, MultipleTelemetry telemetry){
this.intake = robot.intake;
this.kicker = robot.rejecter;
}
public void setIntakePower (double pow){
this.intakePower = pow;
}
public double getIntakePower() {
return this.intakePower;
}
public void kickOut (){
this.kickerPos = rejecter_Out;
}
public void kickIn (){
this.kickerPos = rejecter_In;
}
@Override
public void update() {
kicker.setPosition(kickerPos);
intake.setPower(intakePower);
}
}

View File

@@ -1,5 +1,7 @@
package org.firstinspires.ftc.teamcode.subsystems;
import static org.firstinspires.ftc.teamcode.constants.ServoVars.*;
import com.acmerobotics.dashboard.telemetry.MultipleTelemetry;
import com.acmerobotics.roadrunner.Pose2d;
import com.arcrobotics.ftclib.controller.PIDController;
@@ -210,7 +212,6 @@ public class Shooter implements Subsystem {
//0.9974 * 355
}
@@ -224,7 +225,7 @@ public class Shooter implements Subsystem {
deltaAngle +=360;
}
deltaAngle /= (0.9974*355);
deltaAngle /= (turret_GearRatio*turret_Range);
return (0.5+deltaAngle) ;