diff --git a/src/main/java/org/usfirst/frc4904/robot/RobotMap.java b/src/main/java/org/usfirst/frc4904/robot/RobotMap.java index 75360ae..cf7775a 100644 --- a/src/main/java/org/usfirst/frc4904/robot/RobotMap.java +++ b/src/main/java/org/usfirst/frc4904/robot/RobotMap.java @@ -30,6 +30,8 @@ public static class CANMotor { public static int RIGHT_DRIVE_B = 3; public static int LEFT_DRIVE_A = 4; public static int LEFT_DRIVE_B = 5; + public static int CLIMBER_A = 6; + public static int CLIMBER_B = 7; } public static class PWM { @@ -93,6 +95,8 @@ public static class Component { public static Motor rightWheelB; public static Motor leftWheelA; public static Motor leftWheelB; + public static Motor climberA; + public static Motor climberB; public static TankDrive chassis; public static CustomPIDController drivePID; } @@ -143,6 +147,15 @@ public RobotMap() { Component.chassisTalonEncoders = new EncoderPair(Component.leftWheelTalonEncoder, Component.rightWheelTalonEncoder); Component.chassisCANCoders = new EncoderPair(Component.leftWheelCANCoder, Component.rightWheelCANCoder); + /* Climber */ + // TalonFX + CANTalonFX climberATalon = new CANTalonFX(Port.CANMotor.CLIMBER_A); + CANTalonFX climberBTalon = new CANTalonFX(Port.CANMotor.CLIMBER_B); + + // Climber components + Component.climberA = new Motor("climberA", false, climberATalon); + Component.climberB = new Motor("climberB", false, climberBTalon); + // General Chassis Component.chassis = new TankDrive("2022-Chassis", Component.leftWheelA, Component.leftWheelB, Component.rightWheelA, Component.rightWheelB); diff --git a/src/main/java/org/usfirst/frc4904/robot/commands/ClimberAOff.java b/src/main/java/org/usfirst/frc4904/robot/commands/ClimberAOff.java new file mode 100644 index 0000000..613c782 --- /dev/null +++ b/src/main/java/org/usfirst/frc4904/robot/commands/ClimberAOff.java @@ -0,0 +1,15 @@ +package org.usfirst.frc4904.robot.commands; + +import org.usfirst.frc4904.robot.RobotMap; +import org.usfirst.frc4904.standard.commands.motor.MotorIdle; + + +public class ClimberAOff extends MotorIdle { + + /** + * Set indexer motor speed to zero + */ + public ClimberAOff() { + super(RobotMap.Component.climberA); + } +} \ No newline at end of file diff --git a/src/main/java/org/usfirst/frc4904/robot/commands/ClimberAOn.java b/src/main/java/org/usfirst/frc4904/robot/commands/ClimberAOn.java new file mode 100644 index 0000000..5a1777c --- /dev/null +++ b/src/main/java/org/usfirst/frc4904/robot/commands/ClimberAOn.java @@ -0,0 +1,11 @@ +package org.usfirst.frc4904.robot.commands; + +import org.usfirst.frc4904.robot.RobotMap; +import org.usfirst.frc4904.standard.commands.motor.MotorConstant; + +public class ClimberAOn extends MotorConstant { + public final static double DEFAULT_CLIMBER_MOTOR_A_SPEED = 0.5; //TODO: needs value + public ClimberAOn() { + super("ClimberAOn", RobotMap.Component.climberA, DEFAULT_CLIMBER_MOTOR_A_SPEED); + } +} \ No newline at end of file diff --git a/src/main/java/org/usfirst/frc4904/robot/commands/ClimberBOff.java b/src/main/java/org/usfirst/frc4904/robot/commands/ClimberBOff.java new file mode 100644 index 0000000..4e21db8 --- /dev/null +++ b/src/main/java/org/usfirst/frc4904/robot/commands/ClimberBOff.java @@ -0,0 +1,15 @@ +package org.usfirst.frc4904.robot.commands; + +import org.usfirst.frc4904.robot.RobotMap; +import org.usfirst.frc4904.standard.commands.motor.MotorIdle; + + +public class ClimberBOff extends MotorIdle { + + /** + * Set indexer motor speed to zero + */ + public ClimberBOff() { + super(RobotMap.Component.climberB); + } +} \ No newline at end of file diff --git a/src/main/java/org/usfirst/frc4904/robot/commands/ClimberBOn.java b/src/main/java/org/usfirst/frc4904/robot/commands/ClimberBOn.java new file mode 100644 index 0000000..a52ea29 --- /dev/null +++ b/src/main/java/org/usfirst/frc4904/robot/commands/ClimberBOn.java @@ -0,0 +1,11 @@ +package org.usfirst.frc4904.robot.commands; + +import org.usfirst.frc4904.robot.RobotMap; +import org.usfirst.frc4904.standard.commands.motor.MotorConstant; + +public class ClimberBOn extends MotorConstant { + public final static double DEFAULT_CLIMBERA_MOTOR_B_SPEED = 0.5; //TODO: needs value + public ClimberBOn() { + super("ClimberBOn", RobotMap.Component.climberB, DEFAULT_CLIMBERA_MOTOR_B_SPEED); + } +} \ No newline at end of file