Compare commits
3 Commits
839837c844
...
70d0a17d75
Author | SHA1 | Date | |
---|---|---|---|
70d0a17d75 | |||
2be683701b | |||
52e21fd468 |
@ -55,6 +55,7 @@ public class PedroConstants {
|
||||
public static final String WRIST_SERVO = "wrist-servo";
|
||||
public static final String ARM_SERVO = "arm-servo";
|
||||
public static final String THUMB_SERVO = "thumb-servo";
|
||||
public static final String HOOK = "skyhook";
|
||||
|
||||
/*
|
||||
Pedro's parameters
|
||||
|
@ -153,6 +153,16 @@ public class CometBotAutoDevelopment {
|
||||
dualSlides.toHighBucketPosition();
|
||||
}
|
||||
}
|
||||
private void robotUp(){
|
||||
if(currentGamepad1.dpad_up && !previousGamepad1.dpad_up){
|
||||
|
||||
}
|
||||
}
|
||||
private void robotDown(){
|
||||
if(currentGamepad1.dpad_down && !previousGamepad1.dpad_down){
|
||||
|
||||
}
|
||||
}
|
||||
private void dualSlidesToFloorPosition() {
|
||||
if (currentGamepad2.dpad_down && !previousGamepad2.dpad_down) {
|
||||
dualSlides.toFloorPosition();
|
||||
|
@ -1,5 +1,6 @@
|
||||
package org.firstinspires.ftc.teamcode.subsystem;
|
||||
|
||||
import static org.firstinspires.ftc.teamcode.PedroConstants.HOOK;
|
||||
import static org.firstinspires.ftc.teamcode.PedroConstants.LIFT_SLIDE_LEFT_MOTOR;
|
||||
import static org.firstinspires.ftc.teamcode.PedroConstants.LIFT_SLIDE_RIGHT_MOTOR;
|
||||
|
||||
@ -11,41 +12,49 @@ import static org.firstinspires.ftc.teamcode.configs.RobotConstants.toBar;
|
||||
import static org.firstinspires.ftc.teamcode.configs.RobotConstants.toFloor;
|
||||
|
||||
public class HangMotorSubsystem {
|
||||
private DcMotorEx Hang;
|
||||
private DcMotorEx hang;
|
||||
|
||||
public HangMotorSubsystem(HardwareMap hardwareMap) {
|
||||
|
||||
Hang = hardwareMap.get(DcMotorEx.class, "skyhook");
|
||||
hang = hardwareMap.get(DcMotorEx.class, HOOK);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public int getCurrentPosition(){
|
||||
int Return = Hang.getCurrentPosition();
|
||||
int Return = hang.getCurrentPosition();
|
||||
return Return;
|
||||
}
|
||||
public void init(){
|
||||
Hang.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);
|
||||
Hang.setDirection(DcMotorSimple.Direction.FORWARD);
|
||||
Hang.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);
|
||||
Hang.setMode(DcMotor.RunMode.RUN_USING_ENCODER);
|
||||
hang.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);
|
||||
hang.setDirection(DcMotorSimple.Direction.FORWARD);
|
||||
hang.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);
|
||||
hang.setMode(DcMotor.RunMode.RUN_USING_ENCODER);
|
||||
|
||||
}
|
||||
public void hangRobot(){
|
||||
Hang.setTargetPosition(toBar);
|
||||
hang.setTargetPosition(toBar);
|
||||
|
||||
}
|
||||
public void robotToFloor(){
|
||||
Hang.setTargetPosition(toFloor);
|
||||
hang.setTargetPosition(toFloor);
|
||||
}
|
||||
public void disableMotor(){
|
||||
Hang.setPower(0);
|
||||
Hang.setMotorDisable();
|
||||
hang.setPower(0);
|
||||
hang.setMotorDisable();
|
||||
|
||||
}
|
||||
public void setPower(double power){
|
||||
hang.setPower(power);
|
||||
}
|
||||
public void stopMotor(){
|
||||
hang.setPower(0);
|
||||
|
||||
|
||||
}
|
||||
public void toHangPosition(int Position){
|
||||
//write in limits for protection
|
||||
Hang.setPower(Position);
|
||||
hang.setPower(Position);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -58,6 +58,7 @@ public class LiftArmWrist extends LinearOpMode {
|
||||
WristSubsystem wrist = new WristSubsystem(hardwareMap);
|
||||
ArmSubsystem arm = new ArmSubsystem(hardwareMap);
|
||||
ClawSubsystem claw = new ClawSubsystem(hardwareMap);
|
||||
HangMotorSubsystem hang = new HangMotorSubsystem(hardwareMap);
|
||||
|
||||
|
||||
/*
|
||||
@ -117,15 +118,23 @@ public class LiftArmWrist extends LinearOpMode {
|
||||
lift.toLowBucketPosition();
|
||||
|
||||
}
|
||||
if(currentGamepad1.left_trigger > 0){
|
||||
hang.setPower((double) currentGamepad1.left_trigger);
|
||||
}
|
||||
if(currentGamepad1.right_trigger > 0){
|
||||
hang.setPower((double) currentGamepad1.right_trigger);
|
||||
}
|
||||
|
||||
lift.update();
|
||||
|
||||
// Show the elapsed game time and wheel power.
|
||||
|
||||
telemetry.addData("Status", "Run Time: " + runtime.toString());
|
||||
telemetry.addData("Lift Drive Position", lift.getFixedPosition());
|
||||
telemetry.addData("Wrist Position", wrist.getPosition());
|
||||
telemetry.addData("Arm Position", arm.getPosition());
|
||||
telemetry.addData("Slide Ticks", lift.getCurrentPosition());
|
||||
telemetry.addData("Hook Ticks", hang.getCurrentPosition());
|
||||
telemetry.update();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user