Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions src/org/usfirst/frc/team1646/robot/commands/DisableDSolenoids.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package org.usfirst.frc.team1646.robot.commands;

import org.usfirst.frc.team1646.robot.Robot;

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

/**
*
*/
public class DisableDSolenoids extends Command {

public DisableDSolenoids() {
requires(Robot.ballCollector);
}

// Called just before this Command runs the first time
protected void initialize() {
Robot.ballCollector.neitherChannelEnabled();
}

// Called repeatedly when this Command is scheduled to run
protected void execute() {
}

// Make this return true when this Command no longer needs to run execute()
protected boolean isFinished() {
return true;
}

// Called once after isFinished returns true
protected void end() {
}

// Called when another command which requires one or more of the same
// subsystems is scheduled to run
protected void interrupted() {
}
}
48 changes: 48 additions & 0 deletions src/org/usfirst/frc/team1646/robot/commands/DriveWithSticks.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package org.usfirst.frc.team1646.robot.commands;

import org.usfirst.frc.team1646.robot.Robot;

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

public class DriveWithSticks extends Command {

private double maxPower = 0;

public DriveWithSticks() {
requires(Robot.driveSubsystem);
}

protected void initialize() {
}

protected void execute() {

double left = Robot.oi.leftStick.getY();
double right = Robot.oi.rightStick.getY();

boolean leftTrigger = Robot.oi.leftStick.getRawButton(1);
boolean rightTrigger = Robot.oi.rightStick.getRawButton(1);

if (leftTrigger || rightTrigger) {
maxPower = 1;
Robot.driveSubsystem.tankDrive(maxPower * left, maxPower * right);
} else {
maxPower = 0.5;
Robot.driveSubsystem.tankDrive(maxPower * left, maxPower * right);
}
}

// Make this return true when this Command no longer needs to run execute()
protected boolean isFinished() {
return false;
}

// Called once after isFinished returns true
protected void end() {
}

// Called when another command which requires one or more of the same
// subsystems is scheduled to run
protected void interrupted() {
}
}
38 changes: 38 additions & 0 deletions src/org/usfirst/frc/team1646/robot/commands/PlaceBall.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package org.usfirst.frc.team1646.robot.commands;

import org.usfirst.frc.team1646.robot.Robot;

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

/**
*
*/
public class PlaceBall extends Command {

public PlaceBall() {
requires(Robot.ballCollector);
}

protected void initialize() {
Robot.ballCollector.moveToOriginalS();
//Robot.ballCollector.moveToOriginalD();
}

// Called repeatedly when this Command is scheduled to run
protected void execute() {
}

// Make this return true when this Command no longer needs to run execute()
protected boolean isFinished() {
return true;
}

// Called once after isFinished returns true
protected void end() {
}

// Called when another command which requires one or more of the same
// subsystems is scheduled to run
protected void interrupted() {
}
}
40 changes: 40 additions & 0 deletions src/org/usfirst/frc/team1646/robot/commands/ReachBall.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package org.usfirst.frc.team1646.robot.commands;


import org.usfirst.frc.team1646.robot.Robot;

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

/**
*
*/
public class ReachBall extends Command {

public ReachBall() {
requires(Robot.ballCollector);
}

// Called just before this Command runs the first time
protected void initialize() {
Robot.ballCollector.moveToCollectS();
//Robot.ballCollector.moveToCollectD();
}

// Called repeatedly when this Command is scheduled to run
protected void execute() {
}

// Make this return true when this Command no longer needs to run execute()
protected boolean isFinished() {
return true;
}

// Called once after isFinished returns true
protected void end() {
}

// Called when another command which requires one or more of the same
// subsystems is scheduled to run
protected void interrupted() {
}
}
76 changes: 76 additions & 0 deletions src/org/usfirst/frc/team1646/robot/subsystems/BallCollector.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
package org.usfirst.frc.team1646.robot.subsystems;

import org.usfirst.frc.team1646.robot.RobotMap;

import edu.wpi.first.wpilibj.DoubleSolenoid;
import edu.wpi.first.wpilibj.Solenoid;
import edu.wpi.first.wpilibj.Talon;
import edu.wpi.first.wpilibj.command.Subsystem;

public class BallCollector extends Subsystem {

//FIXME is it a single solenoid or double?
private Solenoid intakeBall;
private Talon keepBall;

private DoubleSolenoid collectBall;

public static boolean extend = false;
public static boolean retract = true;

public BallCollector() {
intakeBall = new Solenoid(RobotMap.intakeBall);
keepBall = new Talon(RobotMap.keepBall);

//Don't know what the forward channel (1st) and a reverse channel (2nd) will be
collectBall = new DoubleSolenoid( , );
}

public Solenoid getIntakeBall() {
return intakeBall;
}

public Talon getKeepBall() {
return keepBall;
}

public DoubleSolenoid getCollectBall() {
return collectBall;
}

public void spinWheels() {
keepBall.set(0.5);
}

// false = extend; true = retract
// S = Single Solenoid; D = Double Solenoid
public void moveToCollectS() {
intakeBall.set(extend);
spinWheels();
}

public void moveToOriginalS() {
intakeBall.set(retract);
spinWheels();
}

public void moveToCollectD() {
collectBall.set(DoubleSolenoid.Value.kForward);
}

public void moveToOriginalD() {
collectBall.set(DoubleSolenoid.Value.kReverse);
}

public void neitherChannelEnabled() {
collectBall.set(DoubleSolenoid.Value.kOff);
}


@Override
protected void initDefaultCommand() {
// TODO Auto-generated method stub

}

}
17 changes: 17 additions & 0 deletions src/org/usfirst/frc/team1646/robot/subsystems/ClawController.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package org.usfirst.frc.team1646.robot.subsystems;

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

public class ClawController extends Subsystem {

public ClawController() {

}

@Override
protected void initDefaultCommand() {
// TODO Auto-generated method stub

}

}
63 changes: 63 additions & 0 deletions src/org/usfirst/frc/team1646/robot/subsystems/DriveSubsystem.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
package org.usfirst.frc.team1646.robot.subsystems;

import org.usfirst.frc.team1646.robot.RobotMap;

import edu.wpi.first.wpilibj.Talon;
import edu.wpi.first.wpilibj.command.Subsystem;

public class DriveSubsystem extends Subsystem {

private Talon frontLeft;
private Talon backLeft;
private Talon frontRight;
private Talon backRight;

public DriveSubsystem() {
frontLeft = new Talon(RobotMap.driveFrontLeft);
backLeft = new Talon(RobotMap.driveBackLeft);
frontRight = new Talon(RobotMap.driveFrontRight);
backRight = new Talon(RobotMap.driveBackRight);
}

public Talon getFrontLeft() {
return frontLeft;
}

public Talon getBackLeft() {
return backLeft;
}

public Talon getFrontRight() {
return frontRight;
}

public Talon getBackRight() {
return backRight;
}

//FIXME the directions might be the opposite
public void rightPower(double right) {
frontRight.set(right);
backRight.set(right);
}

public void leftPower(double left) {
frontLeft.set(left);
backLeft.set(left);
}

public void tankDrive(double left, double right) {

frontLeft.set(left);
backLeft.set(left);

frontRight.set(right);
backRight.set(right);
}
//FIXME the directions might be the opposite

@Override
protected void initDefaultCommand() {
// TODO Auto-generated method stub
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package org.usfirst.frc.team1646.robot.subsystems;

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

public class ShootingSubsystem extends Subsystem {

public ShootingSubsystem() {

}

@Override
protected void initDefaultCommand() {
// TODO Auto-generated method stub

}
}