Skip to content
This repository was archived by the owner on Sep 14, 2019. It is now read-only.

Commit d1186b8

Browse files
committed
kate's changes to my remote repo
1 parent 9753c57 commit d1186b8

6 files changed

Lines changed: 217 additions & 7 deletions

File tree

Robot2018/src/org/usfirst/frc/team199/Robot2018/subsystems/Climber.java

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@
22

33
import edu.wpi.first.wpilibj.command.Subsystem;
44

5+
import org.usfirst.frc.team199.Robot2018.RobotMap;
6+
7+
import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX;
8+
59
/**
610
*
711
*/
812
public class Climber extends Subsystem implements ClimberInterface {
913

10-
// Put methods for controlling this subsystem
11-
// here. Call these from Commands.
14+
private final WPI_TalonSRX climberMotor = RobotMap.climberMotor;
15+
1216

1317
/**
1418
* Set the default command for a subsystem here.
@@ -17,5 +21,40 @@ public void initDefaultCommand() {
1721
// Set the default command for a subsystem here.
1822
//setDefaultCommand(new MySpecialCommand());
1923
}
24+
25+
26+
27+
28+
/**
29+
* runs the motors
30+
*
31+
*/
32+
public void runClimber(double speed) {
33+
34+
}
35+
36+
/**
37+
* attaches the climber hook to the lift.
38+
* Requires that Lift is on the ground
39+
*/
40+
public void attachToLift() {
41+
42+
}
43+
44+
/**
45+
* attaches hook to bar and releases it from the lift
46+
*/
47+
public void attachToBar() {
48+
49+
}
50+
51+
/**
52+
* stops the climber
53+
*/
54+
public void stopClimber() {
55+
climberMotor.stopMotor();
56+
}
57+
58+
2059
}
2160

Robot2018/src/org/usfirst/frc/team199/Robot2018/subsystems/ClimberInterface.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,26 @@ public interface ClimberInterface {
77
* */
88
public void initDefaultCommand();
99

10+
/**
11+
* runs the motors
12+
*/
13+
public void runClimber(double speed);
14+
15+
/**
16+
* attaches the climber hook to the lift.
17+
* Requires that Lift is on the ground
18+
*/
19+
public void attachToLift();
20+
21+
/**
22+
* attaches hook to bar and releases it from the lift
23+
*/
24+
public void attachToBar();
25+
26+
/**
27+
* stops the climber
28+
*/
29+
public void stopClimber();
30+
31+
1032
}
Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
package org.usfirst.frc.team199.Robot2018.subsystems;
22

3+
import org.usfirst.frc.team199.Robot2018.RobotMap;
4+
5+
import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX;
6+
37
import edu.wpi.first.wpilibj.command.Subsystem;
48

59
/**
610
*
711
*/
812
public class IntakeEject extends Subsystem implements IntakeEjectInterface {
9-
10-
// Put methods for controlling this subsystem
11-
// here. Call these from Commands.
13+
14+
private final WPI_TalonSRX intakeMotor = RobotMap.intakeMotor;
15+
16+
1217

1318
/**
1419
* Set the default command for a subsystem here.
@@ -17,5 +22,46 @@ public void initDefaultCommand() {
1722
// Set the default command for a subsystem here.
1823
//setDefaultCommand(new MySpecialCommand());
1924
}
25+
26+
/**
27+
* returns current motor value
28+
*/
29+
public double getIntakeSpeed() {
30+
return intakeMotor.get();
31+
}
32+
33+
/**
34+
* Uses (insert sensor here) to detect
35+
* a cube in front of the robot.
36+
*/
37+
public boolean seeCube() {
38+
return false;
39+
}
40+
41+
/**
42+
* Uses (insert sensor here) to detect if
43+
* the cube is currently inside the robot
44+
*
45+
*/
46+
public boolean hasCube() {
47+
return false;
48+
}
49+
50+
/**
51+
* stops the motors
52+
*
53+
*/
54+
public void stopIntake() {
55+
intakeMotor.stopMotor();
56+
}
57+
58+
/**
59+
* Spins the rollers
60+
* @param speed - positive -> rollers in, negative -> rollers out
61+
*/
62+
public void runIntake(double speed) {
63+
64+
}
65+
2066
}
2167

