Skip to content

Commit

Permalink
Adding totes counter to stacker.sequences
Browse files Browse the repository at this point in the history
  • Loading branch information
frc3316 committed Sep 28, 2015
1 parent 8eb338b commit 37ea058
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ protected void execute()

protected boolean isFinished()
{
GamePieceCollected gp = Robot.rollerGripper.getGamePieceCollected();

if (Robot.rollerGripper.getSwitchGamePiece())
{
finishCounter++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
import org.usfirst.frc.team3316.robot.logger.DBugLogger;
import org.usfirst.frc.team3316.robot.rollerGripper.commands.WaitForGamePiece;
import org.usfirst.frc.team3316.robot.stacker.commands.MoveStackerToFloor;
import org.usfirst.frc.team3316.robot.stacker.commands.MoveStackerToStep;
import org.usfirst.frc.team3316.robot.stacker.commands.MoveStackerToTote;
import org.usfirst.frc.team3316.robot.stacker.commands.OpenGripper;

import edu.wpi.first.wpilibj.command.Command;
import edu.wpi.first.wpilibj.command.CommandGroup;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.usfirst.frc.team3316.robot.sequences;

import org.usfirst.frc.team3316.robot.Robot;
import org.usfirst.frc.team3316.robot.chassis.commands.RobotOrientedNavigation;
import org.usfirst.frc.team3316.robot.logger.DBugLogger;
import org.usfirst.frc.team3316.robot.stacker.commands.CloseGripper;
import org.usfirst.frc.team3316.robot.stacker.commands.OpenGripper;
import org.usfirst.frc.team3316.robot.stacker.commands.MoveStackerToFloor;
import org.usfirst.frc.team3316.robot.utils.StackerPosition;

import edu.wpi.first.wpilibj.command.CommandGroup;

Expand All @@ -16,8 +16,7 @@ public class DropoffSequence extends CommandGroup
public DropoffSequence()
{
addSequential(new MoveStackerToFloor());
addSequential(new CloseGripper());
addSequential(new RobotOrientedNavigation(0, -1, 0, 1));
addSequential(new OpenGripper());
}

DBugLogger logger = Robot.logger;
Expand All @@ -30,10 +29,15 @@ protected void initialize ()
protected void end ()
{
logger.info(this.getName() + " end");
Robot.stacker.totesCollected = 0;
}

protected void interrupted ()
{
logger.info(this.getName() + " interrupted");
if (Robot.stacker.getPosition() == StackerPosition.Floor)
{
Robot.stacker.totesCollected = 0;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package org.usfirst.frc.team3316.robot.sequences;

import org.usfirst.frc.team3316.robot.Robot;
import org.usfirst.frc.team3316.robot.chassis.commands.FieldOrientedNavigation;
import org.usfirst.frc.team3316.robot.chassis.commands.RobotOrientedNavigation;
import org.usfirst.frc.team3316.robot.logger.DBugLogger;
import org.usfirst.frc.team3316.robot.rollerGripper.commands.RollOut;
import org.usfirst.frc.team3316.robot.stacker.commands.CloseGripper;

import edu.wpi.first.wpilibj.command.CommandGroup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,16 @@ protected boolean isFinished()
protected void end()
{
logger.fine(this.getName() + " end");
_end();
__end();
}

protected void interrupted()
{
logger.fine(this.getName() + " interrupted");
_end();
__end();
}

private void _end()
private void __end()
{
pidHeight.reset();
Robot.stacker.setMotors(0);
Expand Down
2 changes: 1 addition & 1 deletion src/org/usfirst/frc/team3316/robot/subsystems/Stacker.java
Original file line number Diff line number Diff line change
Expand Up @@ -383,5 +383,5 @@ private void updateStackerHeights()
{
logger.severe(e);
}
}
}
}

0 comments on commit 37ea058

Please sign in to comment.