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

Commit a13bc36

Browse files
committed
add command shells needed in Autonomous
These commands are needed in Autonomous, some of them also in Teleop. These are only the base classes and are not yet implemented.
1 parent 2ac79eb commit a13bc36

8 files changed

Lines changed: 254 additions & 2 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package org.usfirst.frc.team199.Robot2018.commands;
2+
3+
import edu.wpi.first.wpilibj.command.Command;
4+
5+
/**
6+
*
7+
*/
8+
public class AutoMove extends Command {
9+
10+
public AutoMove(double distance) {
11+
// Use requires() here to declare subsystem dependencies
12+
// eg. requires(chassis);
13+
}
14+
15+
// Called just before this Command runs the first time
16+
protected void initialize() {
17+
}
18+
19+
// Called repeatedly when this Command is scheduled to run
20+
protected void execute() {
21+
}
22+
23+
// Make this return true when this Command no longer needs to run execute()
24+
protected boolean isFinished() {
25+
return false;
26+
}
27+
28+
// Called once after isFinished returns true
29+
protected void end() {
30+
}
31+
32+
// Called when another command which requires one or more of the same
33+
// subsystems is scheduled to run
34+
protected void interrupted() {
35+
}
36+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package org.usfirst.frc.team199.Robot2018.commands;
2+
3+
import edu.wpi.first.wpilibj.command.Command;
4+
5+
/**
6+
*
7+
*/
8+
public class AutoMoveTo extends Command {
9+
10+
public AutoMoveTo(String[] points) {
11+
// Use requires() here to declare subsystem dependencies
12+
// eg. requires(chassis);
13+
}
14+
15+
// Called just before this Command runs the first time
16+
protected void initialize() {
17+
}
18+
19+
// Called repeatedly when this Command is scheduled to run
20+
protected void execute() {
21+
}
22+
23+
// Make this return true when this Command no longer needs to run execute()
24+
protected boolean isFinished() {
25+
return false;
26+
}
27+
28+
// Called once after isFinished returns true
29+
protected void end() {
30+
}
31+
32+
// Called when another command which requires one or more of the same
33+
// subsystems is scheduled to run
34+
protected void interrupted() {
35+
}
36+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package org.usfirst.frc.team199.Robot2018.commands;
2+
3+
import edu.wpi.first.wpilibj.command.Command;
4+
5+
/**
6+
*
7+
*/
8+
public class AutoTurn extends Command {
9+
10+
public AutoTurn(double angle) {
11+
// Use requires() here to declare subsystem dependencies
12+
// eg. requires(chassis);
13+
}
14+
15+
// Called just before this Command runs the first time
16+
protected void initialize() {
17+
}
18+
19+
// Called repeatedly when this Command is scheduled to run
20+
protected void execute() {
21+
}
22+
23+
// Make this return true when this Command no longer needs to run execute()
24+
protected boolean isFinished() {
25+
return false;
26+
}
27+
28+
// Called once after isFinished returns true
29+
protected void end() {
30+
}
31+
32+
// Called when another command which requires one or more of the same
33+
// subsystems is scheduled to run
34+
protected void interrupted() {
35+
}
36+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package org.usfirst.frc.team199.Robot2018.commands;
2+
3+
import edu.wpi.first.wpilibj.command.Command;
4+
5+
/**
6+
*
7+
*/
8+
public class EjectToExchange extends Command {
9+
10+
public EjectToExchange() {
11+
// Use requires() here to declare subsystem dependencies
12+
// eg. requires(chassis);
13+
}
14+
15+
// Called just before this Command runs the first time
16+
protected void initialize() {
17+
}
18+
19+
// Called repeatedly when this Command is scheduled to run
20+
protected void execute() {
21+
}
22+
23+
// Make this return true when this Command no longer needs to run execute()
24+
protected boolean isFinished() {
25+
return false;
26+
}
27+
28+
// Called once after isFinished returns true
29+
protected void end() {
30+
}
31+
32+
// Called when another command which requires one or more of the same
33+
// subsystems is scheduled to run
34+
protected void interrupted() {
35+
}
36+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package org.usfirst.frc.team199.Robot2018.commands;
2+
3+
import edu.wpi.first.wpilibj.command.Command;
4+
5+
/**
6+
*
7+
*/
8+
public class EjectToScale extends Command {
9+
10+
public EjectToScale() {
11+
// Use requires() here to declare subsystem dependencies
12+
// eg. requires(chassis);
13+
}
14+
15+
// Called just before this Command runs the first time
16+
protected void initialize() {
17+
}
18+
19+
// Called repeatedly when this Command is scheduled to run
20+
protected void execute() {
21+
}
22+
23+
// Make this return true when this Command no longer needs to run execute()
24+
protected boolean isFinished() {
25+
return false;
26+
}
27+
28+
// Called once after isFinished returns true
29+
protected void end() {
30+
}
31+
32+
// Called when another command which requires one or more of the same
33+
// subsystems is scheduled to run
34+
protected void interrupted() {
35+
}
36+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package org.usfirst.frc.team199.Robot2018.commands;
2+
3+
import edu.wpi.first.wpilibj.command.Command;
4+
5+
/**
6+
*
7+
*/
8+
public class EjectToSwitch extends Command {
9+
10+
public EjectToSwitch() {
11+
// Use requires() here to declare subsystem dependencies
12+
// eg. requires(chassis);
13+
}
14+
15+
// Called just before this Command runs the first time
16+
protected void initialize() {
17+
}
18+
19+
// Called repeatedly when this Command is scheduled to run
20+
protected void execute() {
21+
}
22+
23+
// Make this return true when this Command no longer needs to run execute()
24+
protected boolean isFinished() {
25+
return false;
26+
}
27+
28+
// Called once after isFinished returns true
29+
protected void end() {
30+
}
31+
32+
// Called when another command which requires one or more of the same
33+
// subsystems is scheduled to run
34+
protected void interrupted() {
35+
}
36+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package org.usfirst.frc.team199.Robot2018.commands;
2+
3+
import edu.wpi.first.wpilibj.command.Command;
4+
5+
/**
6+
*
7+
*/
8+
public class IntakeCube extends Command {
9+
10+
public IntakeCube() {
11+
// Use requires() here to declare subsystem dependencies
12+
// eg. requires(chassis);
13+
}
14+
15+
// Called just before this Command runs the first time
16+
protected void initialize() {
17+
}
18+
19+
// Called repeatedly when this Command is scheduled to run
20+
protected void execute() {
21+
}
22+
23+
// Make this return true when this Command no longer needs to run execute()
24+
protected boolean isFinished() {
25+
return false;
26+
}
27+
28+
// Called once after isFinished returns true
29+
protected void end() {
30+
}
31+
32+
// Called when another command which requires one or more of the same
33+
// subsystems is scheduled to run
34+
protected void interrupted() {
35+
}
36+
}

Robot2018/src/org/usfirst/frc/team199/Robot2018/commands/RunScript.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ public RunScript(String scriptName) {
2929
addSequential(new AutoMoveTo(cmdArgs));
3030
break;
3131
case "turn":
32-
addSequential(new AutoTurn(cmdArgs[0]));
32+
addSequential(new AutoTurn(Double.parseDouble(cmdArgs[0])));
3333
break;
3434
case "move":
35-
addSequential(new AutoMove(cmdArgs[0]));
35+
addSequential(new AutoMove(Double.parseDouble(cmdArgs[0])));
3636
break;
3737
case "switch":
3838
addSequential(new EjectToSwitch());

0 commit comments

Comments
 (0)