projects
/
3501
/
2017steamworks
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
9b35aa5
)
fix bugs
author
Cindy Zhang
<cindyzyx9@gmail.com>
Fri, 27 Jan 2017 03:36:14 +0000
(19:36 -0800)
committer
Arunima DIvya
<adivya822@student.fuhsd.org>
Fri, 3 Feb 2017 03:21:03 +0000
(19:21 -0800)
src/org/usfirst/frc/team3501/robot/Robot.java
patch
|
blob
|
blame
|
history
src/org/usfirst/frc/team3501/robot/commands/driving/DriveDistance.java
patch
|
blob
|
blame
|
history
src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java
patch
|
blob
|
blame
|
history
diff --git
a/src/org/usfirst/frc/team3501/robot/Robot.java
b/src/org/usfirst/frc/team3501/robot/Robot.java
index 5f4715cb6ac2e9b1fcb8a7e1bef891cc95163eae..908a52dcf0339b44735147d174f069500b873280 100644
(file)
--- a/
src/org/usfirst/frc/team3501/robot/Robot.java
+++ b/
src/org/usfirst/frc/team3501/robot/Robot.java
@@
-1,5
+1,9
@@
package org.usfirst.frc.team3501.robot;
package org.usfirst.frc.team3501.robot;
+<<<<<<< HEAD
+=======
+import org.usfirst.frc.team3501.robot.commands.driving.DriveDistance;
+>>>>>>> fix bugs
import org.usfirst.frc.team3501.robot.subsystems.DriveTrain;
import org.usfirst.frc.team3501.robot.subsystems.Intake;
import org.usfirst.frc.team3501.robot.subsystems.Shooter;
import org.usfirst.frc.team3501.robot.subsystems.DriveTrain;
import org.usfirst.frc.team3501.robot.subsystems.Intake;
import org.usfirst.frc.team3501.robot.subsystems.Shooter;
@@
-39,6
+43,10
@@
public class Robot extends IterativeRobot {
@Override
public void autonomousInit() {
@Override
public void autonomousInit() {
+<<<<<<< HEAD
+=======
+ Scheduler.getInstance().add(new DriveDistance(25, 10));
+>>>>>>> fix bugs
}
@Override
}
@Override
diff --git
a/src/org/usfirst/frc/team3501/robot/commands/driving/DriveDistance.java
b/src/org/usfirst/frc/team3501/robot/commands/driving/DriveDistance.java
index 76bc52fef569641a5b3c7a2d1c8d9cc592602505..2b77348e781bf917e5755b9464b9b2bb168edee7 100755
(executable)
--- a/
src/org/usfirst/frc/team3501/robot/commands/driving/DriveDistance.java
+++ b/
src/org/usfirst/frc/team3501/robot/commands/driving/DriveDistance.java
@@
-1,6
+1,5
@@
package org.usfirst.frc.team3501.robot.commands.driving;
package org.usfirst.frc.team3501.robot.commands.driving;
-import org.usfirst.frc.team3501.robot.MathLib;
import org.usfirst.frc.team3501.robot.Robot;
import org.usfirst.frc.team3501.robot.subsystems.DriveTrain;
import org.usfirst.frc.team3501.robot.utils.PIDController;
import org.usfirst.frc.team3501.robot.Robot;
import org.usfirst.frc.team3501.robot.subsystems.DriveTrain;
import org.usfirst.frc.team3501.robot.utils.PIDController;
@@
-47,6
+46,9
@@
public class DriveDistance extends Command {
public DriveDistance(double distance, double motorVal) {
requires(driveTrain);
public DriveDistance(double distance, double motorVal) {
requires(driveTrain);
+ this.maxTimeOut = maxTimeOut;
+ this.target = distance;
+
this.driveP = driveTrain.driveP;
this.driveI = driveTrain.driveI;
this.driveD = driveTrain.driveD;
this.driveP = driveTrain.driveP;
this.driveI = driveTrain.driveI;
this.driveD = driveTrain.driveD;
@@
-89,12
+91,12
@@
public class DriveDistance extends Command {
driveTrain.printEncoderOutput();
// System.out.println("turn: " + xVal);
driveTrain.printEncoderOutput();
// System.out.println("turn: " + xVal);
- double leftDrive =
MathLib.calcLeftTankDrive(-xVal, yVal)
;
- double rightDrive =
MathLib.calcRightTankDrive(xVal, -yVal)
;
+ double leftDrive =
yVal - xVal
;
+ double rightDrive =
yVal + xVal
;
this.driveTrain.setMotorValues(leftDrive, rightDrive);
this.driveTrain.setMotorValues(leftDrive, rightDrive);
-
System.out.println(driveTrain.getAvgEncoderDistance()
);
+
driveTrain.printEncoderOutput(
);
// System.out.println("motorval: " + yVal);
}
// System.out.println("motorval: " + yVal);
}
diff --git
a/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java
b/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java
index fd6530e5404d26a08985c7abe5df66f555e69af6..f69167241f16cd85bff6fd3d3f48788a1df90014 100644
(file)
--- a/
src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java
+++ b/
src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java
@@
-10,6
+10,7
@@
import edu.wpi.first.wpilibj.ADXRS450_Gyro;
import edu.wpi.first.wpilibj.DoubleSolenoid;
import edu.wpi.first.wpilibj.DoubleSolenoid.Value;
import edu.wpi.first.wpilibj.Encoder;
import edu.wpi.first.wpilibj.DoubleSolenoid;
import edu.wpi.first.wpilibj.DoubleSolenoid.Value;
import edu.wpi.first.wpilibj.Encoder;
+import edu.wpi.first.wpilibj.I2C.Port;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.command.Subsystem;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.command.Subsystem;
@@
-62,6
+63,10
@@
public class DriveTrain extends Subsystem {
Constants.DriveTrain.LEFT_FORWARD, Constants.DriveTrain.LEFT_REVERSE);
rightGearPiston = new DoubleSolenoid(Constants.DriveTrain.MODULE_NUMBER,
Constants.DriveTrain.RIGHT_FORWARD, Constants.DriveTrain.RIGHT_REVERSE);
Constants.DriveTrain.LEFT_FORWARD, Constants.DriveTrain.LEFT_REVERSE);
rightGearPiston = new DoubleSolenoid(Constants.DriveTrain.MODULE_NUMBER,
Constants.DriveTrain.RIGHT_FORWARD, Constants.DriveTrain.RIGHT_REVERSE);
+
+ this.imu = BNO055.getInstance(BNO055.opmode_t.OPERATION_MODE_IMUPLUS,
+ BNO055.vector_type_t.VECTOR_EULER, Port.kOnboard, (byte) 0x28);
+ gyroZero = imu.getHeading();
}
public static DriveTrain getDriveTrain() {
}
public static DriveTrain getDriveTrain() {
@@
-110,6
+115,8
@@
public class DriveTrain extends Subsystem {
// System.out.println("left: " + getLeftEncoderDistance());
// System.out.println("right: " + getRightEncoderDistance());
System.out.println(getAvgEncoderDistance());
// System.out.println("left: " + getLeftEncoderDistance());
// System.out.println("right: " + getRightEncoderDistance());
System.out.println(getAvgEncoderDistance());
+ System.out.println("left: " + getLeftEncoderDistance());
+ System.out.println("right: " + getRightEncoderDistance());
}
public double getAvgEncoderDistance() {
}
public double getAvgEncoderDistance() {