Created HatchAndBallSet

Replaced references to replaced commands with HatchAndBallSet
This commit is contained in:
Elijah
2019-03-07 16:40:48 -07:00
parent cfcbf2ce4a
commit 2c2b67c60d
6 changed files with 76 additions and 7 deletions
@@ -57,15 +57,15 @@ public class OI
JoystickButton liftBothIntake = new JoystickButton(m_operatorXbox.getJoyStick(), XboxController.X_BUTTON);
liftBothIntake.whenPressed(new HatchAndBallUp());
liftBothIntake.whenPressed(new HatchAndBallSet(false, false));
JoystickButton liftHatchIntake = new JoystickButton(m_operatorXbox.getJoyStick(), XboxController.RIGHT_BUMPER_BUTTON);
liftHatchIntake.whenPressed(new LiftHatchDropBall());
liftHatchIntake.whenPressed(new HatchAndBallSet(false, true));
JoystickButton liftBallIntake = new JoystickButton(m_operatorXbox.getJoyStick(), XboxController.LEFT_BUMPER_BUTTON);
//liftBallIntake.whenPressed(new HatchFlip(false));
liftBallIntake.whenPressed(new LiftBallDropHatch());
liftBallIntake.whenPressed(new HatchAndBallSet(true, false));
JoystickButton climbUp = new JoystickButton(m_driverXbox.getJoyStick(), XboxController.RIGHT_TRIGGER_AXIS);
@@ -0,0 +1,61 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
package org.usfirst.frc4388.robot.commands;
import org.usfirst.frc4388.robot.Robot;
import org.usfirst.frc4388.robot.subsystems.Pneumatics;
import edu.wpi.first.wpilibj.command.Command;
/**
* Sets the hatch intake and ball intake to the boolean values passed in.
* This will have no effect if called and both subsystems are already in the desired state.
* @param hatch true is deployed, false is undeployed
* @param ball true is deployed, false is undeployed
*/
public class HatchAndBallSet extends Command {
private boolean hatchposition;
private boolean ballposition;
public HatchAndBallSet(boolean hatch, boolean ball) {
requires(Robot.pnumatics);
hatchposition = !hatch;
ballposition = ball;
}
// Called just before this Command runs the first time
@Override
protected void initialize() {
Robot.pnumatics.setBallIntake(ballposition);
Robot.pnumatics.setHatchIntakeState(hatchposition);
}
// Called repeatedly when this Command is scheduled to run
@Override
protected void execute() {
}
// Make this return true when this Command no longer needs to run execute()
@Override
protected boolean isFinished() {
return false;
}
// Called once after isFinished returns true
@Override
protected void end() {
}
// Called when another command which requires one or more of the same
// subsystems is scheduled to run
@Override
protected void interrupted() {
}
}
@@ -8,7 +8,9 @@
package org.usfirst.frc4388.robot.commands;
import edu.wpi.first.wpilibj.command.CommandGroup;
/**
* @deprecated use HatchAndBallSet insted for all setting of hatch and ball intakes
*/
public class HatchAndBallUp extends CommandGroup {
/**
* Add your docs here.
@@ -3,7 +3,9 @@ package org.usfirst.frc4388.robot.commands;
import org.usfirst.frc4388.robot.Robot;
import edu.wpi.first.wpilibj.command.Command;
/**
* @deprecated use HatchAndBallSet insted for all setting of hatch and ball intakes
*/
public class HatchFlip extends Command
{
public boolean PickingUp;
@@ -8,7 +8,9 @@
package org.usfirst.frc4388.robot.commands;
import edu.wpi.first.wpilibj.command.CommandGroup;
/**
* @deprecated use HatchAndBallSet insted for all setting of hatch and ball intakes
*/
public class LiftBallDropHatch extends CommandGroup {
/**
* Add your docs here.
@@ -8,7 +8,9 @@
package org.usfirst.frc4388.robot.commands;
import edu.wpi.first.wpilibj.command.CommandGroup;
/**
* @deprecated use HatchAndBallSet insted for all setting of hatch and ball intakes
*/
public class LiftHatchDropBall extends CommandGroup {
/**
* Add your docs here.