Quote:
protected boolean isFinished() {
if (numberOfUnits < 0) {
return (driveTrain.talon.getPosition() >= -numberOfUnits);
}
return (driveTrain.talon.getPosition() <= -numberOfUnits);
}
|
This is just from my perspective because I don't know what values you are getting from driveTrain.talon.getPosition(), but it seems your return equations are off. When the numberOfUnits is negative, driveTrain.talon.getPosition() is also going in the negative direction. So when you take the negative of numberOfUnits when it is already a negative number, its turns to a positive number. So when is driveTrain.talon.getPosition() (a negative number) ever greater than or equal to a positive number? Never. Your return would always be false and so the command would never end. The other equation seems to be off to me to, but I think you get my point now.