-
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.
Merge pull request #12 from Robocubs/develop
Release Version 2 (Codename "Milford")
- Loading branch information
Showing
38 changed files
with
327 additions
and
734 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
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
34 changes: 0 additions & 34 deletions
34
src/main/java/org/usfirst/frc/team1701/robot/commands/Auto/CrossPlatformZone.java
This file was deleted.
Oops, something went wrong.
23 changes: 17 additions & 6 deletions
23
src/main/java/org/usfirst/frc/team1701/robot/commands/Auto/Drive.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 |
---|---|---|
@@ -1,45 +1,56 @@ | ||
package org.usfirst.frc.team1701.robot.commands.Auto; | ||
|
||
import edu.wpi.first.wpilibj.command.Command; | ||
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; | ||
import org.usfirst.frc.team1701.robot.Robot; | ||
|
||
public class Drive extends Command { | ||
boolean isFinished = false; | ||
double distance = 0; | ||
double currentSpeed; | ||
double startAngle; | ||
boolean setHighGear = false; | ||
|
||
public Drive(double distance,double speed) { | ||
Robot.driveTrain.driveSpeed = 0; | ||
|
||
requires(Robot.driveTrain); | ||
this.distance = distance; | ||
this.currentSpeed = speed; | ||
} | ||
public Drive(double distance, double speed, boolean setHighGear) { | ||
this.distance = distance; | ||
this.currentSpeed = speed; | ||
this(distance,speed); | ||
this.setHighGear = setHighGear; | ||
|
||
} | ||
protected void initialize() { | ||
startAngle = Robot.driveTrain.getNavxAngle(); | ||
Robot.driveTrain.resetEncoders(); | ||
} | ||
protected void execute() { | ||
|
||
if(setHighGear) { | ||
if(!setHighGear) { | ||
Robot.driveTrain.setLowGear(); | ||
} else { | ||
Robot.driveTrain.setHighGear(); | ||
} | ||
|
||
SmartDashboard.putNumber("Drive Train", Robot.driveTrain.getRightDistance()); | ||
|
||
if(Robot.driveTrain.getRightDistance() < distance) { | ||
Robot.driveTrain.teleopControl(-currentSpeed,0); | ||
Robot.driveTrain.driveSpeed = -currentSpeed; | ||
Robot.driveTrain.setAngle(startAngle); | ||
Robot.driveTrain.startPID(); | ||
} else { | ||
Robot.driveTrain.stopPID(); | ||
Robot.driveTrain.stopMotors(); | ||
isFinished = true; | ||
} | ||
} | ||
protected boolean isFinished() { | ||
return isFinished; | ||
} | ||
protected void end() {} | ||
protected void end() { | ||
Robot.driveTrain.stopPID(); | ||
} | ||
protected void interrupted() {} | ||
} |
44 changes: 0 additions & 44 deletions
44
src/main/java/org/usfirst/frc/team1701/robot/commands/Auto/DriveForwardCommand.java
This file was deleted.
Oops, something went wrong.
39 changes: 0 additions & 39 deletions
39
src/main/java/org/usfirst/frc/team1701/robot/commands/Auto/MiddleToSwitchTurn.java
This file was deleted.
Oops, something went wrong.
34 changes: 0 additions & 34 deletions
34
src/main/java/org/usfirst/frc/team1701/robot/commands/Auto/PlatformToScale.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
1e2138f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OCD crisis averted:
develop
andmaster
branches are now equal.Ah, tranquility.