-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
696 changed files
with
19,604 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> | ||
<classpathentry kind="src" path=""/> | ||
<classpathentry kind="output" path=""/> | ||
</classpath> |
Empty file.
Binary file not shown.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
19 changes: 19 additions & 0 deletions
19
.metadata/.plugins/org.eclipse.core.resources/.history/1/2094dbebd8cb001714af86d1656e2d65
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package org.usfirst.frc.team4001.robot; | ||
|
||
/** | ||
* The RobotMap is a mapping from the ports sensors and actuators are wired into | ||
* to a variable name. This provides flexibility changing wiring, makes checking | ||
* the wiring easier and significantly reduces the number of magic numbers | ||
* floating around. | ||
*/ | ||
public class RobotMap { | ||
// For example to map the left and right motors, you could define the | ||
// following variables to use with your drivetrain subsystem. | ||
// public static int leftMotor = 1; | ||
// public static int rightMotor = 2; | ||
|
||
// If you are using multiple modules, make sure to define both the port | ||
// number and the module. For example you with a rangefinder: | ||
// public static int rangefinderPort = 1; | ||
// public static int rangefinderModule = 1; | ||
} |
46 changes: 46 additions & 0 deletions
46
.metadata/.plugins/org.eclipse.core.resources/.history/11/50c5f7d2fecd0017164c956510ca2263
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package org.usfirst.frc.team4001.robot; | ||
import edu.wpi.first.wpilibj.Encoder; | ||
import edu.wpi.first.wpilibj.IterativeRobot; | ||
import edu.wpi.first.wpilibj.Joystick; | ||
import edu.wpi.first.wpilibj.Victor; | ||
import edu.wpi.first.wpilibj.livewindow.LiveWindow; | ||
public class Robot extends IterativeRobot { | ||
Victor LeftDrive = new Victor (3); | ||
Victor RightDrive = new Victor (1); | ||
Victor Shooter = new Victor (0); | ||
Joystick driverstick = new Joystick(0); | ||
Encoder shooterencoder = new Encoder(6, 7, false, Encoder.EncodingType.k4X); | ||
double LeftStickValue; | ||
double RightStickValue; | ||
int shootersetpoint = 2000;// the rpm rate of the shooter encoder | ||
@Override | ||
public void robotInit() { | ||
} | ||
@Override | ||
public void autonomousInit() { | ||
} | ||
@Override | ||
public void autonomousPeriodic() { | ||
} | ||
@Override | ||
public void teleopPeriodic() { | ||
//Drive train tank | ||
LeftStickValue = driverstick.getRawAxis(1); | ||
RightStickValue = driverstick.getRawAxis(5); | ||
LeftDrive.set(-LeftStickValue); | ||
RightDrive.set(RightStickValue); | ||
System.out.println("shooter rpm " + shooterencoder.getRate() + "set" +shootersetpoint); | ||
if((driverstick.getRawButton(4)) && shooterencoder.getRate() > shootersetpoint ) { | ||
Shooter.set(-0.2); | ||
}else if((driverstick.getRawButton(4)) && shooterencoder.getRate() < shootersetpoint ) { | ||
Shooter.set(-.8); | ||
}else{ | ||
Shooter.set(0.0);} | ||
|
||
} | ||
@Override | ||
public void testPeriodic() { | ||
LiveWindow.run(); | ||
} | ||
} | ||
|
44 changes: 44 additions & 0 deletions
44
.metadata/.plugins/org.eclipse.core.resources/.history/11/b0c344c8f9cd0017164c956510ca2263
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package org.usfirst.frc.team4001.robot; | ||
import edu.wpi.first.wpilibj.Encoder; | ||
import edu.wpi.first.wpilibj.IterativeRobot; | ||
import edu.wpi.first.wpilibj.Joystick; | ||
import edu.wpi.first.wpilibj.Victor; | ||
import edu.wpi.first.wpilibj.livewindow.LiveWindow; | ||
public class Robot extends IterativeRobot { | ||
Victor LeftDrive = new Victor (3); | ||
Victor RightDrive = new Victor (1); | ||
Victor Shooter = new Victor (0); | ||
Joystick driverstick = new Joystick(0); | ||
Encoder shooterencoder = new Encoder(6, 7, false, Encoder.EncodingType.k4X); | ||
double LeftStickValue; | ||
double RightStickValue; | ||
int shootersetpoint = 2000;// the rpm rate of the shooter encoder | ||
@Override | ||
public void robotInit() { | ||
} | ||
@Override | ||
public void autonomousInit() { | ||
} | ||
@Override | ||
public void autonomousPeriodic() { | ||
} | ||
@Override | ||
public void teleopPeriodic() { | ||
//Drive train tank | ||
LeftStickValue = driverstick.getRawAxis(1); | ||
RightStickValue = driverstick.getRawAxis(5); | ||
LeftDrive.set(-LeftStickValue); | ||
RightDrive.set(RightStickValue); | ||
System.out.println("shooter rpm " + shooterencoder.getRate()); | ||
if((driverstick.getRawButton(4)) && shooterencoder.getRate() < shootersetpoint ) { | ||
Shooter.set(0.8); | ||
}else{ | ||
Shooter.set(0.0);} | ||
|
||
} | ||
@Override | ||
public void testPeriodic() { | ||
LiveWindow.run(); | ||
} | ||
} | ||
|
46 changes: 46 additions & 0 deletions
46
.metadata/.plugins/org.eclipse.core.resources/.history/13/7095bc62d6c00017124dae9ef4d4492c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package org.usfirst.frc.team4001.robot; | ||
|
||
import edu.wpi.first.wpilibj.AnalogGyro; | ||
import edu.wpi.first.wpilibj.IterativeRobot; | ||
import edu.wpi.first.wpilibj.Joystick; | ||
import edu.wpi.first.wpilibj.RobotDrive; | ||
|
||
/** | ||
* This is a sample program to demonstrate how to use a gyro sensor to make a | ||
* robot drive straight. This program uses a joystick to drive forwards and | ||
* backwards while the gyro is used for direction keeping. | ||
*/ | ||
public class Robot extends IterativeRobot { | ||
private static final double kAngleSetpoint = 0.0; | ||
private static final double kP = 0.005; // propotional turning constant | ||
|
||
// gyro calibration constant, may need to be adjusted; | ||
// gyro value of 360 is set to correspond to one full revolution | ||
private static final double kVoltsPerDegreePerSecond = 0.0128; | ||
|
||
private static final int kLeftMotorPort = 0; | ||
private static final int kRightMotorPort = 1; | ||
private static final int kGyroPort = 0; | ||
private static final int kJoystickPort = 0; | ||
|
||
private RobotDrive myRobot = new RobotDrive(kLeftMotorPort, kRightMotorPort); | ||
private AnalogGyro gyro = new AnalogGyro(kGyroPort); | ||
private Joystick joystick = new Joystick(kJoystickPort); | ||
|
||
@Override | ||
public void robotInit() { | ||
gyro.setSensitivity(kVoltsPerDegreePerSecond); | ||
} | ||
|
||
/** | ||
* The motor speed is set from the joystick while the RobotDrive turning | ||
* value is assigned from the error between the setpoint and the gyro angle. | ||
*/ | ||
@Override | ||
public void teleopPeriodic() { | ||
double turningValue = (kAngleSetpoint - gyro.getAngle()) * kP; | ||
// Invert the direction of the turn if we are going backwards | ||
turningValue = Math.copySign(turningValue, joystick.getY()); | ||
myRobot.drive(joystick.getY(), turningValue); | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
.metadata/.plugins/org.eclipse.core.resources/.history/14/a06854a5facd0017164c956510ca2263
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package org.usfirst.frc.team4001.robot; | ||
import edu.wpi.first.wpilibj.Encoder; | ||
import edu.wpi.first.wpilibj.IterativeRobot; | ||
import edu.wpi.first.wpilibj.Joystick; | ||
import edu.wpi.first.wpilibj.Victor; | ||
import edu.wpi.first.wpilibj.livewindow.LiveWindow; | ||
public class Robot extends IterativeRobot { | ||
Victor LeftDrive = new Victor (3); | ||
Victor RightDrive = new Victor (1); | ||
Victor Shooter = new Victor (0); | ||
Joystick driverstick = new Joystick(0); | ||
Encoder shooterencoder = new Encoder(6, 7, false, Encoder.EncodingType.k4X); | ||
double LeftStickValue; | ||
double RightStickValue; | ||
int shootersetpoint = 200;// the rpm rate of the shooter encoder | ||
@Override | ||
public void robotInit() { | ||
} | ||
@Override | ||
public void autonomousInit() { | ||
} | ||
@Override | ||
public void autonomousPeriodic() { | ||
} | ||
@Override | ||
public void teleopPeriodic() { | ||
//Drive train tank | ||
LeftStickValue = driverstick.getRawAxis(1); | ||
RightStickValue = driverstick.getRawAxis(5); | ||
LeftDrive.set(-LeftStickValue); | ||
RightDrive.set(RightStickValue); | ||
System.out.println("shooter rpm " + shooterencoder.getRate()); | ||
if((driverstick.getRawButton(4)) && shooterencoder.getRate() < shootersetpoint ) { | ||
Shooter.set(0.8); | ||
}else if((driverstick.getRawButton(4)) && shooterencoder.getRate() > shootersetpoint ) { | ||
Shooter.set(0.0); | ||
}else{ | ||
Shooter.set(0.0);} | ||
|
||
} | ||
@Override | ||
public void testPeriodic() { | ||
LiveWindow.run(); | ||
} | ||
} | ||
|
47 changes: 47 additions & 0 deletions
47
.metadata/.plugins/org.eclipse.core.resources/.history/17/504cc7eaf9cd0017164c956510ca2263
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package org.usfirst.frc.team4001.robot; | ||
import edu.wpi.first.wpilibj.Encoder; | ||
import edu.wpi.first.wpilibj.IterativeRobot; | ||
import edu.wpi.first.wpilibj.Joystick; | ||
import edu.wpi.first.wpilibj.Victor; | ||
import edu.wpi.first.wpilibj.livewindow.LiveWindow; | ||
public class Robot extends IterativeRobot { | ||
Victor LeftDrive = new Victor (3); | ||
Victor RightDrive = new Victor (1); | ||
Victor Shooter = new Victor (0); | ||
Joystick driverstick = new Joystick(0); | ||
Encoder shooterencoder = new Encoder(6, 7, false, Encoder.EncodingType.k4X); | ||
double LeftStickValue; | ||
double RightStickValue; | ||
int shootersetpoint = 2000;// the rpm rate of the shooter encoder | ||
@Override | ||
public void robotInit() { | ||
} | ||
@Override | ||
public void autonomousInit() { | ||
} | ||
@Override | ||
public void autonomousPeriodic() { | ||
} | ||
@Override | ||
public void teleopPeriodic() { | ||
//Drive train tank | ||
LeftStickValue = driverstick.getRawAxis(1); | ||
RightStickValue = driverstick.getRawAxis(5); | ||
LeftDrive.set(-LeftStickValue); | ||
RightDrive.set(RightStickValue); | ||
System.out.println("shooter rpm " + shooterencoder.getRate()); | ||
if((driverstick.getRawButton(4)) && shooterencoder.getRate() < shootersetpoint ) { | ||
Shooter.set(0.8); | ||
}else if((driverstick.getRawButton(4)) && shooterencoder.getRate() > shootersetpoint ) { | ||
Shooter.set(0.0); | ||
|
||
}else{ | ||
Shooter.set(0.0);} | ||
|
||
} | ||
@Override | ||
public void testPeriodic() { | ||
LiveWindow.run(); | ||
} | ||
} | ||
|
47 changes: 47 additions & 0 deletions
47
.metadata/.plugins/org.eclipse.core.resources/.history/1c/2057d384fbc300171b359d9f47b7ed02
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package org.usfirst.frc.team4001.robot; | ||
import edu.wpi.first.wpilibj.DigitalInput; | ||
import edu.wpi.first.wpilibj.IterativeRobot; | ||
import edu.wpi.first.wpilibj.Joystick; | ||
import edu.wpi.first.wpilibj.Victor; | ||
import edu.wpi.first.wpilibj.livewindow.LiveWindow; | ||
import edu.wpi.first.wpilibj.smartdashboard.SendableChooser; | ||
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; | ||
public class Robot extends IterativeRobot { | ||
Victor LeftDrive = new Victor (0); | ||
Victor RightDrive = new Victor (1); | ||
Victor Armmotor = new Victor (2); | ||
Joystick driverstick = new Joystick(0); | ||
double LeftStickValue; | ||
double RightStickValue; | ||
DigitalInput LimitSwitch1 = new DigitalInput(9); | ||
@Override | ||
public void robotInit() { | ||
} | ||
@Override | ||
public void autonomousInit() { | ||
} | ||
@Override | ||
public void autonomousPeriodic() { | ||
} | ||
@Override | ||
public void teleopPeriodic() { | ||
//Drive train tank | ||
LeftStickValue = driverstick.getRawAxis(0); | ||
RightStickValue = driverstick.getRawAxis(1); | ||
LeftDrive.set(-LeftStickValue); | ||
RightDrive.set(RightStickValue); | ||
// Arm motor with limit switch | ||
if(LimitSwitch1.get()) | ||
{ Armmotor.set(0.8); } | ||
else if (driverstick.getRawButton(1)) | ||
{ Armmotor.set(0.8); } | ||
else if (driverstick.getRawButton(2)) | ||
{ Armmotor.set(-0.8); } | ||
else { Armmotor.set(0);} | ||
} | ||
@Override | ||
public void testPeriodic() { | ||
LiveWindow.run(); | ||
} | ||
} | ||
|
46 changes: 46 additions & 0 deletions
46
.metadata/.plugins/org.eclipse.core.resources/.history/1e/f004b732fbcd0017164c956510ca2263
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package org.usfirst.frc.team4001.robot; | ||
import edu.wpi.first.wpilibj.Encoder; | ||
import edu.wpi.first.wpilibj.IterativeRobot; | ||
import edu.wpi.first.wpilibj.Joystick; | ||
import edu.wpi.first.wpilibj.Victor; | ||
import edu.wpi.first.wpilibj.livewindow.LiveWindow; | ||
public class Robot extends IterativeRobot { | ||
Victor LeftDrive = new Victor (3); | ||
Victor RightDrive = new Victor (1); | ||
Victor Shooter = new Victor (0); | ||
Joystick driverstick = new Joystick(0); | ||
Encoder shooterencoder = new Encoder(6, 7, false, Encoder.EncodingType.k4X); | ||
double LeftStickValue; | ||
double RightStickValue; | ||
int shootersetpoint = 200;// the rpm rate of the shooter encoder | ||
@Override | ||
public void robotInit() { | ||
} | ||
@Override | ||
public void autonomousInit() { | ||
} | ||
@Override | ||
public void autonomousPeriodic() { | ||
} | ||
@Override | ||
public void teleopPeriodic() { | ||
//Drive train tank | ||
LeftStickValue = driverstick.getRawAxis(1); | ||
RightStickValue = driverstick.getRawAxis(5); | ||
LeftDrive.set(-LeftStickValue); | ||
RightDrive.set(RightStickValue); | ||
System.out.println("shooter rpm " + shooterencoder.getRate()); | ||
if((driverstick.getRawButton(4)) && shooterencoder.getRate() > shootersetpoint ) { | ||
Shooter.set(0.0); | ||
}else if((driverstick.getRawButton(4)) && shooterencoder.getRate() < shootersetpoint ) { | ||
Shooter.set(.2); | ||
}else{ | ||
Shooter.set(0.0);} | ||
|
||
} | ||
@Override | ||
public void testPeriodic() { | ||
LiveWindow.run(); | ||
} | ||
} | ||
|
39 changes: 39 additions & 0 deletions
39
.metadata/.plugins/org.eclipse.core.resources/.history/1f/d048406099b90017130a960132fc8ae9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package org.usfirst.frc.team4001.robot; | ||
|
||
import edu.wpi.first.wpilibj.buttons.Button; | ||
|
||
import org.usfirst.frc.team4001.robot.commands.ExampleCommand; | ||
|
||
/** | ||
* This class is the glue that binds the controls on the physical operator | ||
* interface to the commands and command groups that allow control of the robot. | ||
*/ | ||
public class OI { | ||
//// CREATING BUTTONS | ||
// One type of button is a joystick button which is any button on a | ||
//// joystick. | ||
// You create one by telling it which joystick it's on and which button | ||
// number it is. | ||
// Joystick stick = new Joystick(port); | ||
// Button button = new JoystickButton(stick, buttonNumber); | ||
|
||
// There are a few additional built in buttons you can use. Additionally, | ||
// by subclassing Button you can create custom triggers and bind those to | ||
// commands the same as any other Button. | ||
|
||
//// TRIGGERING COMMANDS WITH BUTTONS | ||
// Once you have a button, it's trivial to bind it to a button in one of | ||
// three ways: | ||
|
||
// Start the command when the button is pressed and let it run the command | ||
// until it is finished as determined by it's isFinished method. | ||
// button.whenPressed(new ExampleCommand()); | ||
|
||
// Run the command while the button is being held down and interrupt it once | ||
// the button is released. | ||
// button.whileHeld(new ExampleCommand()); | ||
|
||
// Start the command when the button is released and let it run the command | ||
// until it is finished as determined by it's isFinished method. | ||
// button.whenReleased(new ExampleCommand()); | ||
} |
Oops, something went wrong.