This repository has been archived by the owner on Sep 11, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
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
126 changed files
with
3,852 additions
and
745 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
3494_2017_repo/src/org/usfirst/frc/team3494/robot/AutoGenerator.java
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.team3494.robot; | ||
|
||
import java.util.ArrayList; | ||
|
||
import org.usfirst.frc.team3494.robot.commands.auto.DistanceDrive; | ||
import org.usfirst.frc.team3494.robot.commands.auto.XYDrive; | ||
|
||
import edu.wpi.first.wpilibj.command.Command; | ||
|
||
/** | ||
* Class containing methods that return valid lists to pass to | ||
* {@link org.usfirst.frc.team3494.robot.commands.auto.ConstructedAuto}. | ||
* | ||
* @since 0.0.3 | ||
* @see org.usfirst.frc.team3494.robot.commands.auto.ConstructedAuto | ||
*/ | ||
public class AutoGenerator { | ||
/** | ||
* Test method. Drives to XY (36, 36) (inches). | ||
* | ||
* @since 0.0.3 | ||
* @see org.usfirst.frc.team3494.robot.commands.auto.ConstructedAuto | ||
* @see org.usfirst.frc.team3494.robot.commands.auto.XYDrive | ||
* @return A list of commands suitable for use with | ||
* {@link org.usfirst.frc.team3494.robot.commands.auto.ConstructedAuto}. | ||
*/ | ||
public static ArrayList<Command> autoOne() { | ||
ArrayList<Command> list = new ArrayList<Command>(); | ||
list.add(new XYDrive(36, 36)); | ||
return list; | ||
} | ||
|
||
/** | ||
* Drives to the baseline and earns us five points (hopefully.) | ||
* | ||
* @see org.usfirst.frc.team3494.robot.commands.auto.DistanceDrive | ||
* @since 0.0.3 | ||
* @return A list of commands suitable for use with | ||
* {@link org.usfirst.frc.team3494.robot.commands.auto.ConstructedAuto}. | ||
*/ | ||
public static ArrayList<Command> crossBaseLine() { | ||
ArrayList<Command> list = new ArrayList<Command>(); | ||
list.add(new DistanceDrive(93.25, UnitTypes.INCHES)); | ||
return list; | ||
} | ||
} |
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
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
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
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
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
68 changes: 0 additions & 68 deletions
68
3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/CartesianTurnDrive.java
This file was deleted.
Oops, something went wrong.
26 changes: 26 additions & 0 deletions
26
3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/ConstructedAuto.java
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,26 @@ | ||
package org.usfirst.frc.team3494.robot.commands.auto; | ||
|
||
import java.util.ArrayList; | ||
|
||
import edu.wpi.first.wpilibj.command.Command; | ||
import edu.wpi.first.wpilibj.command.CommandGroup; | ||
|
||
/** | ||
* Creates an auto program from a passed-in list of commands. | ||
* | ||
* @since 0.0.3 | ||
*/ | ||
public class ConstructedAuto extends CommandGroup { | ||
/** | ||
* Constructor. | ||
* | ||
* @param commands | ||
* The list of commands to make an auto sequence from, <b>in | ||
* order.</b> | ||
*/ | ||
public ConstructedAuto(ArrayList<Command> commands) { | ||
for (Command c : commands) { | ||
this.addSequential(c); | ||
} | ||
} | ||
} |
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
35 changes: 35 additions & 0 deletions
35
3494_2017_repo/src/org/usfirst/frc/team3494/robot/commands/auto/XYDrive.java
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,35 @@ | ||
package org.usfirst.frc.team3494.robot.commands.auto; | ||
|
||
import org.usfirst.frc.team3494.robot.UnitTypes; | ||
|
||
import edu.wpi.first.wpilibj.command.CommandGroup; | ||
|
||
/** | ||
* Drives to a point relative to the robot. | ||
* | ||
* @since 0.0.3 | ||
*/ | ||
public class XYDrive extends CommandGroup { | ||
|
||
private double hypot; | ||
private double angle; | ||
|
||
/** | ||
* Constructor. | ||
* | ||
* @param rise | ||
* The distance along the Y axis that the point is from the | ||
* robot. | ||
* @param run | ||
* The distance along the X axis that the point is from the | ||
* robot. | ||
*/ | ||
public XYDrive(double rise, double run) { | ||
double run2 = run * run; | ||
double rise2 = rise * rise; | ||
this.hypot = Math.sqrt(run2 + rise2); | ||
this.angle = Math.toDegrees(Math.atan2(rise, run)); | ||
addSequential(new AngleTurn(angle)); | ||
addSequential(new DistanceDrive(hypot, UnitTypes.INCHES)); | ||
} | ||
} |
Oops, something went wrong.