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

Commit 8eb8ca2

Browse files
committed
Fixed minor issues
Forgot to set current position after running lift command.
1 parent 11e0bd4 commit 8eb8ca2

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public class AutoLift extends Command implements PIDOutput{
2727
private double desiredDist = 0;
2828
private double currDist = 0;
2929
private LiftInterface lift;
30+
private Position desiredPos;
3031

3132
private PIDController liftController;
3233

@@ -66,6 +67,8 @@ public AutoLift(Position stage, LiftInterface lift) {
6667

6768
liftController = new PIDController(Robot.getConst("LiftkP", 1), Robot.getConst("LiftkI", 0),
6869
Robot.getConst("LiftkD", 0),RobotMap.liftEnc, this);
70+
71+
desiredPos = stage;
6972
}
7073

7174
// Called just before this Command runs the first time
@@ -87,7 +90,11 @@ protected void execute() {
8790

8891
// Make this return true when this Command no longer needs to run execute()
8992
protected boolean isFinished() {
90-
return liftController.onTarget();
93+
if(liftController.onTarget()) {
94+
lift.setTargetPosition(desiredPos);
95+
return true;
96+
}
97+
return false;
9198
}
9299

93100
// Called once after isFinished returns true

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package org.usfirst.frc.team199.Robot2018.subsystems;
22

3+
import org.usfirst.frc.team199.Robot2018.subsystems.LiftInterface.Position;
4+
35
public interface LiftInterface {
46

57
/**
@@ -54,4 +56,9 @@ public enum Position {
5456
*/
5557
public void resetEnc();
5658

59+
/**
60+
* Sets the current position in the lift subsystem
61+
* @param newPosition - the new position meant to be set
62+
*/
63+
public void setTargetPosition(Position newPosition);
5764
}

0 commit comments

Comments
 (0)