Skip to content
This repository has been archived by the owner on Feb 24, 2021. It is now read-only.

Commit

Permalink
Add drive commands to Forward.java
Browse files Browse the repository at this point in the history
  • Loading branch information
hcshires committed Oct 4, 2019
1 parent 3d64cb5 commit 47528ab
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
2 changes: 2 additions & 0 deletions src/main/java/frc/robot/RobotMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ public class RobotMap {

public static final int joy1 = 0,
joy2 = 1;

public static final int GYRO_PORT = 0;
}
18 changes: 10 additions & 8 deletions src/main/java/frc/robot/commands/Forward.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,38 @@

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

import com.analog.adis16448.frc.ADIS16448_IMU;
/**
* Move Forward to Cargo Ship
*/
public class Forward extends Command{
private final Timer timer = new Timer();
private final ADIS16448_IMU imu = new ADIS16448_IMU();
private AnalogGyro m_gyro = new AnalogGyro(RobotMap.GYRO_PORT);

@Override
protected void initialize() {
Robot.drivetrain.drive(0, 0); // Don't move on init
}

// Called repeatedly when this Command is scheduled to run
@Override
protected void execute() {
if(timer.get() < 2.0){
Robot.drivetrain.drive(0.5, 0.5);
}

protected void execute() {
Robot.drivetrain.drive(0.5, 0.5);
}

// Make this return true when this Command no longer needs to run execute()
@Override
protected boolean isFinished() {
return false;
return timer.get() > 2.0;
}

// Called once after isFinished returns true
@Override
protected void end() {
Robot.drivetrain.stop();
}

// Called when another command which requires one or more of the same
Expand Down
6 changes: 3 additions & 3 deletions vendordeps/ADIS16448.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"fileName": "ADIS16448.json",
"name": "ADIS16448-IMU",
"version": "2019-r1",
"version": "2019-r3",
"uuid": "38c21ab6-aa8b-44bc-b844-8086c77f09ec",
"mavenUrls": [
"http://maven.highcurrent.io/maven"
Expand All @@ -11,15 +11,15 @@
{
"groupId": "com.github.juchong",
"artifactId": "adis16448-java",
"version": "2019-r1"
"version": "2019-r3"
}
],
"jniDependencies": [],
"cppDependencies": [
{
"groupId": "com.github.juchong",
"artifactId": "adis16448-cpp",
"version": "2019-r1",
"version": "2019-r3",
"libName": "libadis16448imu",
"headerClassifier": "headers",
"sharedLibrary": false,
Expand Down

0 comments on commit 47528ab

Please sign in to comment.