Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add files via upload #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
1 change: 1 addition & 0 deletions PowerUp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# PowerUp
Binary file modified PowerUp/build/AutoCommands/ArmGoUp.class
Binary file not shown.
Binary file added PowerUp/build/AutoCommands/DT_DriveDistance.class
Binary file not shown.
Binary file added PowerUp/build/AutoCommands/DT_TurnToAngle.class
Binary file not shown.
Binary file modified PowerUp/build/AutoCommands/DriveDistance.class
Binary file not shown.
Binary file modified PowerUp/build/AutoCommands/DropCube.class
Binary file not shown.
Binary file modified PowerUp/build/AutoCommands/TurnToAngle.class
Binary file not shown.
Binary file added PowerUp/build/AutoCommands/armGoDown.class
Binary file not shown.
Binary file added PowerUp/build/AutoModes/AutoLine.class
Binary file not shown.
Binary file modified PowerUp/build/AutoModes/AutoMode.class
Binary file not shown.
Binary file modified PowerUp/build/AutoModes/DriveStraight.class
Binary file not shown.
Binary file added PowerUp/build/AutoModes/LeftCross.class
Binary file not shown.
Binary file not shown.
Binary file added PowerUp/build/AutoModes/RightCross.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified PowerUp/build/AutoModes/SwitchAuto.class
Binary file not shown.
Binary file added PowerUp/build/AutoModes/SwitchAuto1.class
Binary file not shown.
Binary file modified PowerUp/build/AutoModes/SwitchAuto2.class
Binary file not shown.
Binary file added PowerUp/build/AutoModes/SwitchPriorityLeft.class
Binary file not shown.
Binary file added PowerUp/build/AutoModes/SwitchPriorityRight.class
Binary file not shown.
Binary file modified PowerUp/build/org/usfirst/frc/team548/robot/Climber.class
Binary file not shown.
Binary file modified PowerUp/build/org/usfirst/frc/team548/robot/Constants.class
Binary file not shown.
Binary file modified PowerUp/build/org/usfirst/frc/team548/robot/DriveTrain.class
Binary file not shown.
Binary file modified PowerUp/build/org/usfirst/frc/team548/robot/Elevator.class
Binary file not shown.
Binary file modified PowerUp/build/org/usfirst/frc/team548/robot/Ingestor.class
Binary file not shown.
Binary file modified PowerUp/build/org/usfirst/frc/team548/robot/Robot.class
Binary file not shown.
Binary file modified PowerUp/build/org/usfirst/frc/team548/robot/TeleOp.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified PowerUp/build/org/usfirst/frc/team548/robot/XBoxController.class
Binary file not shown.
Binary file modified PowerUp/dist/FRCUserProgram.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions PowerUp/src/AutoCommands/ArmGoUp.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ public void init() {
// TODO Auto-generated method stub

Elevator.resetEncoder();


}

Expand All @@ -41,4 +40,4 @@ protected String getCommandName() {
return null;
}

}
}
64 changes: 64 additions & 0 deletions PowerUp/src/AutoCommands/DT_DriveDistance.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
package AutoCommands;

import org.usfirst.frc.team548.robot.DriveTrain;
import org.usfirst.frc.team548.robot.Elevator;
import org.usfirst.frc.team548.robot.Ingestor;

