projects
/
3501
/
stronghold-2016
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Explain what a setpoint is
[3501/stronghold-2016]
/
src
/
org
/
usfirst
/
frc
/
team3501
/
robot
/
subsystems
/
DriveTrain.java
diff --git
a/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java
b/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java
index c88d4c42f9e1c92d00e4b3a17480bc20ca7f6939..d212059b1c5b91770ae1a0ec6265f403f2672d00 100644
(file)
--- a/
src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java
+++ b/
src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java
@@
-15,6
+15,13
@@
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.command.PIDSubsystem;
public class DriveTrain extends PIDSubsystem {
import edu.wpi.first.wpilibj.command.PIDSubsystem;
public class DriveTrain extends PIDSubsystem {
+ /*
+ * A setpoint is the value we want the PID controller to attempt to adjust the
+ * system to
+ * In other words, If we want to drive the robot 4 meters, the setpoint would
+ * be 4 meters
+ */
+
// Encoder PID Proportional Constants P, I, and D
private static double EP = 0.013, EI = 0.000015, ED = -0.002;
// Encoder PID Proportional Constants P, I, and D
private static double EP = 0.013, EI = 0.000015, ED = -0.002;
@@
-192,10
+199,10
@@
public class DriveTrain extends PIDSubsystem {
/*
* Method is a required method that the PID Subsystem uses to return the
* calculated PID value to the driver
/*
* Method is a required method that the PID Subsystem uses to return the
* calculated PID value to the driver
- *
+ *
* @param Gives the user the output from the PID algorithm that is calculated
* internally
* @param Gives the user the output from the PID algorithm that is calculated
* internally
- *
+ *
* Body: Uses the output, does some filtering and drives the robot
*/
@Override
* Body: Uses the output, does some filtering and drives the robot
*/
@Override
@@
-224,7
+231,7
@@
public class DriveTrain extends PIDSubsystem {
/*
* Checks the drive mode
/*
* Checks the drive mode
- *
+ *
* @return the current state of the robot in each state
* Average distance from both sides of tank drive for Encoder Mode
* Angle from the gyro in GYRO_MODE
* @return the current state of the robot in each state
* Average distance from both sides of tank drive for Encoder Mode
* Angle from the gyro in GYRO_MODE
@@
-258,9
+265,9
@@
public class DriveTrain extends PIDSubsystem {
/*
* constrains the distance to within -100 and 100 since we aren't going to
* drive more than 100 inches
/*
* constrains the distance to within -100 and 100 since we aren't going to
* drive more than 100 inches
- *
+ *
* Configure Encoder PID
* Configure Encoder PID
- *
+ *
* Sets the setpoint to the PID subsystem
*/
public void driveDistance(double dist, double maxTimeOut) {
* Sets the setpoint to the PID subsystem
*/
public void driveDistance(double dist, double maxTimeOut) {
@@
-301,10
+308,10
@@
public class DriveTrain extends PIDSubsystem {
/*
* Turning method that should be used repeatedly in a command
/*
* Turning method that should be used repeatedly in a command
- *
+ *
* First constrains the angle to within -360 and 360 since that is as much as
* we need to turn
* First constrains the angle to within -360 and 360 since that is as much as
* we need to turn
- *
+ *
* Configures Gyro PID and sets the setpoint as an angle
*/
public void turnAngle(double angle) {
* Configures Gyro PID and sets the setpoint as an angle
*/
public void turnAngle(double angle) {