commented out throws in getP,getI,getD,getIzone, getRampRate.

Getting/setting these should be available all the time.

Change-Id: I8ecc6dc8847c946c63c83081a338c1bd70a656b5
This commit is contained in:
Omar Zrien
2014-12-05 18:04:39 -05:00
committed by James Kuszmaul
parent 4833316571
commit 4d142cdafa

View File

@@ -350,9 +350,9 @@ public class CANTalon implements MotorSafety, PIDOutput, SpeedController {
* @throws IllegalStateException if not in Position of Speed mode.
*/
public double getP() {
if(!(m_controlMode.equals(ControlMode.Position) || m_controlMode.equals(ControlMode.Speed))) {
throw new IllegalStateException("PID mode only applies in Position and Speed modes.");
}
//if(!(m_controlMode.equals(ControlMode.Position) || m_controlMode.equals(ControlMode.Speed))) {
// throw new IllegalStateException("PID mode only applies in Position and Speed modes.");
//}
// Update the information that we have.
if (m_profile == 0)
@@ -369,9 +369,9 @@ public class CANTalon implements MotorSafety, PIDOutput, SpeedController {
}
public double getI() {
if(!(m_controlMode.equals(ControlMode.Position) || m_controlMode.equals(ControlMode.Speed))) {
throw new IllegalStateException("PID mode only applies in Position and Speed modes.");
}
//if(!(m_controlMode.equals(ControlMode.Position) || m_controlMode.equals(ControlMode.Speed))) {
// throw new IllegalStateException("PID mode only applies in Position and Speed modes.");
//}
// Update the information that we have.
if (m_profile == 0)
@@ -388,9 +388,9 @@ public class CANTalon implements MotorSafety, PIDOutput, SpeedController {
}
public double getD() {
if(!(m_controlMode.equals(ControlMode.Position) || m_controlMode.equals(ControlMode.Speed))) {
throw new IllegalStateException("PID mode only applies in Position and Speed modes.");
}
//if(!(m_controlMode.equals(ControlMode.Position) || m_controlMode.equals(ControlMode.Speed))) {
// throw new IllegalStateException("PID mode only applies in Position and Speed modes.");
//}
// Update the information that we have.
if (m_profile == 0)
@@ -407,9 +407,9 @@ public class CANTalon implements MotorSafety, PIDOutput, SpeedController {
}
public double getF() {
if(!(m_controlMode.equals(ControlMode.Position) || m_controlMode.equals(ControlMode.Speed))) {
throw new IllegalStateException("PID mode only applies in Position and Speed modes.");
}
//if(!(m_controlMode.equals(ControlMode.Position) || m_controlMode.equals(ControlMode.Speed))) {
// throw new IllegalStateException("PID mode only applies in Position and Speed modes.");
//}
// Update the information that we have.
if (m_profile == 0)
@@ -426,9 +426,9 @@ public class CANTalon implements MotorSafety, PIDOutput, SpeedController {
}
public double getIZone() {
if(!(m_controlMode.equals(ControlMode.Position) || m_controlMode.equals(ControlMode.Speed))) {
throw new IllegalStateException("PID mode only applies in Position and Speed modes.");
}
//if(!(m_controlMode.equals(ControlMode.Position) || m_controlMode.equals(ControlMode.Speed))) {
// throw new IllegalStateException("PID mode only applies in Position and Speed modes.");
//}
// Update the information that we have.
if (m_profile == 0)
@@ -445,9 +445,9 @@ public class CANTalon implements MotorSafety, PIDOutput, SpeedController {
}
public double getRampRate() {
if(!(m_controlMode.equals(ControlMode.Position) || m_controlMode.equals(ControlMode.Speed))) {
throw new IllegalStateException("PID mode only applies in Position and Speed modes.");
}
// if(!(m_controlMode.equals(ControlMode.Position) || m_controlMode.equals(ControlMode.Speed))) {
// throw new IllegalStateException("PID mode only applies in Position and Speed modes.");
// }
// Update the information that we have.
if (m_profile == 0)