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
3 changes: 3 additions & 0 deletions PathWeaver/Groups/3ball5ball
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
TurnToShoot
GoGetTrenchBalls
ShortTrenchShot
10 changes: 10 additions & 0 deletions PathWeaver/Paths/GoGetTrenchBalls
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
X,Y,Tangent X,Tangent Y,Fixed Theta,Name
39.469,-23.026,3.145,0.983,true,
40.99788767222257,-21.98806166855897,0.9856131227182431,0.6147118965576142,false,
42.417713959432476,-21.16893111824556,3.3311309046078534,1.0921740670845423,true,
44.27440987347619,-21.878844261850517,2.2389568375233324,0.5460870335422747,true,
43.40067061980857,-23.462496659123104,4.150261454921264,1.2013914737929987,true,
40.888670265514115,-24.390844616144967,4.259478861629724,0.5460870335422712,true,
37.39371325084357,-24.445453319499194,3.6041744213789997,0.0,true,
35.75545215021677,-24.500062022853424,3.7133918280874454,0.05460870335422996,true,
18.772145407052076,-24.390844616144967,5.515479038776956,0.10921740670845281,true,
4 changes: 4 additions & 0 deletions PathWeaver/Paths/ShortTrenchShot
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
X,Y,Tangent X,Tangent Y,Fixed Theta,Name
18.772,-24.391,5.40640703912058,0.10937279056348359,true,
31.113712365107432,-24.55467072620765,0.6006957368964976,0.0,true,
31.22292977181589,-24.17240980272806,2.4027829475860045,0.8191305503134103,true,
3 changes: 3 additions & 0 deletions PathWeaver/Paths/TurnToShoot
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
X,Y,Tangent X,Tangent Y,Fixed Theta,Name
42.0,-24.336235912790745,-4.31408756498395,-0.05460870335423351,true,
39.468843978304214,-23.025627032289286,3.1446704426613508,0.9829566603760895,true,
1 change: 1 addition & 0 deletions PathWeaver/output/GoGet.wpilib.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions PathWeaver/output/GoGetTrenchBalls.wpilib.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions PathWeaver/output/ShortTrenchShot.wpilib.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions PathWeaver/output/Turn.wpilib.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions PathWeaver/output/TurnToShoot.wpilib.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions PathWeaver/output/Unnamed.wpilib.json

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions PathWeaver/pathweaver.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"lengthUnit": "Foot",
"maxVelocity": 10.0,
"maxAcceleration": 10.0,
"wheelBase": 2.08854,
"gameName": "Infinite Recharge",
"outputDir": ""
}
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 "2020.1.2"
id "edu.wpi.first.GradleRIO" version "2020.2.2"
}

