Skip to content

Commit f49df82

Browse files
committed
Added the new climber and removed tramps
1 parent 2a7008e commit f49df82

File tree

11 files changed

+73
-262
lines changed

11 files changed

+73
-262
lines changed

src/org/usfirst/frc/team2363/robot/OI.java

+2-17
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import org.usfirst.frc.team2363.robot.commands.gripper.EjectCube;
2020
import org.usfirst.frc.team2363.robot.commands.gripper.IntakeCube;
2121
import org.usfirst.frc.team2363.robot.commands.gripper.ShootCube;
22-
import org.usfirst.frc.team2363.robot.commands.tramps.DeployTramps;
2322
import org.usfirst.frc.team2363.robot.subsystems.Elevator.Height;
2423

2524
import edu.wpi.first.wpilibj.GenericHID.RumbleType;
@@ -48,11 +47,6 @@ public OI() {
4847
new JoystickButton(operatorController, RobotMap.RB).whenPressed(new OpenClaw());
4948
new JoystickButton(operatorController, RobotMap.LB).whenPressed(new CloseClaw());
5049
new JoystickButton(operatorController, RobotMap.A).whenPressed(new ManualPositionalElevator());
51-
//tramp controls
52-
// new JoystickButton(operatorController, RobotMap.RIGHT_STICK_BUTTON).whenPressed(new DeployTramps());
53-
// new JoystickButton(operatorController, RobotMap.LOGO_RIGHT).whenPressed(new DeployLeftTramps());
54-
// new JoystickButton(operatorController, RobotMap.LOGO_LEFT).whenPressed(new DeployRightTramps());
55-
new JoystickButton(operatorController, RobotMap.LOGO_RIGHT).whenPressed(new DeployTramps());
5650

5751
// new JoystickButton(driverController, RobotMap.RB).whenPressed(new SlowJoystickDrive());
5852
// new JoystickButton(driverController, RobotMap.RB).whenReleased(new JoystickDrive());
@@ -158,8 +152,8 @@ public static double getTurnScaling(double x) {
158152
return -Math.abs(LOW_SPEED_SCALING - HIGH_SPEED_SCALING) * Math.abs(x) + LOW_SPEED_SCALING;
159153
}
160154

161-
//Tramp Power
162-
public double getLeftTrampPower() {
155+
//Climber Power
156+
public double getClimberPower() {
163157
double stick = -operatorController.getRawAxis(RIGHT_STICK_Y);
164158
stick *= Math.abs(stick);
165159
if (Math.abs(stick) < 0.05) {
@@ -168,15 +162,6 @@ public double getLeftTrampPower() {
168162
return stick;
169163
}
170164

171-
public double getRightTrampPower() {
172-
double stick = -operatorController.getRawAxis(LEFT_STICK_Y);
173-
stick *= Math.abs(stick);
174-
if (Math.abs(stick) < 0.05) {
175-
stick = 0;
176-
}
177-
return stick;
178-
}
179-
180165
/**
181166
* Turns on and off the rumble function on the driver and operator controllers
182167
* @param set true to turn on rumble

src/org/usfirst/frc/team2363/robot/Robot.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
import org.usfirst.frc.team2363.robot.commands.autonomous.PathTesting;
88
import org.usfirst.frc.team2363.robot.commands.elevator.RaiseElevator;
99
import org.usfirst.frc.team2363.robot.subsystems.Claws;
10+
import org.usfirst.frc.team2363.robot.subsystems.Climber;
1011
import org.usfirst.frc.team2363.robot.subsystems.Drivetrain;
1112
import org.usfirst.frc.team2363.robot.subsystems.Elevator;
1213
import org.usfirst.frc.team2363.robot.subsystems.Elevator.Height;
1314
import org.usfirst.frc.team2363.robot.subsystems.Gripper;
14-
import org.usfirst.frc.team2363.robot.subsystems.Tramps;
1515
import org.usfirst.frc.team319.paths.OppositeSideScale;
1616
import org.usfirst.frc.team319.paths.SameSideScale;
1717
import org.usfirst.frc.team319.paths.scaling_calibration;
@@ -44,7 +44,7 @@ public class Robot extends IterativeRobot {
4444
private final PowerDistributionPanel pdp = new PowerDistributionPanel();
4545
private final Compressor compressor = new Compressor();
4646
public static Gripper gripper;
47-
public static Tramps tramps;
47+
public static Climber climber;
4848
public static Elevator elevator;
4949
public static Claws claws;
5050

@@ -62,7 +62,7 @@ public Robot() {
6262
LOG = new HelixLogger();
6363

6464
drivetrain = new Drivetrain();
65-
tramps = new Tramps();
65+
climber = new Climber();
6666
elevator = new Elevator();
6767
claws = new Claws();
6868
gripper = new Gripper();

src/org/usfirst/frc/team2363/robot/RobotMap.java

+3-17
Original file line numberDiff line numberDiff line change
@@ -52,24 +52,10 @@ public class RobotMap {
5252

5353
//Analog Switch
5454
public static final int ANALOG_INPUT = 0;
55-
56-
//Tramp Solenoids
57-
public static final int TRAMPS_DEPLOY = 2;
58-
public static final int TRAMPS_RETRACT = 5;
59-
public static final int LEFT1_TRAMP_RAISE = 3;
60-
public static final int LEFT1_TRAMP_LOWER = 4;
61-
public static final int LEFT2_TRAMP_RAISE = 3;
62-
public static final int LEFT2_TRAMP_LOWER = 4;
63-
public static final int RIGHT1_TRAMP_RAISE = 0;
64-
public static final int RIGHT1_TRAMP_LOWER = 7;
65-
public static final int RIGHT2_TRAMP_RAISE = 1;
66-
public static final int RIGHT2_TRAMP_LOWER = 6;
6755

68-
//Tramp Motors
69-
public static final int FRONT_LEFT_TRAMP = 40;
70-
public static final int REAR_LEFT_TRAMP = 42;
71-
public static final int FRONT_RIGHT_TRAMP = 41;
72-
public static final int REAR_RIGHT_TRAMP = 43;
56+
//Climber Motors
57+
public static final int FRONT_CLIMBER = 40;
58+
public static final int REAR_CLIMBER = 41;
7359

7460
//Gripper Solenoids
7561
public static final int CLAW_OPEN = 6;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package org.usfirst.frc.team2363.robot.commands.climber;
2+
3+
import org.usfirst.frc.team2363.robot.Robot;
4+
5+
import edu.wpi.first.wpilibj.command.Command;
6+
7+
/**
8+
*
9+
*/
10+
public class ClimberCommand extends Command {
11+
12+
public ClimberCommand() {
13+
requires(Robot.climber);
14+
}
15+
16+
protected void initialize() {
17+
}
18+
19+
protected void execute() {
20+
Robot.climber.setPower(Robot.oi.getClimberPower());
21+
}
22+
23+
protected boolean isFinished() {
24+
return false;
25+
}
26+
27+
protected void end() {
28+
}
29+
30+
protected void interrupted() {
31+
}
32+
}

src/org/usfirst/frc/team2363/robot/commands/elevator/ManualPositionalElevator.java

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import org.iif.th.util.logger.HelixEvents;
44
import org.usfirst.frc.team2363.robot.Robot;
5-
import org.usfirst.frc.team2363.robot.commands.tramps.RetractTramps;
65
import org.usfirst.frc.team2363.robot.subsystems.Elevator;
76

87
import edu.wpi.first.wpilibj.command.Command;

src/org/usfirst/frc/team2363/robot/commands/tramps/DeployLeftTramps.java

-35
This file was deleted.

src/org/usfirst/frc/team2363/robot/commands/tramps/DeployRightTramps.java

-35
This file was deleted.

src/org/usfirst/frc/team2363/robot/commands/tramps/DeployTramps.java

-40
This file was deleted.

src/org/usfirst/frc/team2363/robot/commands/tramps/RetractTramps.java

-37
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package org.usfirst.frc.team2363.robot.subsystems;
2+
3+
import com.ctre.phoenix.motorcontrol.ControlMode;
4+
import com.ctre.phoenix.motorcontrol.can.TalonSRX;
5+
import static org.usfirst.frc.team2363.robot.RobotMap.*;
6+
7+
import org.usfirst.frc.team2363.robot.commands.climber.ClimberCommand;
8+
9+
import edu.wpi.first.wpilibj.command.Subsystem;
10+
11+
/**
12+
*
13+
*/
14+
public class Climber extends Subsystem {
15+
16+
private TalonSRX front = new TalonSRX(FRONT_CLIMBER);
17+
private TalonSRX rear = new TalonSRX(REAR_CLIMBER);
18+
19+
public Climber() {
20+
rear.follow(front);
21+
front.setInverted(true);
22+
rear.setInverted(false);
23+
}
24+
25+
public void setPower(double power) {
26+
front.set(ControlMode.PercentOutput, power);
27+
}
28+
29+
public void initDefaultCommand() {
30+
setDefaultCommand(new ClimberCommand());
31+
}
32+
}
33+

0 commit comments

Comments
 (0)