Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Climber #25

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/main/java/org/usfirst/frc4904/robot/RobotMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/org/usfirst/frc4904/robot/commands/ClimberAOff.java
Original file line number Diff line number Diff line change
@@ -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);
}
}
11 changes: 11 additions & 0 deletions src/main/java/org/usfirst/frc4904/robot/commands/ClimberAOn.java
Original file line number Diff line number Diff line change
@@ -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);
}
}
15 changes: 15 additions & 0 deletions src/main/java/org/usfirst/frc4904/robot/commands/ClimberBOff.java
Original file line number Diff line number Diff line change
@@ -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);
}
}
11 changes: 11 additions & 0 deletions src/main/java/org/usfirst/frc4904/robot/commands/ClimberBOn.java
Original file line number Diff line number Diff line change
@@ -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);
}
}