sourceCompatibility = JavaVersion.VERSION_11
Expand Down
12 changes: 12 additions & 0 deletions src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,16 @@ public final class Constants {

public static final double MANUAL_POWER = .2;

//climber
public static final double CLIMBER_CREEP = 0.25;
// public static final double kSelfClimbGoRight = 0.1;
// public static final double kSelfClimbGoLeft= -0.1;

//Global
public static final boolean kToExtendArm = true;

//Panel Mech
public static final double PANEL_MECH_CREEP = 0.1;
public static final double PANEL_MECH_FAST = 0.5;

}
27 changes: 22 additions & 5 deletions src/main/java/frc/robot/OI.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import frc.robot.Autons.stopElevatorShooter;
import frc.robot.Autons.stopHopperElevator;
import frc.robot.commands.*;
import frc.robot.commands.Climb.*;
// import frc.robot.commands.auto.SetLimit;
import frc.robot.controller.AnalogButton;
import frc.robot.controller.DPadButton;
Expand Down Expand Up @@ -74,11 +75,15 @@ public OI() {
//THESE TWO LINES ARE FOR TESTING
//LEAVE OUT driverA.whenPressed(new AutoSetLifterPots());
//LEAVE OUT driverB.whenPressed(new ExtendBothLifters(.8,false,driverStick,false));
driverA.whenPressed(new MoveShooter());
driverA.whenReleased(new StopShooter());
driverB.whenPressed(new MoveElevator());
driverB.whenReleased(new StopElevator());
driverX.whenPressed(new MoveHopper());
// driverA.whenPressed(new MoveShooter());
// driverA.whenReleased(new StopShooter());
// driverB.whenPressed(new MoveElevator());
// driverB.whenReleased(new StopElevator());
driverA.whenPressed(new ExtendPanelMech());
driverB.whenPressed(new SetPanelMech());
driverA.whenReleased(new DefaultPanelMech());

// driverX.whenPressed(new MoveHopper());
driverX.whenReleased(new StopHopper());
driverY.whenPressed(new MoveDrivetrain());
driverY.whenReleased(new StopDrivetrain());
Expand All @@ -89,6 +94,18 @@ public OI() {
driverLS.whenPressed(new runElevatorShooter());
driverLS.whenReleased(new stopElevatorShooter());
operatorLeftJoystickUsed.whenPressed(new RunHopperWithJoystick(operatorLeftJoystickUsed));


operatorX.whenPressed(new ReleasePin());
operatorY.whenPressed(new WinchClimb());
operatorY.whenReleased(new StopWinchClimb());
// operatorA.whenPressed(new ActivePosition());






// //true does right hp far rocket path, false does right hp bay 1 ship path
// // driverY.whenReleased(new StopCargoMotor());
// driverRB.whileHeld(new DriveWithJoystickLeftTalon());
Expand Down
9 changes: 6 additions & 3 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
import frc.robot.subsystems.Hopper;
import frc.robot.subsystems.Shooter;
import edu.wpi.first.wpilibj.Compressor;

import frc.robot.subsystems.Climber;
import frc.robot.subsystems.*;


public class Robot extends TimedRobot {
Expand All @@ -22,16 +23,18 @@ public class Robot extends TimedRobot {
public static Elevator elevator;
public static Hopper hopper;
public static RobotMap robotmap;

public static Climber climber;
public static PanelMech panelMech;
@Override
public void robotInit() {
hopper = new Hopper();
elevator = new Elevator();
shooter = new Shooter();
drivetrain = new Drivetrain();
pdp = new PowerDistributionPanel(RobotMap.kPDP);
oi = new OI();
oi = new OI();
robotmap = new RobotMap();
climber = new Climber();
}

@Override
Expand Down
12 changes: 11 additions & 1 deletion src/main/java/frc/robot/RobotMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,15 @@ public class RobotMap {
public static final int HOPPER_TALON = 24;
//Drivetrain
public static final int DRIVETRAIN_NEO = 22;


//Climber
public static final int WINCH_NEO=60;
public static final int SELFCLIMB_NEO=61;

public static final int CLIMB_SOLENOID=0;
// public static final int CLIMB_GYRO=1;

//PanelMech
public static final int PANEL_NEO=50;
public static final int PANEL_SOLENOID=2;
}
83 changes: 83 additions & 0 deletions src/main/java/frc/robot/commands/Climb/ActivePosition.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/*----------------------------------------------------------------------------*/
/* 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 frc.robot.commands.Climb;

// import edu.wpi.first.wpilibj.command.Command;
// import frc.robot.Robot;
// import edu.wpi.first.wpilibj.GyroBase;
// import frc.robot.Constants;

// public class ActivePosition extends Command {
// private GyroBase climbGyro;
// double angle, turn;
// public ActivePosition() {
// super("ActivePosition");
// // requires(Robot.Climber);
// }

// public double getGyroAngle() {

// angle=climbGyro.getAngle();
// return climbGyro.getAngle();


// }

// // Called just before this Command runs the first time
// @Override
// protected void initialize() {
// }

// // Called repeatedly when this Command is scheduled to run
// @Override
// protected void execute() {
// angle=climbGyro.getAngle();


// if(angle==0){
// turn=0;

// }
// else if(angle/360==0){

// turn=0;
// }
// else if(angle>270&&angle<360){

// turn=Constants.kSelfClimbGoRight;
// }

// else if(angle<90&&angle>0){
// turn=Constants.kSelfClimbGoLeft;
// }


// Robot.climber.setSelfClimbOutput(turn);
// }




// // 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() {
// Robot.climber.setSelfClimbOutput(0);
// }

// // Called when another command which requires one or more of the same
// // subsystems is scheduled to run
// @Override
// protected void interrupted() {
// }
// }
40 changes: 40 additions & 0 deletions src/main/java/frc/robot/commands/Climb/ReleasePin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*----------------------------------------------------------------------------*/
/* 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 frc.robot.commands.Climb;
import frc.robot.Robot;
import edu.wpi.first.wpilibj.command.Command;
import frc.robot.subsystems.Climber;

public class ReleasePin extends Command {
public ReleasePin() {
super("ReleasePin");
requires(Robot.climber);
}


protected void initialize() {

}

protected void execute() {
Robot.climber.setPinExtender(false);
}

protected boolean isFinished() {
return false;
}

protected void end() {

Robot.climber.setPinExtender(true);
}

protected void interrupted() {

}
}
48 changes: 48 additions & 0 deletions src/main/java/frc/robot/commands/Climb/StopWinchClimb.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*----------------------------------------------------------------------------*/
/* 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 frc.robot.commands.Climb;

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

public class StopWinchClimb extends Command {
public StopWinchClimb() {
// Use requires() here to declare subsystem dependencies
// eg. requires(chassis);
}

// Called just before this Command runs the first time
@Override
protected void initialize() {
}

// Called repeatedly when this Command is scheduled to run
@Override
protected void execute() {
Robot.climber.setWinchOutput(0);
}

// 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() {
Robot.climber.setWinchOutput(0);

}

// Called when another command which requires one or more of the same
// subsystems is scheduled to run
@Override
protected void interrupted() {
}
}
48 changes: 48 additions & 0 deletions src/main/java/frc/robot/commands/Climb/WinchClimb.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*----------------------------------------------------------------------------*/
/* 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 frc.robot.commands.Climb;

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

public class WinchClimb extends Command {
public WinchClimb() {
// Use requires() here to declare subsystem dependencies
// eg. requires(chassis);
}

// Called just before this Command runs the first time
@Override
protected void initialize() {
}

// Called repeatedly when this Command is scheduled to run
@Override
protected void execute() {
Robot.climber.setWinchOutput(1);
}

// 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() {
Robot.climber.setWinchOutput(1);

}

// Called when another command which requires one or more of the same
// subsystems is scheduled to run
@Override
protected void interrupted() {
}
}
Loading