public class DT_DriveDistance extends AutoCommandBase{
private double power;
private double elevatorSetPoint;
private double ingestorPower;
private double distance;
private final double kP = 0.03;

public DT_DriveDistance(double timeOut, double power, double distance, double elevatorSetPoint, double ingestorPower) {
super(timeOut);

this.power = power;
this.elevatorSetPoint = elevatorSetPoint;
this.ingestorPower = ingestorPower;
// TODO Auto-generated constructor stub
}

@Override
public void init() {
// TODO Auto-generated method stub
DriveTrain.resetEncoder();
DriveTrain.resetGyro();
}

@Override
protected void run() {
// TODO Auto-generated method stub
if(Math.abs(Math.abs(DriveTrain.getEncoderAverage())) < Math.abs(distance)){
double angle = DriveTrain.getAngle();
DriveTrain.pidDriveStraight(0.5);
}else{
DriveTrain.stop();
Elevator.setPosition(elevatorSetPoint);
Ingestor.bothControl(ingestorPower);
}

}

@Override
public void end() {
// TODO Auto-generated method stub
DriveTrain.stop();
DriveTrain.resetGyro();
DriveTrain.resetEncoder();
DriveTrain.disablePID();

Elevator.setPosition(elevatorSetPoint);
Ingestor.bothControl(ingestorPower);

}

@Override
protected String getCommandName() {
// TODO Auto-generated method stub
return "Better Drive Distance";
}


}
50 changes: 50 additions & 0 deletions PowerUp/src/AutoCommands/DT_TurnToAngle.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package AutoCommands;

import org.usfirst.frc.team548.robot.DriveTrain;
import org.usfirst.frc.team548.robot.Elevator;
import org.usfirst.frc.team548.robot.Ingestor;

public class DT_TurnToAngle extends AutoCommandBase{

private double angle = 0;
private double power;
private double elevatorSetPoint;
private double ingestorPower;

public DT_TurnToAngle(double timeOut, double angle, double power, double elevatorSetPoint, double ingestorPower){
super(timeOut);
this.angle = angle;
this.power = power;
this.elevatorSetPoint = elevatorSetPoint;
this.ingestorPower = ingestorPower;
}

@Override
public void init() {
// TODO Auto-generated method stub
DriveTrain.resetGyro();
}

@Override
protected void run() {
// TODO Auto-generated method stub
DriveTrain.turnToAngle(angle);
Ingestor.bothControl(ingestorPower);
}

@Override
public void end() {
// TODO Auto-generated method stub
DriveTrain.disablePID();
System.out.println(DriveTrain.getAngle());
DriveTrain.resetGyro();
Elevator.setPosition(elevatorSetPoint);
Ingestor.bothControl(ingestorPower);
}

@Override
protected String getCommandName() {
// TODO Auto-generated method stub
return "Accurate Turn To Angle";
}
}
9 changes: 4 additions & 5 deletions PowerUp/src/AutoCommands/DriveDistance.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ public DriveDistance(double timeOut, double power, double distance, double eleva

public void init(){
DriveTrain.resetEncoder();
//DriveTrain.resetGyro();
//Elevator.resetEncoder();
DriveTrain.resetGyro();
}

@Override
Expand All @@ -41,8 +40,8 @@ protected void run() {
public void end() {
// TODO Auto-generated method stub
DriveTrain.stop();
//DriveTrain.resetGyro();
//DriveTrain.resetEncoder();
DriveTrain.resetGyro();
DriveTrain.resetEncoder();
Elevator.setPosition(elevatorSetPoint);
Ingestor.bothControl(ingestorPower);
}
Expand All @@ -53,4 +52,4 @@ protected String getCommandName() {
return "Drive Distance";
}

}
}
5 changes: 4 additions & 1 deletion PowerUp/src/AutoCommands/DropCube.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import org.usfirst.frc.team548.robot.Elevator;
import org.usfirst.frc.team548.robot.Ingestor;
import org.usfirst.frc.team548.robot.TeleOp;