Robot2018/src/org/usfirst/frc/team199/Robot2018/subsystems/IntakeEjectInterface.java

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,35 @@ public interface IntakeEjectInterface {
77
* */
88
public void initDefaultCommand();
99

10+
/**
11+
* returns current motor value
12+
*/
13+
public double getIntakeSpeed();
14+
15+
/**
16+
* Uses (insert sensor here) to detect
17+
* a cube in front of the robot.
18+
*/
19+
public boolean seeCube();
20+
21+
/**
22+
* Uses (insert sensor here) to detect if
23+
* the cube is currently inside the robot
24+
*
25+
*/
26+
public boolean hasCube();
27+
28+
/**
29+
* stops the motors
30+
*
31+
*/
32+
public void stopIntake();
33+
34+
/**
35+
* Spins the rollers
36+
* @param speed - positive -> rollers in, negative -> rollers out
37+
*/
38+
public void runIntake(double speed);
39+
40+
1041
}
Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
package org.usfirst.frc.team199.Robot2018.subsystems;
22

3+
import org.usfirst.frc.team199.Robot2018.RobotMap;
4+
5+
import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX;
6+
37
import edu.wpi.first.wpilibj.command.Subsystem;
48

59
/**
610
*
711
*/
812
public class Lift extends Subsystem implements LiftInterface {
913

10-
// Put methods for controlling this subsystem
11-
// here. Call these from Commands.
14+
private final WPI_TalonSRX liftMotor = RobotMap.liftMotor;
15+
16+
private Position targetPosition = Position.GROUND;
1217

1318
/**
1419
* Set the default command for a subsystem here.
@@ -17,5 +22,41 @@ public void initDefaultCommand() {
1722
// Set the default command for a subsystem here.
1823
//setDefaultCommand(new MySpecialCommand());
1924
}
25+
26+
public void setTargetPosition(Position newPosition) {
27+
targetPosition = newPosition;
28+
}
29+
30+
/**
31+
* Uses (insert sensor here) to detect the current lift position
32+
*/
33+
public double getHeight() {
34+
return -1;
35+
}
36+
37+
/**
38+
* stops the lift
39+
*/
40+
public void stopLift() {
41+
liftMotor.stopMotor();
42+
}
43+
44+
/**
45+
* gets current motor values
46+
*/
47+
public double getLiftSpeed() {
48+
return liftMotor.get();
49+
}
50+
51+
/**
52+
* Goes to specified height
53+
* @param position - ground, switch, scale, bar
54+
* @param offset - distance up or down from the position
55+
*/
56+
public void goToPosition(Position position, double offset) {
57+
58+
}
59+
60+
2061
}
2162

Robot2018/src/org/usfirst/frc/team199/Robot2018/subsystems/LiftInterface.java

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,35 @@ public interface LiftInterface {
77
* */
88
public void initDefaultCommand();
99

10+
public enum Position {
11+
GROUND,
12+
SWITCH,
13+
SCALE,
14+
BAR
15+
}
16+
17+
/**
18+
* Uses (insert sensor here) to detect the current lift position
19+
*/
20+
public double getHeight();
21+
22+
/**
23+
* stops the lift
24+
*/
25+
public void stopLift();
26+
27+
/**
28+
* gets current motor values
29+
*/
30+
public double getLiftSpeed();
31+
32+
33+
/**
34+
* Goes to specified height
35+
* @param position - ground, switch, scale, bar
36+
* @param offset - distance up or down from position
37+
*/
38+
public void goToPosition(Position position, double offset);
39+
40+
1041
}

0 commit comments

Comments
 (0)