diff --git a/Ptechnodactyl/src/main/java/org/firstinspires/ftc/ptechnodactyl/Hardware.java b/Ptechnodactyl/src/main/java/org/firstinspires/ftc/ptechnodactyl/Hardware.java index 9d90993..930868d 100644 --- a/Ptechnodactyl/src/main/java/org/firstinspires/ftc/ptechnodactyl/Hardware.java +++ b/Ptechnodactyl/src/main/java/org/firstinspires/ftc/ptechnodactyl/Hardware.java @@ -73,12 +73,8 @@ public Hardware(HardwareMap hwmap) { // } } if (Setup.Connected.CLAWSUBSYSTEM) { - if (Setup.Connected.CLAWSERVO) { - this.clawServo = new Servo(Setup.HardwareNames.CLAWSERVO); - } - if (Setup.Connected.ARM) { - this.arm = new EncodedMotor<>(Setup.HardwareNames.ARM); - } + this.clawServo = new Servo(Setup.HardwareNames.CLAWSERVO); + this.arm = new EncodedMotor<>(Setup.HardwareNames.ARM); } } diff --git a/Ptechnodactyl/src/main/java/org/firstinspires/ftc/ptechnodactyl/Robot.java b/Ptechnodactyl/src/main/java/org/firstinspires/ftc/ptechnodactyl/Robot.java index f248d56..0a34a72 100644 --- a/Ptechnodactyl/src/main/java/org/firstinspires/ftc/ptechnodactyl/Robot.java +++ b/Ptechnodactyl/src/main/java/org/firstinspires/ftc/ptechnodactyl/Robot.java @@ -2,6 +2,7 @@ import com.technototes.library.logger.Loggable; import com.technototes.library.util.Alliance; +import org.firstinspires.ftc.ptechnodactyl.Hardware; import org.firstinspires.ftc.ptechnodactyl.helpers.StartingPosition; import org.firstinspires.ftc.ptechnodactyl.subsystems.ClawSubsystem; import org.firstinspires.ftc.ptechnodactyl.subsystems.DrivebaseSubsystem; @@ -25,5 +26,8 @@ public Robot(Hardware hw) { hw.imu ); } + if (Setup.Connected.CLAWSUBSYSTEM) { + this.clawSubsystem = new ClawSubsystem(hw); + } } } diff --git a/Ptechnodactyl/src/main/java/org/firstinspires/ftc/ptechnodactyl/Setup.java b/Ptechnodactyl/src/main/java/org/firstinspires/ftc/ptechnodactyl/Setup.java index a8c3203..6e5e015 100644 --- a/Ptechnodactyl/src/main/java/org/firstinspires/ftc/ptechnodactyl/Setup.java +++ b/Ptechnodactyl/src/main/java/org/firstinspires/ftc/ptechnodactyl/Setup.java @@ -18,7 +18,7 @@ public static class Connected { public static boolean COLOR_SENSOR = false; public static boolean FLYWHEEL = false; public static boolean WEBCAM = false; - public static boolean EXTERNAL_IMU = true; + public static boolean EXTERNAL_IMU = false; } @Config diff --git a/Ptechnodactyl/src/main/java/org/firstinspires/ftc/ptechnodactyl/opmodes/tele/JustDrivingTeleOp.java b/Ptechnodactyl/src/main/java/org/firstinspires/ftc/ptechnodactyl/opmodes/tele/JustDrivingTeleOp.java index e1a3154..014e007 100644 --- a/Ptechnodactyl/src/main/java/org/firstinspires/ftc/ptechnodactyl/opmodes/tele/JustDrivingTeleOp.java +++ b/Ptechnodactyl/src/main/java/org/firstinspires/ftc/ptechnodactyl/opmodes/tele/JustDrivingTeleOp.java @@ -4,6 +4,7 @@ import com.acmerobotics.dashboard.telemetry.MultipleTelemetry; import com.qualcomm.robotcore.eventloop.opmode.TeleOp; import com.technototes.library.command.CommandScheduler; +import com.technototes.library.logger.Loggable; import com.technototes.library.structure.CommandOpMode; import com.technototes.library.util.Alliance; import org.firstinspires.ftc.ptechnodactyl.Hardware; @@ -16,7 +17,7 @@ @TeleOp(name = "Driving w/Turbo!") @SuppressWarnings("unused") -public class JustDrivingTeleOp extends CommandOpMode { +public class JustDrivingTeleOp extends CommandOpMode implements Loggable { public Robot robot; public DriverController controlsDriver; diff --git a/Ptechnodactyl/src/main/java/org/firstinspires/ftc/ptechnodactyl/subsystems/ClawSubsystem.java b/Ptechnodactyl/src/main/java/org/firstinspires/ftc/ptechnodactyl/subsystems/ClawSubsystem.java index 6979af2..cc09356 100644 --- a/Ptechnodactyl/src/main/java/org/firstinspires/ftc/ptechnodactyl/subsystems/ClawSubsystem.java +++ b/Ptechnodactyl/src/main/java/org/firstinspires/ftc/ptechnodactyl/subsystems/ClawSubsystem.java @@ -4,16 +4,14 @@ import com.acmerobotics.roadrunner.control.PIDCoefficients; import com.acmerobotics.roadrunner.control.PIDFController; import com.qualcomm.robotcore.hardware.DcMotorEx; -import com.qualcomm.robotcore.util.Range; import com.technototes.library.hardware.motor.EncodedMotor; import com.technototes.library.hardware.servo.Servo; import com.technototes.library.logger.Log; -import com.technototes.library.logger.Loggable; import com.technototes.library.subsystem.Subsystem; import org.firstinspires.ftc.ptechnodactyl.Hardware; @Config -public class ClawSubsystem implements Subsystem, Loggable { +public class ClawSubsystem implements Subsystem { private Servo clawServo; private EncodedMotor arm; @@ -105,6 +103,12 @@ The downward torque due to gravity is cos(T) * Gravity (9.8m/s^2) setArmPos(INITIAL_POSITION); } + public ClawSubsystem() { + isHardware = false; + clawServo = null; + arm = null; + } + public void increment(double value) { int newArmPos = (int) (armTargetPos + value * INCREMENT_DECREMENT); // if (newArmPos > ARM_MAX) {