Skip to content

Commit

Permalink
made the strings for Hardware.java and setup.java. also i made setup …
Browse files Browse the repository at this point in the history
…on Robot.java and Hardware.java work also this builds
  • Loading branch information
TechnototesLaptop committed Oct 19, 2024
1 parent f0941a5 commit 171cc93
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,12 @@ public class Hardware implements Loggable {
public List<LynxModule> hubs;

public IMU imu;
public EncodedMotor<DcMotorEx> fl, fr, rl, rr;
public EncodedMotor<DcMotorEx> fl, fr, rl, rr, suspend, armL, armR;
public MotorEncoder odoF, odoR;
public Servo retainer, jaw;
public CRServo intake;
public ColorSensor colorSensor;
public Rev2MDistanceSensor rev2MDistanceSensor;
public EncodedMotor suspend;
public EncodedMotor suspendReverse;

/* Put other hardware here! */

public Hardware(HardwareMap hwmap) {
Expand Down Expand Up @@ -58,8 +55,11 @@ public Hardware(HardwareMap hwmap) {
rev2MDistanceSensor = new Rev2MDistanceSensor(Setup.HardwareNames.DIST1);
}
if (Setup.Connected.HANGSUBSYSTEM) {
suspend = new EncodedMotor(Setup.HardwareNames.SUSPEND);
suspendReverse = new EncodedMotor(Setup.HardwareNames.SUSPENDREVERSE);
suspend = new EncodedMotor<>(Setup.HardwareNames.SUSPEND);
}
if (Setup.Connected.ARMSUBSYSTEM) {
armL = new EncodedMotor<>(Setup.HardwareNames.ARML);
armR = new EncodedMotor<>(Setup.HardwareNames.ARMR);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public class Robot implements Loggable {
public TwoDeadWheelLocalizer localizer;
public SafetySubsystem safetySubsystem;
public HangSubsystem hangSubsystem;
// public ArmSubsystem armSubsytem;

public Robot(Hardware hw, Alliance team, StartingPosition pos) {
this.position = pos;
Expand Down Expand Up @@ -53,5 +54,8 @@ public Robot(Hardware hw, Alliance team, StartingPosition pos) {
if (Setup.Connected.HANGSUBSYSTEM) {
this.hangSubsystem = new HangSubsystem(hw);
}
if (Setup.Connected.ARMSUBSYSTEM) {
// this.armSubsytem = new ArmSubsystem(hw);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public static class Connected {
public static boolean SAFETYSUBSYSTEM = false;
public static boolean KIDSSHAMPOOSUBSYSTEM = true;
public static boolean HANGSUBSYSTEM = true;
public static boolean ARMSUBSYSTEM = true;
}

@Config
Expand All @@ -30,7 +31,8 @@ public static class HardwareNames {
public static String COLOR1 = "color";
public static String DIST1 = "dist";
public static String SUSPEND = "suspend";
public static String SUSPENDREVERSE = "suspend reverse";
public static String ARML = "armL";
public static String ARMR = "armR";

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ private void AssignNamedControllerButton() {
biteJaw = gamepad.ps_cross;
releaseJaw = gamepad.ps_triangle;
Suspend = gamepad.ps_circle;
SuspendReverse= gamepad.ps_circle;
}

public void BindControls() {
Expand All @@ -65,6 +64,6 @@ public void bindKidShampooControls() {

public void bindHangControls() {
Suspend.whenPressed(Command.create(robot.hangSubsystem::Suspend, robot.hangSubsystem));
SuspendReverse.whenReleased(Command.create(robot.hangSubsystem::Supendreverse, robot.hangSubsystem));

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,18 @@
public class HangSubsystem implements Subsystem, Loggable {

private EncodedMotor suspend;
private EncodedMotor suspendReverse;

public static double SUSPEND_POSITION = .4;
public static double SUSPENDREVERSE_POSITION = .4;

public static double SUSPEND_POSITION = .4;

public HangSubsystem(Hardware hw) {
suspend = hw.suspend;
suspendReverse = hw.suspendReverse.setBackward();
}


public void Suspend() {
suspend.setPosition(SUSPEND_POSITION);
}
public void Supendreverse() {
suspendReverse.setPosition(SUSPENDREVERSE_POSITION);
}

@Override
public void periodic() {

}
}
}

0 comments on commit 171cc93

Please sign in to comment.