Skip to content

Commit

Permalink
Removed ALL the GRIP
Browse files Browse the repository at this point in the history
  • Loading branch information
keidson299 committed Mar 12, 2016
1 parent d2f0d83 commit 33ede69
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 263 deletions.
18 changes: 1 addition & 17 deletions src/com/team3925/robot2016/OI.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,20 @@

import java.text.DecimalFormat;

import com.team3925.robot2016.commands.AutoRoutineCenter;
import com.team3925.robot2016.commands.AutoRoutineCourtyard;
import com.team3925.robot2016.commands.AutoRoutineDoNothing;
import com.team3925.robot2016.commands.CollectBall;
import com.team3925.robot2016.commands.GyroTurn;
import com.team3925.robot2016.commands.LaunchBallLow;
import com.team3925.robot2016.commands.ThrowBall;
import com.team3925.robot2016.commands.VerticalAim;
import com.team3925.robot2016.commands.defensecommands.CrossDefault;
import com.team3925.robot2016.commands.defensecommands.CrossRoughTerrain;
import com.team3925.robot2016.commands.defensecommands.DefenseCrossBase;
import com.team3925.robot2016.util.RobotPosition;
import com.team3925.robot2016.util.XboxHelper;

import edu.wpi.first.wpilibj.DriverStation;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.buttons.Button;
import edu.wpi.first.wpilibj.buttons.JoystickButton;
import edu.wpi.first.wpilibj.command.Command;
import edu.wpi.first.wpilibj.command.CommandGroup;
import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;


