Skip to content

Commit

Permalink
unstaged changes + pit mayhem
Browse files Browse the repository at this point in the history
  • Loading branch information
curtisf committed Mar 2, 2019
1 parent cf0894d commit c5bc7f7
Show file tree
Hide file tree
Showing 13 changed files with 24 additions and 204 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id "java"
id "edu.wpi.first.GradleRIO" version "2019.3.2"
id "edu.wpi.first.GradleRIO" version "2019.4.1"
}

def ROBOT_MAIN_CLASS = "frc.robot.Main"
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/frc/robot/OI.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ public static void init() {
auxStick = new Joystick(RobotMap.auxillaryStick);

Button moveArmToPos = new JoystickButton(leftDriveStick, 9);
Button movePivotDown = new JoystickButton(auxStick, 4);
Button movePivotUp = new JoystickButton(auxStick, 5);
Button moveArmToHighestRocket = new JoystickButton(leftDriveStick, 8);

moveArmToHighestRocket.whileHeld(new MoveToHighRocket());
moveArmToPos.whileHeld(new MoveTo47());
}

Expand Down
3 changes: 0 additions & 3 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,6 @@ public void teleopInit() {
// teleop starts running. If you want the autonomous to
// continue until interrupted by another command, remove
// this line or comment it out.
if (m_autonomousCommand != null) {
m_autonomousCommand.cancel();
}
//CommandBase.grabber.toggle();
}

Expand Down
3 changes: 0 additions & 3 deletions src/main/java/frc/robot/commands/AutoDriveToTarget.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,9 @@ public class AutoDriveToTarget extends CommandBase {

public AutoDriveToTarget() {
super("AutoDrive");
System.out.println("wew");
// Use requires() here to declare subsystem dependencies
requires(driveTrain);
requires(vision);
requires(climber);
System.out.println("lad");

limelight = NetworkTableInstance.getDefault().getTable("limelight");
}
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/frc/robot/commands/ClimberDrive.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ protected void execute() {
System.out.println("Toggle grabber");
}

if (rightStick.getRawButtonPressed(9)) {
climber.driveBack(0.5);
if (auxJoystick.getRawButtonPressed(4)) {
climber.driveBack(0.25);
}

if (auxJoystick.getRawButtonPressed(2)) {
climber.driveBack(1);
if (auxJoystick.getRawButtonPressed(5)) {
climber.driveBack(-0.25);
}

if (Math.abs(auxJoystick.getY()) <= 0.05) // Arm is disabled, just drives the climb motors here
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/frc/robot/commands/CommandBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import frc.robot.subsystems.Climber;
import frc.robot.subsystems.DriveTrain;
import frc.robot.subsystems.Grabber;
import frc.robot.subsystems.Vacuum;
import frc.robot.subsystems.Vision;
import frc.robot.OI;

Expand All @@ -23,7 +22,6 @@ public class CommandBase extends Command {
public static Vision vision;
public static Climber climber;
public static Grabber grabber;
public static Vacuum vacuum;

// Init all subsystems
public static void init() {
Expand All @@ -33,7 +31,6 @@ public static void init() {
driveTrain = new DriveTrain();
vision = new Vision();
grabber = new Grabber();
vacuum = new Vacuum();

OI.init();
}
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/frc/robot/commands/MoveTo47.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ public class MoveTo47 extends CommandBase {
public MoveTo47() {
super("MoveTo47Inches");
requires(climber);
// Use requires() here to declare subsystem dependencies
// eg. requires(chassis);
}

// Called just before this Command runs the first time
Expand All @@ -40,6 +38,7 @@ public boolean isFinished() { // Do not worry about this method. It will be inte
// Called once after isFinished returns true
@Override
protected void end() {
climber.driveArm(0);
}

// Called when another command which requires one or more of the same
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,44 @@

package frc.robot.commands;

import edu.wpi.first.wpilibj.command.Command;
import frc.robot.RobotMap;

public class LiftToHeight extends Command {
public LiftToHeight() {
// Use requires() here to declare subsystem dependencies
// eg. requires(chassis);
public class MoveToHighRocket extends CommandBase {

boolean upThere = false;

public MoveToHighRocket() {
super("MoveToHighRocket");
requires(climber);
}

// Called just before this Command runs the first time
@Override
protected void initialize() {
System.out.println("Move to high rocket started");
climber.setArmPos(-15);
}

// Called repeatedly when this Command is scheduled to run
@Override
protected void execute() {
System.out.println("high rocket pid exec");
}

// Make this return true when this Command no longer needs to run execute()
@Override
protected boolean isFinished() {
public boolean isFinished() { // Do not worry about this method. It will be interrupted when the button is released (2)
return false;
}

// Called once after isFinished returns true
@Override
protected void end() {
climber.driveArm(0);
}

// Called when another command which requires one or more of the same
// subsystems is scheduled to run
@Override
protected void interrupted() {
System.out.println("Move to high rocket interrupted");
}
}
46 changes: 0 additions & 46 deletions src/main/java/frc/robot/commands/RunVacuumBackwards.java

This file was deleted.

48 changes: 0 additions & 48 deletions src/main/java/frc/robot/commands/RunVacuumForward.java

This file was deleted.

43 changes: 0 additions & 43 deletions src/main/java/frc/robot/commands/VacuumDrive.java

This file was deleted.

2 changes: 2 additions & 0 deletions src/main/java/frc/robot/subsystems/Climber.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ public Climber() {
arm = new CANSparkMax(5, MotorType.kBrushless);
armEncoder = new CANEncoder(arm);
armPID = new CANPIDController(arm);
armEncoder.getVelocity();
armEncoder.getPosition();

backDriveRight.setInverted(true);

Expand Down
41 changes: 0 additions & 41 deletions src/main/java/frc/robot/subsystems/Vacuum.java

This file was deleted.

0 comments on commit c5bc7f7

Please sign in to comment.