Commit | Line | Data |
---|---|---|
7b11350e KZ |
1 | package org.usfirst.frc.team3501.robot.subsystems; |
2 | ||
3 | import org.usfirst.frc.team3501.robot.Constants; | |
4 | ||
5 | import edu.wpi.first.wpilibj.CANTalon; | |
6 | import edu.wpi.first.wpilibj.command.Subsystem; | |
7 | ||
add57fee YA |
8 | /*** |
9 | * The IntakeArm consists of two rollers that are controlled by one motor. The | |
10 | * class is deployed using a command that accelerates the robot forward and | |
11 | * gravity pushes the arm down. After the IntakeArm is pushed down by gravity, | |
12 | * the arm remains stationary for the rest of the match. | |
13 | * | |
14 | * The motor controls the rollers, making them roll forwards and backwards. | |
15 | * The Intake rollers are on the back of the robot. As the rollers run, they | |
16 | * intake the ball. | |
17 | * | |
18 | * @author superuser | |
19 | * | |
20 | */ | |
21 | ||
7b11350e | 22 | public class IntakeArm extends Subsystem { |
7b11350e KZ |
23 | private CANTalon intake; |
24 | private CANTalon chevalDeFriseHand; | |
25 | ||
26 | public IntakeArm() { | |
27 | intake = new CANTalon(Constants.IntakeArm.PORT); | |
c4e71803 | 28 | chevalDeFriseHand = new CANTalon(Constants.IntakeArm.CHEVAL_DE_FRISE_HAND_PORT); |
7b11350e KZ |
29 | } |
30 | ||
31 | /* | |
32 | * Intake only moves once at the beginning of the match. It lowers at the | |
33 | * beginning of the match and is held there by mechanical stops until the end | |
34 | * of the match. | |
fdde5248 | 35 | * |
7b11350e KZ |
36 | * Must be used in a command that has a timer variable to stop it. |
37 | */ | |
38 | public void dropIntake() { | |
39 | intake.set(0.3); | |
40 | } | |
41 | ||
42 | public void intake() { | |
43 | intake.set(Constants.IntakeArm.INTAKE_SPEED); | |
44 | } | |
45 | ||
46 | public void output() { | |
47 | intake.set(Constants.IntakeArm.OUTPUT_SPEED); | |
48 | } | |
49 | ||
fdde5248 | 50 | /*** |
add57fee YA |
51 | * This method allows you to set the voltage of the motor. The range of |
52 | * voltage is from [-1, 1]. A negative voltage makes the motor run backwards. | |
08d3b5a4 | 53 | * |
add57fee | 54 | <<<<<<< e3056e0d68d3b4150b81db56c6685c399cb9c37a |
0e37d53e | 55 | <<<<<<< cefeac7a7bb7df62af5c880e13eb37c14125a7cb |
fdde5248 YA |
56 | * @param speed |
57 | * The speed of the motors that control the rollers. The range of | |
58 | * these motors go from [-1,1]. A negative speed changes the | |
08d3b5a4 | 59 | * direction of the motors, making it run backwards. |
8e57685f KZ |
60 | * ======= |
61 | * public IntakeArm() { | |
62 | * | |
63 | * } | |
64 | * | |
65 | * /*** | |
66 | * This method allows you to set the speed of the motor(s). The range | |
67 | * of speed | |
68 | * is from [-1, 1]. A negative speed changes the direction of the | |
69 | * motors. | |
70 | * | |
71 | * @param speed | |
72 | * The speed of the motors that control the rollers. The range of | |
73 | * these motors go from [-1,1]. A negative speed changes the | |
74 | * direction of the motors. | |
75 | * >>>>>>> reset to unix format | |
0e37d53e YA |
76 | ======= |
77 | * @param speed | |
78 | * The speed of the motors that control the rollers. The range of | |
79 | * these motors go from [-1,1]. A negative speed changes the | |
80 | * direction of the motors, making it run backwards. | |
81 | >>>>>>> add 3 method stubs- setRollerSpeeds, getRollerSpeeds, and areRollersRolling | |
add57fee YA |
82 | ======= |
83 | * @param voltage | |
84 | * The voltage of the motors that control the rollers. The range of | |
85 | * these motors go from [-1,1]. A negative voltage makes the motor | |
86 | * run | |
87 | * backwards. | |
88 | >>>>>>> add class level comment and change speed to voltage | |
fdde5248 YA |
89 | */ |
90 | ||
add57fee | 91 | public void setRollerVoltage(double voltage) { |
fdde5248 YA |
92 | |
93 | } | |
94 | ||
95 | /*** | |
add57fee | 96 | <<<<<<< e3056e0d68d3b4150b81db56c6685c399cb9c37a |
0e37d53e | 97 | <<<<<<< cefeac7a7bb7df62af5c880e13eb37c14125a7cb |
8e57685f | 98 | * <<<<<<< bd5dc4363add71a17f95409115dec96b83146549 |
08d3b5a4 YA |
99 | * This method gets you the current speed of the motor that controls the |
100 | * motor. The range of speed is from [-1,1]. A negative speed changes the | |
101 | * direction of the motor, making it run backwards. | |
fdde5248 | 102 | * |
08d3b5a4 YA |
103 | * @return Returns the speed of the motor that controls the roller. The range |
104 | * of the motor goes from [-1,1]. A negative speed changes the | |
105 | * direction of the motor, making it go backwards. | |
8e57685f KZ |
106 | * ======= |
107 | * | |
108 | * @return | |
109 | * >>>>>>> reset to unix format | |
0e37d53e YA |
110 | ======= |
111 | * This method gets you the current speed of the motor that controls the | |
112 | * motor. The range of speed is from [-1,1]. A negative speed changes the | |
113 | * direction of the motor, making it run backwards. | |
114 | * | |
115 | * @return Returns the speed of the motor that controls the roller. The range | |
116 | * of the motor goes from [-1,1]. A negative speed changes the | |
117 | * direction of the motor, making it go backwards. | |
118 | >>>>>>> add 3 method stubs- setRollerSpeeds, getRollerSpeeds, and areRollersRolling | |
add57fee YA |
119 | ======= |
120 | * This method gets you the current voltage of the motor that controls the | |
121 | * motor. The range of voltage is from [-1,1]. A negative voltage makes the | |
122 | * motor | |
123 | * run backwards. | |
124 | * | |
125 | * @return Returns the voltage of the motor that controls the roller. The | |
126 | * range | |
127 | * of the motor goes from [-1,1]. A negative voltage indicates that | |
128 | * the | |
129 | * motor is running backwards. | |
130 | >>>>>>> add class level comment and change speed to voltage | |
fdde5248 YA |
131 | */ |
132 | ||
add57fee | 133 | public double getRollerVoltage() { |
fdde5248 YA |
134 | return 0; |
135 | } | |
136 | ||
137 | /*** | |
0e37d53e | 138 | <<<<<<< cefeac7a7bb7df62af5c880e13eb37c14125a7cb |
8e57685f | 139 | * <<<<<<< bd5dc4363add71a17f95409115dec96b83146549 |
08d3b5a4 YA |
140 | * This method checks to see if the motors controlling the rollers are |
141 | * currently working. | |
fdde5248 | 142 | * |
08d3b5a4 YA |
143 | * @return Returns whether the motors are currently running, and returns the |
144 | * state of the condition (true or false). | |
8e57685f KZ |
145 | * ======= |
146 | * | |
147 | * @return | |
148 | */ | |
149 | ||
150 | public boolean isBallInside() { | |
151 | return true; | |
152 | } | |
153 | ||
154 | /*** | |
155 | * | |
156 | * @return | |
157 | * >>>>>>> reset to unix format | |
0e37d53e YA |
158 | ======= |
159 | * This method checks to see if the motors controlling the rollers are | |
add57fee | 160 | * currently running. |
0e37d53e YA |
161 | * |
162 | * @return Returns whether the motors are currently running, and returns the | |
163 | * state of the condition (true or false). | |
164 | >>>>>>> add 3 method stubs- setRollerSpeeds, getRollerSpeeds, and areRollersRolling | |
fdde5248 YA |
165 | */ |
166 | ||
167 | public boolean areRollersRolling() { | |
168 | return true; | |
169 | } | |
170 | ||
7b11350e KZ |
171 | @Override |
172 | protected void initDefaultCommand() { | |
173 | ||
174 | } | |
175 | } |