mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
CANTalon: Add getter methods for soft limits.
Added functions: - getForwardSoftLimit - getReverseSoftLimit - isForwardSoftLimitEnabled - isReverseSoftLimitEnabled Change-Id: I03b8f692c08c326a6ff0bfd929b7fdd5d7406a0f
This commit is contained in:
committed by
James Kuszmaul
parent
880eae1424
commit
47088c0354
@@ -812,18 +812,42 @@ public class CANTalon implements MotorSafety, PIDOutput, SpeedController {
|
||||
m_impl.SetForwardSoftLimit(forwardLimit);
|
||||
}
|
||||
|
||||
public int getForwardSoftLimit() {
|
||||
long valuep = CanTalonJNI.new_intp();
|
||||
m_impl.GetForwardSoftLimit(new SWIGTYPE_p_int(valuep, true));
|
||||
return CanTalonJNI.intp_value(valuep);
|
||||
}
|
||||
|
||||
public void enableForwardSoftLimit(boolean enable) {
|
||||
m_impl.SetForwardSoftEnable(enable ? 1 : 0);
|
||||
}
|
||||
|
||||
public boolean isForwardSoftLimitEnabled() {
|
||||
long valuep = CanTalonJNI.new_intp();
|
||||
m_impl.GetForwardSoftEnable(new SWIGTYPE_p_int(valuep, true));
|
||||
return (CanTalonJNI.intp_value(valuep)==0) ? false : true;
|
||||
}
|
||||
|
||||
public void setReverseSoftLimit(int reverseLimit) {
|
||||
m_impl.SetReverseSoftLimit(reverseLimit);
|
||||
}
|
||||
|
||||
public int getReverseSoftLimit() {
|
||||
long valuep = CanTalonJNI.new_intp();
|
||||
m_impl.GetReverseSoftLimit(new SWIGTYPE_p_int(valuep, true));
|
||||
return CanTalonJNI.intp_value(valuep);
|
||||
}
|
||||
|
||||
public void enableReverseSoftLimit(boolean enable) {
|
||||
m_impl.SetReverseSoftEnable(enable ? 1 : 0);
|
||||
}
|
||||
|
||||
public boolean isReverseSoftLimitEnabled() {
|
||||
long valuep = CanTalonJNI.new_intp();
|
||||
m_impl.GetReverseSoftEnable(new SWIGTYPE_p_int(valuep, true));
|
||||
return (CanTalonJNI.intp_value(valuep)==0) ? false : true;
|
||||
}
|
||||
|
||||
public void clearStickyFaults() {
|
||||
m_impl.ClearStickyFaults();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user