/**
Expand Down Expand Up @@ -72,7 +64,6 @@ public final class OI {
public Button startVision;
public Button cancelCommands;

public Command visionShoot;
public Command collectBall;
public Command throwBallFar;
public Command throwBallNear;
Expand All @@ -94,36 +85,31 @@ public OI() {
throwBallFar = new ThrowBall(65, 1, 5);
throwBallNear = new ThrowBall(80, 1, 5);
throwBallLow = new ThrowBall(30, 1, 1);
visionShoot = new VerticalAim();


startCollectBall = new JoystickButton(xboxShooter, XboxHelper.A);
startCollectBall.whenPressed(collectBall);
startCollectBall.cancelWhenPressed(throwBallNear);
startCollectBall.cancelWhenPressed(throwBallFar);
startCollectBall.cancelWhenPressed(throwBallLow);
startCollectBall.cancelWhenPressed(visionShoot);

startThrowBallFar = new JoystickButton(xboxShooter, XboxHelper.Y);
startThrowBallFar.whenPressed(throwBallFar);
startThrowBallFar.cancelWhenPressed(collectBall);
startThrowBallFar.cancelWhenPressed(throwBallNear);
startThrowBallFar.cancelWhenPressed(throwBallLow);
startThrowBallFar.cancelWhenPressed(visionShoot);

startThrowBallNear = new JoystickButton(xboxShooter, XboxHelper.X);
startThrowBallNear.whenPressed(throwBallNear);
startThrowBallNear.cancelWhenPressed(throwBallFar);
startThrowBallNear.cancelWhenPressed(collectBall);
startThrowBallNear.cancelWhenPressed(throwBallLow);
startThrowBallNear.cancelWhenPressed(visionShoot);

startLow = new JoystickButton(xboxShooter, XboxHelper.B);
startLow.whenPressed(throwBallLow);
startLow.cancelWhenPressed(throwBallFar);
startLow.cancelWhenPressed(collectBall);
startLow.cancelWhenPressed(throwBallNear);
startLow.cancelWhenPressed(visionShoot);

// startVision = new JoystickButton(xboxDriver, XboxHelper.BACK);
// startVision.whenPressed(visionShoot);
Expand All @@ -137,7 +123,6 @@ public OI() {
cancelCommands.cancelWhenPressed(throwBallFar);
cancelCommands.cancelWhenPressed(throwBallNear);
cancelCommands.cancelWhenPressed(throwBallLow);
cancelCommands.cancelWhenPressed(visionShoot);

positionChooser = new SendableChooser();
positionChooser.addDefault("1 - Far Right", new Integer(0));
Expand All @@ -164,7 +149,6 @@ public OI() {


// SmartDashboard.putData("Position Chooser", positionChooser);
SmartDashboard.putData("VisionShoot", visionShoot);


// SmartDashboard Buttons
Expand Down
40 changes: 0 additions & 40 deletions src/com/team3925/robot2016/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,15 @@


import static com.team3925.robot2016.Constants.DO_LOG_AHRS_VALUES;
import static com.team3925.robot2016.Constants.DO_LOG_GRIP_VALUES;
import static com.team3925.robot2016.Constants.DO_LOG_PDP_VALUES;

import com.kauailabs.navx.frc.AHRS;
import com.ni.vision.NIVision.CircleMatch;
import com.team3925.robot2016.commands.Climb;
import com.team3925.robot2016.commands.GyroTurn;
import com.team3925.robot2016.commands.LaunchBallHigh;
import com.team3925.robot2016.commands.ManualDrive;
import com.team3925.robot2016.commands.ManualPlexiArms;
import com.team3925.robot2016.commands.TrapzoidalMotionTest;
import com.team3925.robot2016.commands.VerticalAim;
import com.team3925.robot2016.commands.defensecommands.CrossDefault;
import com.team3925.robot2016.subsystems.Climber;
import com.team3925.robot2016.subsystems.DriveTrain;
Expand All @@ -33,7 +30,6 @@
import edu.wpi.first.wpilibj.command.CommandGroup;
import edu.wpi.first.wpilibj.command.Scheduler;
import edu.wpi.first.wpilibj.livewindow.LiveWindow;
import edu.wpi.first.wpilibj.networktables.NetworkTable;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;

/**
Expand All @@ -55,7 +51,6 @@ public class Robot extends IterativeRobot implements SmartdashBoardLoggable {
public static Preferences prefs;
public static AHRS navx = null;
public static PowerDistributionPanel pdp;
public static NetworkTable table;
public static OI oi;

//Commands
Expand Down Expand Up @@ -106,14 +101,6 @@ public void robotInit() {
Preferences.getInstance();
pdp = RobotMap.pdp;

table = NetworkTable.getTable("GRIP/Madera3925");
try {
new ProcessBuilder("/home/lvuser/grip").inheritIO().start();
}catch (Exception e) {
e.printStackTrace();
}
table.putBoolean("run", false);

// OI must be constructed after subsystems. If the OI creates Commands
//(which it very likely will), subsystems are not guaranteed to be
// constructed yet. Thus, their requires() statements may grab null
Expand All @@ -126,7 +113,6 @@ public void robotInit() {
manualDrive = new ManualDrive();
trapMotionTest = new TrapzoidalMotionTest();
manualCandyCanes = new Climb();
visionTest = new VerticalAim();
launchBallHigh = new LaunchBallHigh();
gyroTurn = new GyroTurn(45);
gyroDrive = new CrossDefault();
Expand Down Expand Up @@ -298,39 +284,13 @@ public void logData() {
}
}

if (DO_LOG_GRIP_VALUES) {
if (table.isConnected()) {
// logGRIPData();
}else {
putStringSD("GRIPLogger", "Cannot log GRIP values while unconnected!");
}
}
}

@Override
public String getFormattedName() {
return "Robot_";
}

private void logGRIPData() {
double[] area = table.getNumberArray("area", defaultVal);
double[] width = table.getNumberArray("width", defaultVal);
double[] height = table.getNumberArray("height", defaultVal);
double[] solidity = table.getNumberArray("solidity", defaultVal);
double[] centerX = table.getNumberArray("centerX", defaultVal);
double[] centerY = table.getNumberArray("centerY", defaultVal);
int areasCount = area.length;
putNumberSD("NetworkTables_Count", areasCount);
for (int i=0; i<1; i++) {
putNumberSD("NetworkTables_Area_"+i, area[i]);
putNumberSD("NetworkTables_Width_"+i, width[i]);
putNumberSD("NetworkTables_Height_"+i, height[i]);
putNumberSD("NetworkTables_Solidity_"+i, solidity[i]);
putNumberSD("NetworkTables_CenterX_"+i, centerX[i]);
putNumberSD("NetworkTables_CenterY_"+i, centerY[i]);
}
}

private void logNavXData() {
// Copied from navXMXP Data Monitor Project

Expand Down
2 changes: 0 additions & 2 deletions src/com/team3925/robot2016/commands/LaunchBallHigh.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ public LaunchBallHigh() {
protected void initialize() {
camDist = yawOffsetDegs = pixCenter = 0;
mode = Mode.ROUGH_AIM;
table = Robot.table;

table.putBoolean("run", true);
table.addTableListener(tableListener, true);
calcData();

Expand Down
Loading

0 comments on commit 33ede69

Please sign in to comment.