public class DropCube extends AutoCommandBase {
private double powerLeft, powerRight, elevatorSetPoint;
Expand Down Expand Up @@ -33,6 +34,8 @@ protected void run() {
public void end() {
// TODO Auto-generated method stub
Ingestor.stop();


//Elevator.setElevatorOut();

}
Expand All @@ -43,4 +46,4 @@ protected String getCommandName() {
return "Drop Cube";
}

}
}
2 changes: 1 addition & 1 deletion PowerUp/src/AutoCommands/ElevatorSetPoint.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ protected String getCommandName() {
return null;
}

}
}
2 changes: 1 addition & 1 deletion PowerUp/src/AutoCommands/TurnToAngle.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected void run() {
DriveTrain.arcadeDrive(0, power);
else if(DriveTrain.getAngle() < angle && DriveTrain.getAngle() > angle - angleOffSet)
DriveTrain.arcadeDrive(0, .15);
Elevator.setPosition(elevatorSetPoint);
// Elevator.setPosition(elevatorSetPoint);
}
else{
if(DriveTrain.getAngle() > (angle + angleOffSet))
Expand Down
43 changes: 43 additions & 0 deletions PowerUp/src/AutoCommands/armGoDown.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package AutoCommands;

import org.usfirst.frc.team548.robot.Elevator;

public class armGoDown extends AutoCommandBase {
public static boolean position;

public armGoDown(double timeOut, boolean pos) {
super(timeOut);
this.position = pos;
// TODO Auto-genearmGoDownrated constructor stub
}

@Override
public void init() {
// TODO Auto-generated method stub

Elevator.resetEncoder();

}

@Override
protected void run() {
// TODO Auto-generated method stub
Elevator.setElevatorIn();
////Elevator.setPosition(0);
}


@Override
public void end() {
// TODO Auto-generated method stub
Elevator.setElevatorIn();
Elevator.setPosition(0);
}

@Override
protected String getCommandName() {
// TODO Auto-generated method stub
return null;
}

}
17 changes: 17 additions & 0 deletions PowerUp/src/AutoModes/AutoLine.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package AutoModes;

import org.usfirst.frc.team548.robot.Ingestor;

public class AutoLine extends AutoMode {

@Override
protected void run() {
// TODO Auto-generated method stub
driveDistance(1, -.3, (260 * 8), 10, 0, .3);
driveDistance(8, -.7, (32500), 10, 0, .3);
turnToAngle(2, 45, 8, .5, 0);
Ingestor.closeIngestor();
armGoUp(1, true);
}

}
28 changes: 16 additions & 12 deletions PowerUp/src/AutoModes/AutoMode.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

import AutoCommands.ArmGoUp;
import AutoCommands.AutoCommandBase;
//import AutoCommands.DT_DriveDistance;
import AutoCommands.DT_TurnToAngle;
import AutoCommands.DriveDistance;
import AutoCommands.DropCube;
import AutoCommands.ElevatorSetPoint;
import AutoCommands.OneSideTurn;
//import AutoCommands.OneSideTurn;
import AutoCommands.TurnToAngle;
import AutoCommands.Wait;
//import AutoCommands.Wait;


public abstract class AutoMode {
private String autoName;

public void start(){
run();
}
Expand All @@ -31,14 +31,13 @@ protected void turnToAngle(double seconds, double angle, double offset, double p
runCommand(new TurnToAngle(seconds, angle, offset, power, setPoint));
}

protected void doubleSidePower(double seconds, double leftPower, double rightPower){
runCommand(new OneSideTurn(seconds, leftPower, rightPower));
protected void dtTurnToAngle(double seconds, double angle, double power, double elevatorSetPoint, double ingestorPower){
runCommand(new DT_TurnToAngle(seconds, angle, power, elevatorSetPoint, ingestorPower));
}

protected void waitTime(double seconds){
runCommand(new Wait(seconds));
protected void dtDriveDistance(double seconds, double power, double distance, double elevatorSetPoint, double ingestorSetPoint){
runCommand(new DriveDistance(seconds, power, distance, elevatorSetPoint, ingestorSetPoint));
}

protected void armGoUp(double seconds, boolean pos){
runCommand(new ArmGoUp(seconds, pos));
}
Expand All @@ -47,11 +46,16 @@ protected void elevatotSet(double seconds, double angle){
runCommand(new ElevatorSetPoint(seconds, angle));
}

protected void armGoDown(double seconds, boolean pos){
runCommand(new AutoCommands.armGoDown(seconds, pos));
}

protected void DT_DriveDistance(double timeOut, double power, double distance, double elevatorSetPoint, double ingestorPower){
runCommand(new AutoCommands.DT_DriveDistance(timeOut, power, distance, elevatorSetPoint, ingestorPower));
}
private void runCommand(AutoCommandBase command) {
// TODO Auto-generated method stub
//TODO Auto-generated method stub
command.execute();
}


}

Loading