Format and style changes.

Rebuilt last SRX-related commit with latest checkout.

Change-Id: I9f10418580275dae5cd07d740d401d45ee44e276

C++: Added Magnetic Encoder sensor types
C++: API for changing status frame rates updated to use paramEnums.
C++: Added Setting nominal and peak outputs for closed loop modes.
C++: Added current-closed loop
C++: added vcomp mode
C++: Added unit scaling (rotations and rpm)
C++ Added allowableclosedlooperr
C++: Added auto zero position on index pin
C++: Added pulse width decoder API
C++: Added multiplicands in status frames, increasing the max reported pos and max rpm.
C++: Added SetClosedLoopOutputDirection() for reversing slave output and reversing single-direction closed loopoutput.
C++: Added generic ConfigSet and ConfigGet for future flexibility/features.
C++: Added IsSensorPresent
Java: Added Magnetic Encoder sensor types
Java: Added unit scaling (rotations and rpm)
Java: Added current-closed loop
Java: added vcomp mode
Java Added allowableclosedlooperr
Java: Added auto zero position on index pin
Java: Added pulse width decoder API
Java: setForwardSoftLimit and setReverseSoftLimit takes double instead of int so underneath we can support rotations instead of native units.
Java: Added generic SetParam and GetParam for future flexibility/features.
Java Added isSensorPresent

Change-Id: I800251510e411624dce5ee10272606c31764b8ab
This commit is contained in:
Omar Zrien
2015-10-11 14:49:39 -04:00
committed by Brad Miller (WPI)
parent a3b6535fe9
commit a0cc45a8f0
8 changed files with 1773 additions and 119 deletions

View File

@@ -91,9 +91,6 @@ private:
operator bool() const { return moved; }
} m_hasBeenMoved;
/** just in case user wants to modify periods of certain status frames.
* Default the vars to match the firmware default. */
uint32_t _statusRateMs[4];
//---------------------- Vars for opening a CAN stream if caller needs signals that require soliciting */
uint32_t _can_h; //!< Session handle for catching response params.
int32_t _can_stat; //!< Session handle status.
@@ -154,6 +151,7 @@ public:
static const int kStatusFrame_Feedback = 1;
static const int kStatusFrame_Encoder = 2;
static const int kStatusFrame_AnalogTempVbat = 3;
static const int kStatusFrame_PulseWidthMeas = 4;
/**
* Signal enumeration for generic signal access.
* Although every signal is enumerated, only use this for traffic that must be solicited.
@@ -225,6 +223,30 @@ public:
eSettingsChanged=90,
eQuadFilterEn=91,
ePidIaccum=93,
eStatus1FrameRate=94, // TALON_Status_1_General_10ms_t
eStatus2FrameRate=95, // TALON_Status_2_Feedback_20ms_t
eStatus3FrameRate=96, // TALON_Status_3_Enc_100ms_t
eStatus4FrameRate=97, // TALON_Status_4_AinTempVbat_100ms_t
eStatus6FrameRate=98, // TALON_Status_6_Eol_t
eStatus7FrameRate=99, // TALON_Status_7_Debug_200ms_t
eClearPositionOnIdx=100,
//reserved,
//reserved,
//reserved,
ePeakPosOutput=104,
eNominalPosOutput=105,
ePeakNegOutput=106,
eNominalNegOutput=107,
eQuadIdxPolarity=108,
eStatus8FrameRate=109, // TALON_Status_8_PulseWid_100ms_t
eAllowPosOverflow=110,
eProfileParamSlot0_AllowableClosedLoopErr=111,
eNumberPotTurns=112,
eNumberEncoderCPR=113,
ePwdPosition=114,
eAinPosition=115,
eProfileParamVcompRate=116,
eProfileParamSlot1_AllowableClosedLoopErr=117,
}param_t;
/*---------------------setters and getters that use the solicated param request/response-------------*//**
* Send a one shot frame to set an arbitrary signal.
@@ -253,6 +275,7 @@ public:
CTR_Code SetFgain(unsigned slotIdx,double gain);
CTR_Code SetIzone(unsigned slotIdx,int zone);
CTR_Code SetCloseLoopRampRate(unsigned slotIdx,int closeLoopRampRate);
CTR_Code SetVoltageCompensationRate(double voltagePerMs);
CTR_Code SetSensorPosition(int pos);
CTR_Code SetForwardSoftLimit(int forwardLimit);
CTR_Code SetReverseSoftLimit(int reverseLimit);
@@ -264,6 +287,7 @@ public:
CTR_Code GetFgain(unsigned slotIdx,double & gain);
CTR_Code GetIzone(unsigned slotIdx,int & zone);
CTR_Code GetCloseLoopRampRate(unsigned slotIdx,int & closeLoopRampRate);
CTR_Code GetVoltageCompensationRate(double & voltagePerMs);
CTR_Code GetForwardSoftLimit(int & forwardLimit);
CTR_Code GetReverseSoftLimit(int & reverseLimit);
CTR_Code GetForwardSoftEnable(int & enable);
@@ -325,6 +349,11 @@ public:
CTR_Code SetProfileSlotSelect(int param);
CTR_Code SetRampThrottle(int param);
CTR_Code SetRevFeedbackSensor(int param);
CTR_Code GetPulseWidthPosition(int &param);
CTR_Code GetPulseWidthVelocity(int &param);
CTR_Code GetPulseWidthRiseToFallUs(int &param);
CTR_Code GetPulseWidthRiseToRiseUs(int &param);
CTR_Code IsPulseWidthSensorPresent(int &param);
};
extern "C" {
void *c_TalonSRX_Create(int deviceNumber, int controlPeriodMs);