Moved device names to constants file
This commit is contained in:
@ -8,43 +8,64 @@ import org.firstinspires.ftc.teamcode.pedroPathing.localization.Encoder;
|
||||
public class PedroConstants {
|
||||
|
||||
/*
|
||||
Robot parameters
|
||||
Motor configuration names
|
||||
*/
|
||||
// Turn localizer - -0.003
|
||||
|
||||
|
||||
// Robot motor configurations
|
||||
public static final String BRAIN_ROT = "Sikidi rizz 360 no teleop tf2 mama mia 2cool 4skool yasyasy yasyasyasyasyasyasyaysy ohio yes heh me is moar skeebeedee than u walked and got tripped on by your aunt my very educaded mother just served us nine what? just kydinfoiwfowefwofwioefoiejfeoiwjfomdsklfnslefknesfklnkfenfenkfeknfenkfeknfenkefnk";
|
||||
public static final String FRONT_LEFT_MOTOR = "Drive front lt";
|
||||
public static final String BACK_LEFT_MOTOR = "Drive back lt";
|
||||
public static final String FRONT_RIGHT_MOTOR = "Drive front rt";
|
||||
public static final String BACK_RIGHT_MOTOR = "Drive back rt";
|
||||
public static final String BACK_LEFT_MOTOR = "Drive back lt";
|
||||
public static final String FRONT_RIGHT_MOTOR = "Drive front rt";
|
||||
public static final String BACK_RIGHT_MOTOR = "Drive back rt";
|
||||
|
||||
// Robot motor direction
|
||||
/*
|
||||
Motor directions
|
||||
*/
|
||||
public static final Direction FRONT_LEFT_MOTOR_DIRECTION = Direction.REVERSE;
|
||||
public static final Direction BACK_LEFT_MOTOR_DIRECTION = Direction.REVERSE;
|
||||
public static final Direction FRONT_RIGHT_MOTOR_DIRECTION = Direction.FORWARD;
|
||||
public static final Direction BACK_RIGHT_MOTOR_DIRECTION = Direction.FORWARD;
|
||||
|
||||
// Robot IMU configuration
|
||||
/*
|
||||
IMU
|
||||
*/
|
||||
public static final String IMU = "imu";
|
||||
|
||||
// Robot IMU placement
|
||||
public static final RevHubOrientationOnRobot.LogoFacingDirection IMU_LOGO_FACING_DIRECTION
|
||||
= RevHubOrientationOnRobot.LogoFacingDirection.DOWN;
|
||||
public static final RevHubOrientationOnRobot.UsbFacingDirection IMU_USB_FACING_DIRECTION
|
||||
= RevHubOrientationOnRobot.UsbFacingDirection.LEFT;
|
||||
|
||||
// Robot encoders
|
||||
/*
|
||||
Dead wheels
|
||||
*/
|
||||
public static final String LEFT_ENCODER = "encoder left";
|
||||
public static final String RIGHT_ENCODER = "encoder right";
|
||||
public static final String BACK_ENCODER = "encoder back";
|
||||
|
||||
// Robot encoder direction
|
||||
/*
|
||||
Dead wheel directions
|
||||
*/
|
||||
public static final double LEFT_ENCODER_DIRECTION = Encoder.FORWARD;
|
||||
public static final double RIGHT_ENCODER_DIRECTION = Encoder.FORWARD;
|
||||
public static final double BACK_ENCODER_DIRECTION = Encoder.FORWARD;
|
||||
|
||||
/*
|
||||
Arm configuration name
|
||||
*/
|
||||
public static final String ARM_NAME = "arm-servo";
|
||||
|
||||
/*
|
||||
Claw configuration name
|
||||
*/
|
||||
public static final String CLAW_NAME = "claw-servo";
|
||||
|
||||
/*
|
||||
Lift configuration name
|
||||
*/
|
||||
public static final String LIFT_NAME = "lift-motor";
|
||||
|
||||
/*
|
||||
Wrist configuration name
|
||||
*/
|
||||
public static final String WRIST_NAME = "wrist-servo";
|
||||
|
||||
/*
|
||||
Pedro's parameters
|
||||
*/
|
||||
|
@ -1,5 +1,6 @@
|
||||
package org.firstinspires.ftc.teamcode.subsystem;
|
||||
|
||||
import static org.firstinspires.ftc.teamcode.PedroConstants.ARM_NAME;
|
||||
import static org.firstinspires.ftc.teamcode.configs.RobotConstants.armBucket;
|
||||
import static org.firstinspires.ftc.teamcode.configs.RobotConstants.armFloor;
|
||||
import static org.firstinspires.ftc.teamcode.configs.RobotConstants.armPark;
|
||||
@ -23,7 +24,7 @@ public class ArmActionsSubsystem {
|
||||
private ArmState state;
|
||||
|
||||
public ArmActionsSubsystem(HardwareMap hardwareMap) {
|
||||
this.arm = hardwareMap.get(ServoImplEx.class, "arm-servo");
|
||||
this.arm = hardwareMap.get(ServoImplEx.class, ARM_NAME);
|
||||
}
|
||||
|
||||
public class MoveToPosition implements Action {
|
||||
|
@ -1,5 +1,6 @@
|
||||
package org.firstinspires.ftc.teamcode.subsystem;
|
||||
|
||||
import static org.firstinspires.ftc.teamcode.PedroConstants.CLAW_NAME;
|
||||
import static org.firstinspires.ftc.teamcode.configs.RobotConstants.clawClose;
|
||||
import static org.firstinspires.ftc.teamcode.configs.RobotConstants.clawOpen;
|
||||
|
||||
@ -21,7 +22,7 @@ public class ClawActionsSubsystem {
|
||||
private ClawState state;
|
||||
|
||||
public ClawActionsSubsystem(HardwareMap hardwareMap) {
|
||||
this.claw = hardwareMap.get(Servo.class, "claw-servo");
|
||||
this.claw = hardwareMap.get(Servo.class, CLAW_NAME);
|
||||
}
|
||||
|
||||
public class MoveToPosition implements Action {
|
||||
@ -37,7 +38,7 @@ public class ClawActionsSubsystem {
|
||||
public boolean run(@NonNull TelemetryPacket telemetryPacket) {
|
||||
setState(positionState);
|
||||
claw.setPosition(positionValue);
|
||||
telemetryPacket.put("Arm State", positionState);
|
||||
telemetryPacket.put("Claw State", positionState);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package org.firstinspires.ftc.teamcode.subsystem;
|
||||
|
||||
import static org.firstinspires.ftc.teamcode.PedroConstants.LIFT_NAME;
|
||||
import static org.firstinspires.ftc.teamcode.configs.RobotConstants.liftPower;
|
||||
import static org.firstinspires.ftc.teamcode.configs.RobotConstants.liftToFloorPos;
|
||||
import static org.firstinspires.ftc.teamcode.configs.RobotConstants.liftToHighBucketPos;
|
||||
@ -25,7 +26,7 @@ public class LiftActionsSubsystem {
|
||||
private LiftState liftState;
|
||||
|
||||
public LiftActionsSubsystem(HardwareMap hardwareMap) {
|
||||
lift = hardwareMap.get(DcMotor.class, "lift-motor");
|
||||
lift = hardwareMap.get(DcMotor.class, LIFT_NAME);
|
||||
}
|
||||
|
||||
public class MoveToPosition implements Action {
|
||||
|
@ -1,5 +1,6 @@
|
||||
package org.firstinspires.ftc.teamcode.subsystem;
|
||||
|
||||
import static org.firstinspires.ftc.teamcode.PedroConstants.WRIST_NAME;
|
||||
import static org.firstinspires.ftc.teamcode.configs.RobotConstants.wristBucket;
|
||||
import static org.firstinspires.ftc.teamcode.configs.RobotConstants.wristFloor;
|
||||
|
||||
@ -22,7 +23,7 @@ public class WristSubsystem {
|
||||
public Telemetry telemetry;
|
||||
|
||||
public WristSubsystem(HardwareMap hardwareMap, Telemetry telemetry) {
|
||||
this.wrist = hardwareMap.get(ServoImplEx.class, "wrist-servo");
|
||||
this.wrist = hardwareMap.get(ServoImplEx.class, WRIST_NAME);
|
||||
this.telemetry = telemetry;
|
||||
toBucketPosition = new RunAction(this::toBucketPosition);
|
||||
toFloorPosition = new RunAction(this::toFloorPosition);
|
||||
|
Reference in New Issue
Block a user