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

Commit 9dd6365

Browse files
authored
Merge pull request #1 from kevinzwang/lift-auto
Lift auto implementation (EjectTo...'s)
2 parents 36c90ed + 0c1f8cc commit 9dd6365

3 files changed

Lines changed: 24 additions & 78 deletions

File tree

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,16 @@
11
package org.usfirst.frc.team199.Robot2018.commands;
22

3-
import edu.wpi.first.wpilibj.command.Command;
3+
import org.usfirst.frc.team199.Robot2018.Robot;
4+
5+
import edu.wpi.first.wpilibj.command.CommandGroup;
46

57
/**
68
*
79
*/
8-
public class EjectToExchange extends Command {
10+
public class EjectToExchange extends CommandGroup {
911

1012
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() {
13+
addSequential(new LiftToPosition(Robot.lift, "GROUND"));
14+
addSequential(new OuttakeCube());
3515
}
3616
}
Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,19 @@
11
package org.usfirst.frc.team199.Robot2018.commands;
22

3-
import edu.wpi.first.wpilibj.command.Command;
3+
import org.usfirst.frc.team199.Robot2018.Robot;
4+
5+
import edu.wpi.first.wpilibj.command.CommandGroup;
46

57
/**
68
*
79
*/
8-
public class EjectToScale extends Command {
10+
public class EjectToScale extends CommandGroup {
911

1012
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() {
13+
addSequential(new LiftToPosition(Robot.lift, "SCALE"));
14+
addSequential(new PIDMove(Robot.getConst("Auto Scale Move Dist", 12), Robot.dt, Robot.sd, Robot.dt.getDistEncAvg()));
15+
addSequential(new OuttakeCube());
16+
addSequential(new PIDMove(-1 * Robot.getConst("Auto Scale Move Dist", 12), Robot.dt, Robot.sd, Robot.dt.getDistEncAvg()));
17+
addSequential(new LiftToPosition(Robot.lift, "GROUND"));
3518
}
3619
}
Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,19 @@
11
package org.usfirst.frc.team199.Robot2018.commands;
22

3-
import edu.wpi.first.wpilibj.command.Command;
3+
import org.usfirst.frc.team199.Robot2018.Robot;
4+
5+
import edu.wpi.first.wpilibj.command.CommandGroup;
46

57
/**
68
*
79
*/
8-
public class EjectToSwitch extends Command {
10+
public class EjectToSwitch extends CommandGroup {
911

1012
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() {
13+
addSequential(new LiftToPosition(Robot.lift, "SWITCH"));
14+
addSequential(new PIDMove(Robot.getConst("Auto Switch Move Dist", 12), Robot.dt, Robot.sd, Robot.dt.getDistEncAvg()));
15+
addSequential(new OuttakeCube());
16+
addSequential(new PIDMove(-1 * Robot.getConst("Auto Switch Move Dist", 12), Robot.dt, Robot.sd, Robot.dt.getDistEncAvg()));
17+
addSequential(new LiftToPosition(Robot.lift, "GROUND"));
3518
}
3619
}

0 commit comments

Comments
 (0)