Skip to content

Commit 6cb036a

Browse files
committed
Presto & Viggo's work on Ptechnodactyl
1 parent 995985f commit 6cb036a

File tree

5 files changed

+16
-11
lines changed

5 files changed

+16
-11
lines changed

Ptechnodactyl/src/main/java/org/firstinspires/ftc/ptechnodactyl/Hardware.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,8 @@ public Hardware(HardwareMap hwmap) {
7373
// }
7474
}
7575
if (Setup.Connected.CLAWSUBSYSTEM) {
76-
if (Setup.Connected.CLAWSERVO) {
77-
this.clawServo = new Servo(Setup.HardwareNames.CLAWSERVO);
78-
}
79-
if (Setup.Connected.ARM) {
80-
this.arm = new EncodedMotor<>(Setup.HardwareNames.ARM);
81-
}
76+
this.clawServo = new Servo(Setup.HardwareNames.CLAWSERVO);
77+
this.arm = new EncodedMotor<>(Setup.HardwareNames.ARM);
8278
}
8379
}
8480

Ptechnodactyl/src/main/java/org/firstinspires/ftc/ptechnodactyl/Robot.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import com.technototes.library.logger.Loggable;
44
import com.technototes.library.util.Alliance;
5+
import org.firstinspires.ftc.ptechnodactyl.Hardware;
56
import org.firstinspires.ftc.ptechnodactyl.helpers.StartingPosition;
67
import org.firstinspires.ftc.ptechnodactyl.subsystems.ClawSubsystem;
78
import org.firstinspires.ftc.ptechnodactyl.subsystems.DrivebaseSubsystem;
@@ -25,5 +26,8 @@ public Robot(Hardware hw) {
2526
hw.imu
2627
);
2728
}
29+
if (Setup.Connected.CLAWSUBSYSTEM) {
30+
this.clawSubsystem = new ClawSubsystem(hw);
31+
}
2832
}
2933
}

Ptechnodactyl/src/main/java/org/firstinspires/ftc/ptechnodactyl/Setup.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public static class Connected {
1818
public static boolean COLOR_SENSOR = false;
1919
public static boolean FLYWHEEL = false;
2020
public static boolean WEBCAM = false;
21-
public static boolean EXTERNAL_IMU = true;
21+
public static boolean EXTERNAL_IMU = false;
2222
}
2323

2424
@Config

Ptechnodactyl/src/main/java/org/firstinspires/ftc/ptechnodactyl/opmodes/tele/JustDrivingTeleOp.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.acmerobotics.dashboard.telemetry.MultipleTelemetry;
55
import com.qualcomm.robotcore.eventloop.opmode.TeleOp;
66
import com.technototes.library.command.CommandScheduler;
7+
import com.technototes.library.logger.Loggable;
78
import com.technototes.library.structure.CommandOpMode;
89
import com.technototes.library.util.Alliance;
910
import org.firstinspires.ftc.ptechnodactyl.Hardware;
@@ -16,7 +17,7 @@
1617

1718
@TeleOp(name = "Driving w/Turbo!")
1819
@SuppressWarnings("unused")
19-
public class JustDrivingTeleOp extends CommandOpMode {
20+
public class JustDrivingTeleOp extends CommandOpMode implements Loggable {
2021

2122
public Robot robot;
2223
public DriverController controlsDriver;

Ptechnodactyl/src/main/java/org/firstinspires/ftc/ptechnodactyl/subsystems/ClawSubsystem.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,14 @@
44
import com.acmerobotics.roadrunner.control.PIDCoefficients;
55
import com.acmerobotics.roadrunner.control.PIDFController;
66
import com.qualcomm.robotcore.hardware.DcMotorEx;
7-
import com.qualcomm.robotcore.util.Range;
87
import com.technototes.library.hardware.motor.EncodedMotor;
98
import com.technototes.library.hardware.servo.Servo;
109
import com.technototes.library.logger.Log;
11-
import com.technototes.library.logger.Loggable;
1210
import com.technototes.library.subsystem.Subsystem;
1311
import org.firstinspires.ftc.ptechnodactyl.Hardware;
1412

1513
@Config
16-
public class ClawSubsystem implements Subsystem, Loggable {
14+
public class ClawSubsystem implements Subsystem {
1715

1816
private Servo clawServo;
1917
private EncodedMotor<DcMotorEx> arm;
@@ -105,6 +103,12 @@ The downward torque due to gravity is cos(T) * Gravity (9.8m/s^2)
105103
setArmPos(INITIAL_POSITION);
106104
}
107105

106+
public ClawSubsystem() {
107+
isHardware = false;
108+
clawServo = null;
109+
arm = null;
110+
}
111+
108112
public void increment(double value) {
109113
int newArmPos = (int) (armTargetPos + value * INCREMENT_DECREMENT);
110114
// if (newArmPos > ARM_MAX) {

0 commit comments

Comments
 (0)