Merge changes I55ce71c6,I803680c1

* changes:
  Rewrite CANTalon JNI layer.
  Last feature addition for CANTalon java/C++ user-facing API.
This commit is contained in:
Brad Miller (WPI)
2015-12-17 10:56:37 -08:00
committed by Gerrit Code Review
30 changed files with 5218 additions and 7858 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -52,10 +52,26 @@ protected:
};
UINT8 _deviceNumber;
void RegisterRx(uint32_t arbId);
/**
* Schedule a CAN Frame for periodic transmit. Assume eight byte DLC and zero value for initial transmission.
* @param arbId CAN Frame Arbitration ID. Set BIT31 for 11bit ids, otherwise we use 29bit ids.
* @param periodMs Period to transmit CAN frame. Pass 0 for one-shot, which also disables that ArbID's preceding periodic transmit.
*/
void RegisterTx(uint32_t arbId, uint32_t periodMs);
/**
* Schedule a CAN Frame for periodic transmit.
* @param arbId CAN Frame Arbitration ID. Set BIT31 for 11bit ids, otherwise we use 29bit ids.
* @param periodMs Period to transmit CAN frame. Pass 0 for one-shot, which also disables that ArbID's preceding periodic transmit.
* @param dlc Number of bytes to transmit (0 to 8).
* @param initialFrame Ptr to the frame data to schedule for transmitting. Passing null will result
* in defaulting to zero data value.
*/
void RegisterTx(uint32_t arbId, uint32_t periodMs, uint32_t dlc, const uint8_t * initialFrame);
void UnregisterTx(uint32_t arbId);
CTR_Code GetRx(uint32_t arbId,uint8_t * dataBytes,uint32_t timeoutMs);
void FlushTx(uint32_t arbId);
bool ChangeTxPeriod(uint32_t arbId, uint32_t periodMs);
template<typename T> txTask<T> GetTx(uint32_t arbId)
{
@@ -86,6 +102,7 @@ private:
uint32_t arbId;
uint8_t toSend[8];
uint32_t periodMs;
uint8_t dlc;
};
class rxEvent_t{

View File

@@ -1,5 +1,9 @@
#ifndef GLOBAL_H
#define GLOBAL_H
/**
* @file ctre.h
* Common header for all CTRE HAL modules.
*/
#ifndef CTRE_H
#define CTRE_H
//Bit Defines
#define BIT0 0x01
@@ -45,6 +49,9 @@ typedef enum {
CTR_UnexpectedArbId, //!< Specified CAN Id is invalid.
CTR_TxFailed, //!< Could not transmit the CAN frame.
CTR_SigNotUpdated, //!< Have not received an value response for signal.
CTR_BufferFull, //!< Caller attempted to insert data into a buffer that is full.
}CTR_Code;
#endif
#include "ctre_frames.h"
#endif /* CTRE_H */

View File

@@ -0,0 +1,243 @@
/**
* @file ctre_frames.h
* CAN Encoder/Decoder Structures for CTRE devices.
*/
#ifndef CTRE_FRAMES_H
#define CTRE_FRAMES_H
/** control */
typedef struct _TALON_Control_1_General_10ms_t {
unsigned TokenH:8;
unsigned TokenL:8;
unsigned DemandH:8;
unsigned DemandM:8;
unsigned DemandL:8;
unsigned ProfileSlotSelect:1;
unsigned FeedbackDeviceSelect:4;
unsigned OverrideLimitSwitchEn:3;
unsigned RevFeedbackSensor:1;
unsigned RevMotDuringCloseLoopEn:1;
unsigned OverrideBrakeType:2;
unsigned ModeSelect:4;
unsigned RampThrottle:8;
} TALON_Control_1_General_10ms_t ;
/* TALON_Control_2_Rates_OneShot_t removed since it has been deprecated */
typedef struct _TALON_Control_3_ClearFlags_OneShot_t {
unsigned ZeroFeedbackSensor:1;
unsigned ClearStickyFaults:1;
} TALON_Control_3_ClearFlags_OneShot_t ;
typedef struct _TALON_Control_5_General_10ms_t {
unsigned ThrottleBump_h3:3;
unsigned ReservedZero:5;
unsigned ThrottleBump_l8:8;
unsigned DemandH:8;
unsigned DemandM:8;
unsigned DemandL:8;
unsigned ProfileSlotSelect:1;
unsigned FeedbackDeviceSelect:4;
unsigned OverrideLimitSwitchEn:3;
unsigned RevFeedbackSensor:1;
unsigned RevMotDuringCloseLoopEn:1;
unsigned OverrideBrakeType:2;
unsigned ModeSelect:4;
unsigned RampThrottle:8;
} TALON_Control_5_General_10ms_t ;
typedef struct _TALON_Control_6_MotProfAddTrajPoint_t {
unsigned huffCode:2; //!< Compression coding
unsigned NextPt_VelOnly:1;
unsigned NextPt_IsLast:1;
unsigned reserved0:2;
unsigned NextPt_ZeroPosition:1;
unsigned NextPt_ProfileSlotSelect:1;
unsigned Idx:4;
unsigned reserved1:4;
unsigned restOfFrame0:8;
unsigned restOfFrame1:8;
unsigned restOfFrame2:8;
unsigned restOfFrame3:8;
unsigned restOfFrame4:8;
unsigned restOfFrame5:8;
} TALON_Control_6_MotProfAddTrajPoint_t;
typedef struct _TALON_Control_6_MotProfAddTrajPoint_huff0_t {
unsigned huffCode_expect_0:2; //!< Compression coding
unsigned NextPt_VelOnly:1;
unsigned NextPt_IsLast:1;
unsigned reserved0:2;
unsigned NextPt_ZeroPosition:1;
unsigned NextPt_ProfileSlotSelect:1;
unsigned Idx:4;
unsigned reserved1:4;
unsigned NextPt_DurationMs:8;
unsigned NextPt_VelocityH:8;
unsigned NextPt_VelocityL:8;
unsigned NextPt_PositionH:8;
unsigned NextPt_PositionM:8;
unsigned NextPt_PositionL:8;
} TALON_Control_6_MotProfAddTrajPoint_huff0_t;
typedef struct _TALON_Control_6_MotProfAddTrajPoint_huff1_t {
unsigned huffCode_expect_1:2; //!< Compression coding
unsigned NextPt_VelOnly:1;
unsigned NextPt_IsLast:1;
unsigned reserved0:2;
unsigned NextPt_ZeroPosition:1;
unsigned NextPt_ProfileSlotSelect:1;
unsigned Idx:4;
unsigned reserved1:4;
unsigned NextPt_DurationMs:8;
unsigned NextPt_SameVelocityH:8;
unsigned NextPt_SameVelocityL:8;
unsigned NextPt_DeltaPositionH:8;
unsigned NextPt_DeltaPositionL:8;
unsigned NextPt_Count:8;
} TALON_Control_6_MotProfAddTrajPoint_huff1_t;
/** status */
typedef struct _TALON_Status_1_General_10ms_t {
unsigned CloseLoopErrH:8;
unsigned CloseLoopErrM:8;
unsigned CloseLoopErrL:8;
unsigned AppliedThrottle_h3:3;
unsigned Fault_RevSoftLim:1;
unsigned Fault_ForSoftLim:1;
unsigned TokLocked:1;
unsigned LimitSwitchClosedRev:1;
unsigned LimitSwitchClosedFor:1;
unsigned AppliedThrottle_l8:8;
unsigned ModeSelect_h1:1;
unsigned FeedbackDeviceSelect:4;
unsigned LimitSwitchEn:3;
unsigned Fault_HardwareFailure:1;
unsigned Fault_RevLim:1;
unsigned Fault_ForLim:1;
unsigned Fault_UnderVoltage:1;
unsigned Fault_OverTemp:1;
unsigned ModeSelect_b3:3;
unsigned TokenSeed:8;
} TALON_Status_1_General_10ms_t ;
typedef struct _TALON_Status_2_Feedback_20ms_t {
unsigned SensorPositionH:8;
unsigned SensorPositionM:8;
unsigned SensorPositionL:8;
unsigned SensorVelocityH:8;
unsigned SensorVelocityL:8;
unsigned Current_h8:8;
unsigned StckyFault_RevSoftLim:1;
unsigned StckyFault_ForSoftLim:1;
unsigned StckyFault_RevLim:1;
unsigned StckyFault_ForLim:1;
unsigned StckyFault_UnderVoltage:1;
unsigned StckyFault_OverTemp:1;
unsigned Current_l2:2;
unsigned reserved:3;
unsigned Cmd5Allowed:1;
unsigned VelDiv4:1;
unsigned PosDiv8:1;
unsigned ProfileSlotSelect:1;
unsigned BrakeIsEnabled:1;
} TALON_Status_2_Feedback_20ms_t ;
typedef struct _TALON_Status_3_Enc_100ms_t {
unsigned EncPositionH:8;
unsigned EncPositionM:8;
unsigned EncPositionL:8;
unsigned EncVelH:8;
unsigned EncVelL:8;
unsigned EncIndexRiseEventsH:8;
unsigned EncIndexRiseEventsL:8;
unsigned reserved:3;
unsigned VelDiv4:1;
unsigned PosDiv8:1;
unsigned QuadIdxpin:1;
unsigned QuadBpin:1;
unsigned QuadApin:1;
} TALON_Status_3_Enc_100ms_t ;
typedef struct _TALON_Status_4_AinTempVbat_100ms_t {
unsigned AnalogInWithOvH:8;
unsigned AnalogInWithOvM:8;
unsigned AnalogInWithOvL:8;
unsigned AnalogInVelH:8;
unsigned AnalogInVelL:8;
unsigned Temp:8;
unsigned BatteryV:8;
unsigned reserved:6;
unsigned VelDiv4:1;
unsigned PosDiv8:1;
} TALON_Status_4_AinTempVbat_100ms_t ;
typedef struct _TALON_Status_5_Startup_OneShot_t {
unsigned ResetCountH:8;
unsigned ResetCountL:8;
unsigned ResetFlagsH:8;
unsigned ResetFlagsL:8;
unsigned FirmVersH:8;
unsigned FirmVersL:8;
} TALON_Status_5_Startup_OneShot_t ;
typedef struct _TALON_Status_6_Eol_t {
unsigned currentAdcUncal_h2:2;
unsigned reserved1:5;
unsigned SpiCsPin_GadgeteerPin6:1;
unsigned currentAdcUncal_l8:8;
unsigned tempAdcUncal_h2:2;
unsigned reserved2:6;
unsigned tempAdcUncal_l8:8;
unsigned vbatAdcUncal_h2:2;
unsigned reserved3:6;
unsigned vbatAdcUncal_l8:8;
unsigned analogAdcUncal_h2:2;
unsigned reserved4:6;
unsigned analogAdcUncal_l8:8;
} TALON_Status_6_Eol_t ;
typedef struct _TALON_Status_7_Debug_200ms_t {
unsigned TokenizationFails_h8:8;
unsigned TokenizationFails_l8:8;
unsigned LastFailedToken_h8:8;
unsigned LastFailedToken_l8:8;
unsigned TokenizationSucceses_h8:8;
unsigned TokenizationSucceses_l8:8;
} TALON_Status_7_Debug_200ms_t ;
typedef struct _TALON_Status_8_PulseWid_100ms_t {
unsigned PulseWidPositionH:8;
unsigned PulseWidPositionM:8;
unsigned PulseWidPositionL:8;
unsigned reserved:6;
unsigned VelDiv4:1;
unsigned PosDiv8:1;
unsigned PeriodUsM8:8;
unsigned PeriodUsL8:8;
unsigned PulseWidVelH:8;
unsigned PulseWidVelL:8;
} TALON_Status_8_PulseWid_100ms_t ;
typedef struct _TALON_Status_9_MotProfBuffer_100ms_t {
unsigned ActTraj_IsValid:1; //!< '1' if other ActTraj_* signals are valid. '0' if there is no active trajectory pt.
unsigned ActTraj_ProfileSlotSelect:1;
unsigned ActTraj_VelOnly:1;
unsigned ActTraj_IsLast:1;
unsigned OutputType:2;
unsigned HasUnderrun:1;
unsigned IsUnderrun:1;
unsigned NextID:4;
unsigned reserved1:3;
unsigned BufferIsFull:1;
unsigned Count:8;
unsigned ActTraj_VelocityH:8;
unsigned ActTraj_VelocityL:8;
unsigned ActTraj_PositionH:8;
unsigned ActTraj_PositionM:8;
unsigned ActTraj_PositionL:8;
} TALON_Status_9_MotProfBuffer_100ms_t ;
typedef struct _TALON_Param_Request_t {
unsigned ParamEnum:8;
} TALON_Param_Request_t ;
typedef struct _TALON_Param_Response_t {
unsigned ParamEnum:8;
unsigned ParamValueL:8;
unsigned ParamValueML:8;
unsigned ParamValueMH:8;
unsigned ParamValueH:8;
} TALON_Param_Response_t ;
#endif /* CTRE_FRAMES_H */

File diff suppressed because it is too large Load Diff

View File

@@ -18,20 +18,57 @@ void CtreCanNode::RegisterRx(uint32_t arbId)
{
/* no need to do anything, we just use new API to poll last received message */
}
void CtreCanNode::RegisterTx(uint32_t arbId, uint32_t periodMs)
/**
* Schedule a CAN Frame for periodic transmit.
* @param arbId CAN Frame Arbitration ID. Set BIT31 for 11bit ids, otherwise we use 29bit ids.
* @param periodMs Period to transmit CAN frame. Pass 0 for one-shot, which also disables that ArbID's preceding periodic transmit.
* @param dlc Number of bytes to transmit (0 to 8).
* @param initialFrame Ptr to the frame data to schedule for transmitting. Passing null will result
* in defaulting to zero data value.
*/
void CtreCanNode::RegisterTx(uint32_t arbId, uint32_t periodMs, uint32_t dlc, const uint8_t * initialFrame)
{
int32_t status = 0;
if(dlc > 8)
dlc = 8;
txJob_t job = {0};
job.arbId = arbId;
job.periodMs = periodMs;
job.dlc = dlc;
if(initialFrame){
/* caller wants to specify original data */
memcpy(job.toSend, initialFrame, dlc);
}
_txJobs[arbId] = job;
FRC_NetworkCommunication_CANSessionMux_sendMessage( job.arbId,
job.toSend,
8,
job.dlc,
job.periodMs,
&status);
}
/**
* Schedule a CAN Frame for periodic transmit. Assume eight byte DLC and zero value for initial transmission.
* @param arbId CAN Frame Arbitration ID. Set BIT31 for 11bit ids, otherwise we use 29bit ids.
* @param periodMs Period to transmit CAN frame. Pass 0 for one-shot, which also disables that ArbID's preceding periodic transmit.
*/
void CtreCanNode::RegisterTx(uint32_t arbId, uint32_t periodMs)
{
RegisterTx(arbId,periodMs, 8, 0);
}
/**
* Remove a CAN frame Arbid to stop transmission.
* @param arbId CAN Frame Arbitration ID. Set BIT31 for 11bit ids, otherwise we use 29bit ids.
*/
void CtreCanNode::UnregisterTx(uint32_t arbId)
{
/* set period to zero */
ChangeTxPeriod(arbId, 0);
/* look and remove */
txJobs_t::iterator iter = _txJobs.find(arbId);
if(iter != _txJobs.end()) {
_txJobs.erase(iter);
}
}
timespec diff(const timespec & start, const timespec & end)
{
timespec temp;
@@ -94,8 +131,34 @@ void CtreCanNode::FlushTx(uint32_t arbId)
if(iter != _txJobs.end())
FRC_NetworkCommunication_CANSessionMux_sendMessage( iter->second.arbId,
iter->second.toSend,
8,
iter->second.dlc,
iter->second.periodMs,
&status);
}
/**
* Change the transmit period of an already scheduled CAN frame.
* This keeps the frame payload contents the same without caller having to perform
* a read-modify-write.
* @param arbId CAN Frame Arbitration ID. Set BIT31 for 11bit ids, otherwise we use 29bit ids.
* @param periodMs Period to transmit CAN frame. Pass 0 for one-shot, which also disables that ArbID's preceding periodic transmit.
* @return true if scheduled job was found and updated, false if there was no preceding job for the specified arbID.
*/
bool CtreCanNode::ChangeTxPeriod(uint32_t arbId, uint32_t periodMs)
{
int32_t status = 0;
/* lookup the data bytes and period for this message */
txJobs_t::iterator iter = _txJobs.find(arbId);
if(iter != _txJobs.end()) {
/* modify th periodMs */
iter->second.periodMs = periodMs;
/* reinsert into scheduler with the same data bytes, only the period changed. */
FRC_NetworkCommunication_CANSessionMux_sendMessage( iter->second.arbId,
iter->second.toSend,
iter->second.dlc,
iter->second.periodMs,
&status);
return true;
}
return false;
}

View File

@@ -20,7 +20,8 @@ class CANSpeedController : public SpeedController {
kSpeed = 2,
kPosition = 3,
kVoltage = 4,
kFollower = 5 // Not supported in Jaguar.
kFollower = 5, // Not supported in Jaguar.
kMotionProfile = 6, // Not supported in Jaguar.
};
// Helper function for the ControlMode enum

View File

@@ -42,9 +42,9 @@ class CANTalon : public MotorSafety,
* Depending on the sensor type, Talon can determine if sensor is plugged in ot not.
*/
enum FeedbackDeviceStatus {
FeedbackStatusUnknown = 0, //!< Sensor status could not be determined. Not all sensors can do this.
FeedbackStatusPresent = 1, //!< Sensor is present and working okay.
FeedbackStatusNotPresent = 2, //!< Sensor is not present, not plugged in, not powered, etc...
FeedbackStatusUnknown = 0, //!< Sensor status could not be determined. Not all sensors can do this.
FeedbackStatusPresent = 1, //!< Sensor is present and working okay.
FeedbackStatusNotPresent = 2, //!< Sensor is not present, not plugged in, not powered, etc...
};
enum StatusFrameRate {
StatusFrameRateGeneral = 0,
@@ -53,6 +53,151 @@ class CANTalon : public MotorSafety,
StatusFrameRateAnalogTempVbat = 3,
StatusFrameRatePulseWidthMeas = 4,
};
/**
* Enumerated types for Motion Control Set Values.
* When in Motion Profile control mode, these constants are paseed
* into set() to manipulate the motion profile executer.
* When changing modes, be sure to read the value back using getMotionProfileStatus()
* to ensure changes in output take effect before performing buffering actions.
* Disable will signal Talon to put motor output into neutral drive.
* Talon will stop processing motion profile points. This means the buffer is
* effectively disconnected from the executer, allowing the robot to gracefully
* clear and push new traj points. isUnderrun will get cleared.
* The active trajectory is also cleared.
* Enable will signal Talon to pop a trajectory point from it's buffer and process it.
* If the active trajectory is empty, Talon will shift in the next point.
* If the active traj is empty, and so is the buffer, the motor drive is neutral and
* isUnderrun is set. When active traj times out, and buffer has at least one point,
* Talon shifts in next one, and isUnderrun is cleared. When active traj times out,
* and buffer is empty, Talon keeps processing active traj and sets IsUnderrun.
* Hold will signal Talon keep processing the active trajectory indefinitely.
* If the active traj is cleared, Talon will neutral motor drive. Otherwise
* Talon will keep processing the active traj but it will not shift in
* points from the buffer. This means the buffer is effectively disconnected
* from the executer, allowing the robot to gracefully clear and push
* new traj points.
* isUnderrun is set if active traj is empty, otherwise it is cleared.
* isLast signal is also cleared.
*
* Typical workflow:
* set(Disable),
* Confirm Disable takes effect,
* clear buffer and push buffer points,
* set(Enable) when enough points have been pushed to ensure no underruns,
* wait for MP to finish or decide abort,
* If MP finished gracefully set(Hold) to hold position servo and disconnect buffer,
* If MP is being aborted set(Disable) to neutral the motor and disconnect buffer,
* Confirm mode takes effect,
* clear buffer and push buffer points, and rinse-repeat.
*/
enum SetValueMotionProfile {
SetValueMotionProfileDisable = 0,
SetValueMotionProfileEnable = 1,
SetValueMotionProfileHold = 2,
};
/**
* Motion Profile Trajectory Point
* This is simply a data transer object.
*/
struct TrajectoryPoint {
double position; //!< The position to servo to.
double velocity; //!< The velocity to feed-forward.
/**
* Time in milliseconds to process this point.
* Value should be between 1ms and 255ms. If value is zero
* then Talon will default to 1ms. If value exceeds 255ms API will cap it.
*/
unsigned int timeDurMs;
/**
* Which slot to get PIDF gains.
* PID is used for position servo.
* F is used as the Kv constant for velocity feed-forward.
* Typically this is hardcoded to the a particular slot, but you are free
* gain schedule if need be.
*/
unsigned int profileSlotSelect;
/**
* Set to true to only perform the velocity feed-forward and not perform
* position servo. This is useful when learning how the position servo
* changes the motor response. The same could be accomplish by clearing the
* PID gains, however this is synchronous the streaming, and doesn't require restoing
* gains when finished.
*
* Additionaly setting this basically gives you direct control of the motor output
* since motor output = targetVelocity X Kv, where Kv is our Fgain.
* This means you can also scheduling straight-throttle curves without relying on
* a sensor.
*/
bool velocityOnly;
/**
* Set to true to signal Talon that this is the final point, so do not
* attempt to pop another trajectory point from out of the Talon buffer.
* Instead continue processing this way point. Typically the velocity
* member variable should be zero so that the motor doesn't spin indefinitely.
*/
bool isLastPoint;
/**
* Set to true to signal Talon to zero the selected sensor.
* When generating MPs, one simple method is to make the first target position zero,
* and the final target position the target distance from the current position.
* Then when you fire the MP, the current position gets set to zero.
* If this is the intent, you can set zeroPos on the first trajectory point.
*
* Otherwise you can leave this false for all points, and offset the positions
* of all trajectory points so they are correct.
*/
bool zeroPos;
};
/**
* Motion Profile Status
* This is simply a data transer object.
*/
struct MotionProfileStatus {
/**
* The available empty slots in the trajectory buffer.
*
* The robot API holds a "top buffer" of trajectory points, so your applicaion
* can dump several points at once. The API will then stream them into the Talon's
* low-level buffer, allowing the Talon to act on them.
*/
unsigned int topBufferRem;
/**
* The number of points in the top trajectory buffer.
*/
unsigned int topBufferCnt;
/**
* The number of points in the low level Talon buffer.
*/
unsigned int btmBufferCnt;
/**
* Set if isUnderrun ever gets set.
* Only is cleared by clearMotionProfileHasUnderrun() to ensure
* robot logic can react or instrument it.
* @see clearMotionProfileHasUnderrun()
*/
bool hasUnderrun;
/**
* This is set if Talon needs to shift a point from its buffer into
* the active trajectory point however the buffer is empty. This gets cleared
* automatically when is resolved.
*/
bool isUnderrun;
/**
* True if the active trajectory point has not empty, false otherwise.
* The members in activePoint are only valid if this signal is set.
*/
bool activePointValid;
/**
* The number of points in the low level Talon buffer.
*/
TrajectoryPoint activePoint;
/**
* The current output mode of the motion profile executer (disabled, enabled, or hold).
* When changing the set() value in MP mode, it's important to check this signal to
* confirm the change takes effect before interacting with the top buffer.
*/
SetValueMotionProfile outputEnable;
};
explicit CANTalon(int deviceNumber);
explicit CANTalon(int deviceNumber, int controlPeriodMs);
DEFAULT_MOVE_CONSTRUCTOR(CANTalon);
@@ -167,9 +312,9 @@ class CANTalon : public MotorSafety,
/**
* Enables Talon SRX to automatically zero the Sensor Position whenever an
* edge is detected on the index signal.
* @param enable boolean input, pass true to enable feature or false to disable.
* @param risingEdge boolean input, pass true to clear the position on rising edge,
* pass false to clear the position on falling edge.
* @param enable boolean input, pass true to enable feature or false to disable.
* @param risingEdge boolean input, pass true to clear the position on rising edge,
* pass false to clear the position on falling edge.
*/
void EnableZeroSensorPositionOnIndex(bool enable, bool risingEdge);
void ConfigSetParameter(uint32_t paramEnum, double value);
@@ -193,6 +338,69 @@ class CANTalon : public MotorSafety,
bool IsEnabled() const override;
double GetSetpoint() const override;
/**
* Calling application can opt to speed up the handshaking between the robot API and the Talon to increase the
* download rate of the Talon's Motion Profile. Ideally the period should be no more than half the period
* of a trajectory point.
*/
void ChangeMotionControlFramePeriod(int periodMs);
/**
* Clear the buffered motion profile in both Talon RAM (bottom), and in the API (top).
* Be sure to check GetMotionProfileStatus() to know when the buffer is actually cleared.
*/
void ClearMotionProfileTrajectories();
/**
* Retrieve just the buffer count for the api-level (top) buffer.
* This routine performs no CAN or data structure lookups, so its fast and ideal
* if caller needs to quickly poll the progress of trajectory points being emptied
* into Talon's RAM. Otherwise just use GetMotionProfileStatus.
* @return number of trajectory points in the top buffer.
*/
int GetMotionProfileTopLevelBufferCount();
/**
* Push another trajectory point into the top level buffer (which is emptied into
* the Talon's bottom buffer as room allows).
* @param trajPt the trajectory point to insert into buffer.
* @return true if trajectory point push ok. CTR_BufferFull if buffer is full
* due to kMotionProfileTopBufferCapacity.
*/
bool PushMotionProfileTrajectory(const TrajectoryPoint & trajPt);
/**
* @return true if api-level (top) buffer is full.
*/
bool IsMotionProfileTopLevelBufferFull();
/**
* This must be called periodically to funnel the trajectory points from the API's top level buffer to
* the Talon's bottom level buffer. Recommendation is to call this twice as fast as the executation rate of the motion profile.
* So if MP is running with 20ms trajectory points, try calling this routine every 10ms. All motion profile functions are thread-safe
* through the use of a mutex, so there is no harm in having the caller utilize threading.
*/
void ProcessMotionProfileBuffer();
/**
* Retrieve all status information.
* Since this all comes from one CAN frame, its ideal to have one routine to retrieve the frame once and decode everything.
* @param [out] motionProfileStatus contains all progress information on the currently running MP.
*/
void GetMotionProfileStatus(MotionProfileStatus & motionProfileStatus);
/**
* Clear the hasUnderrun flag in Talon's Motion Profile Executer when MPE is ready for another point,
* but the low level buffer is empty.
*
* Once the Motion Profile Executer sets the hasUnderrun flag, it stays set until
* Robot Application clears it with this routine, which ensures Robot Application
* gets a chance to instrument or react. Caller could also check the isUnderrun flag
* which automatically clears when fault condition is removed.
*/
void ClearMotionProfileHasUnderrun();
// LiveWindow stuff.
void ValueChanged(ITable* source, llvm::StringRef key,
std::shared_ptr<nt::Value> value, bool isNew) override;
@@ -216,6 +424,7 @@ class CANTalon : public MotorSafety,
kPositionMode = 1,
kSpeedMode = 2,
kCurrentMode = 3,
kMotionProfileMode = 6,
kDisabled = 15
};
@@ -255,10 +464,10 @@ class CANTalon : public MotorSafety,
static const unsigned int kDelayForSolicitedSignalsUs = 4000;
/**
* @param devToLookup FeedbackDevice to lookup the scalar for. Because Talon
* allows multiple sensors to be attached simultaneously, caller must
* specify which sensor to lookup.
* @return The number of native Talon units per rotation of the selected sensor.
* Zero if the necessary sensor information is not available.
* allows multiple sensors to be attached simultaneously, caller must
* specify which sensor to lookup.
* @return The number of native Talon units per rotation of the selected sensor.
* Zero if the necessary sensor information is not available.
* @see ConfigEncoderCodesPerRev
* @see ConfigPotentiometerTurns
*/
@@ -271,40 +480,40 @@ class CANTalon : public MotorSafety,
*/
void ApplyControlMode(CANSpeedController::ControlMode mode);
/**
* @param fullRotations double precision value representing number of rotations of selected feedback sensor.
* If user has never called the config routine for the selected sensor, then the caller
* is likely passing rotations in engineering units already, in which case it is returned
* as is.
* @see ConfigPotentiometerTurns
* @see ConfigEncoderCodesPerRev
* @param fullRotations double precision value representing number of rotations of selected feedback sensor.
* If user has never called the config routine for the selected sensor, then the caller
* is likely passing rotations in engineering units already, in which case it is returned
* as is.
* @see ConfigPotentiometerTurns
* @see ConfigEncoderCodesPerRev
* @return fullRotations in native engineering units of the Talon SRX firmware.
*/
int32_t ScaleRotationsToNativeUnits(FeedbackDevice devToLookup, double fullRotations) const;
/**
* @param rpm double precision value representing number of rotations per minute of selected feedback sensor.
* If user has never called the config routine for the selected sensor, then the caller
* is likely passing rotations in engineering units already, in which case it is returned
* as is.
* @see ConfigPotentiometerTurns
* @see ConfigEncoderCodesPerRev
* @param rpm double precision value representing number of rotations per minute of selected feedback sensor.
* If user has never called the config routine for the selected sensor, then the caller
* is likely passing rotations in engineering units already, in which case it is returned
* as is.
* @see ConfigPotentiometerTurns
* @see ConfigEncoderCodesPerRev
* @return sensor velocity in native engineering units of the Talon SRX firmware.
*/
int32_t ScaleVelocityToNativeUnits(FeedbackDevice devToLookup, double rpm) const;
/**
* @param nativePos integral position of the feedback sensor in native Talon SRX units.
* If user has never called the config routine for the selected sensor, then the return
* will be in TALON SRX units as well to match the behavior in the 2015 season.
* @see ConfigPotentiometerTurns
* @see ConfigEncoderCodesPerRev
* @param nativePos integral position of the feedback sensor in native Talon SRX units.
* If user has never called the config routine for the selected sensor, then the return
* will be in TALON SRX units as well to match the behavior in the 2015 season.
* @see ConfigPotentiometerTurns
* @see ConfigEncoderCodesPerRev
* @return double precision number of rotations, unless config was never performed.
*/
double ScaleNativeUnitsToRotations(FeedbackDevice devToLookup, int32_t nativePos) const;
/**
* @param nativeVel integral velocity of the feedback sensor in native Talon SRX units.
* If user has never called the config routine for the selected sensor, then the return
* will be in TALON SRX units as well to match the behavior in the 2015 season.
* @see ConfigPotentiometerTurns
* @see ConfigEncoderCodesPerRev
* @param nativeVel integral velocity of the feedback sensor in native Talon SRX units.
* If user has never called the config routine for the selected sensor, then the return
* will be in TALON SRX units as well to match the behavior in the 2015 season.
* @see ConfigPotentiometerTurns
* @see ConfigEncoderCodesPerRev
* @return double precision of sensor velocity in RPM, unless config was never performed.
*/
double ScaleNativeUnitsToRpm(FeedbackDevice devToLookup, int32_t nativeVel) const;

View File

@@ -1010,6 +1010,7 @@ void CANJaguar::SetP(double p) {
case kPercentVbus:
case kVoltage:
case kFollower:
case kMotionProfile:
wpi_setWPIErrorWithContext(
IncompatibleMode,
"PID constants only apply in Speed, Position, and Current mode");
@@ -1045,6 +1046,7 @@ void CANJaguar::SetI(double i) {
case kPercentVbus:
case kVoltage:
case kFollower:
case kMotionProfile:
wpi_setWPIErrorWithContext(
IncompatibleMode,
"PID constants only apply in Speed, Position, and Current mode");
@@ -1080,6 +1082,7 @@ void CANJaguar::SetD(double d) {
case kPercentVbus:
case kVoltage:
case kFollower:
case kMotionProfile:
wpi_setWPIErrorWithContext(
IncompatibleMode,
"PID constants only apply in Speed, Position, and Current mode");
@@ -1516,7 +1519,7 @@ void CANJaguar::SetControlMode(ControlMode controlMode) {
// Disable the previous mode
DisableControl();
if (controlMode == kFollower)
if ((controlMode == kFollower) || (controlMode == kMotionProfile))
wpi_setWPIErrorWithContext(IncompatibleMode,
"The Jaguar only supports Current, Voltage, "
"Position, Speed, and Percent (Throttle) "

View File

@@ -156,6 +156,9 @@ void CANTalon::Set(float value, uint8_t syncGroup) {
double milliamperes = (m_isInverted ? -value : value) * 1000.0; /* mA*/
status = m_impl->SetDemand(milliamperes);
} break;
case CANSpeedController::kMotionProfile: {
status = m_impl->SetDemand((int)value);
} break;
default:
wpi_setWPIErrorWithContext(
IncompatibleMode,
@@ -1430,6 +1433,9 @@ void CANTalon::ApplyControlMode(CANSpeedController::ControlMode mode) {
case kFollower:
m_sendMode = kFollowerMode;
break;
case kMotionProfile:
m_sendMode = kMotionProfileMode;
break;
}
// Keep the talon disabled until Set() is called.
CTR_Code status = m_impl->SetModeSelect((int)kDisabled);
@@ -1668,6 +1674,136 @@ void CANTalon::EnableZeroSensorPositionOnIndex(bool enable, bool risingEdge)
ConfigSetParameter(CanTalonSRX::eQuadIdxPolarity,risingEdge ? 1 : 0);
}
}
/**
* Calling application can opt to speed up the handshaking between the robot API and the Talon to increase the
* download rate of the Talon's Motion Profile. Ideally the period should be no more than half the period
* of a trajectory point.
*/
void CANTalon::ChangeMotionControlFramePeriod(int periodMs)
{
m_impl->ChangeMotionControlFramePeriod(periodMs);
}
/**
* Clear the buffered motion profile in both Talon RAM (bottom), and in the API (top).
* Be sure to check GetMotionProfileStatus() to know when the buffer is actually cleared.
*/
void CANTalon::ClearMotionProfileTrajectories()
{
m_impl->ClearMotionProfileTrajectories();
}
/**
* Retrieve just the buffer count for the api-level (top) buffer.
* This routine performs no CAN or data structure lookups, so its fast and ideal
* if caller needs to quickly poll the progress of trajectory points being emptied
* into Talon's RAM. Otherwise just use GetMotionProfileStatus.
* @return number of trajectory points in the top buffer.
*/
int CANTalon::GetMotionProfileTopLevelBufferCount()
{
return m_impl->GetMotionProfileTopLevelBufferCount();
}
/**
* Push another trajectory point into the top level buffer (which is emptied into
* the Talon's bottom buffer as room allows).
* @param trajPt the trajectory point to insert into buffer.
* @return true if trajectory point push ok. CTR_BufferFull if buffer is full
* due to kMotionProfileTopBufferCapacity.
*/
bool CANTalon::PushMotionProfileTrajectory(const TrajectoryPoint & trajPt)
{
/* convert positiona and velocity to native units */
int32_t targPos = ScaleRotationsToNativeUnits(m_feedbackDevice, trajPt.position);
int32_t targVel = ScaleVelocityToNativeUnits(m_feedbackDevice, trajPt.velocity);
/* bounds check signals that require it */
uint32_t profileSlotSelect = (trajPt.profileSlotSelect) ? 1 : 0;
uint8_t timeDurMs = (trajPt.timeDurMs >= 255) ? 255 : trajPt.timeDurMs; /* cap time to 255ms */
/* send it to the top level buffer */
CTR_Code status = m_impl->PushMotionProfileTrajectory(targPos, targVel, profileSlotSelect, timeDurMs, trajPt.velocityOnly, trajPt.isLastPoint, trajPt.zeroPos);
return (status == CTR_OKAY) ? true : false;
}
/**
* @return true if api-level (top) buffer is full.
*/
bool CANTalon::IsMotionProfileTopLevelBufferFull()
{
return m_impl->IsMotionProfileTopLevelBufferFull();
}
/**
* This must be called periodically to funnel the trajectory points from the API's top level buffer to
* the Talon's bottom level buffer. Recommendation is to call this twice as fast as the executation rate of the motion profile.
* So if MP is running with 20ms trajectory points, try calling this routine every 10ms. All motion profile functions are thread-safe
* through the use of a mutex, so there is no harm in having the caller utilize threading.
*/
void CANTalon::ProcessMotionProfileBuffer()
{
m_impl->ProcessMotionProfileBuffer();
}
/**
* Retrieve all status information.
* Since this all comes from one CAN frame, its ideal to have one routine to retrieve the frame once and decode everything.
* @param [out] motionProfileStatus contains all progress information on the currently running MP.
*/
void CANTalon::GetMotionProfileStatus(MotionProfileStatus & motionProfileStatus)
{
uint32_t flags;
uint32_t profileSlotSelect;
int32_t targPos, targVel;
uint32_t topBufferRem, topBufferCnt, btmBufferCnt;
uint32_t outputEnable;
/* retrieve all motion profile signals from status frame */
CTR_Code status = m_impl->GetMotionProfileStatus(flags, profileSlotSelect, targPos, targVel, topBufferRem, topBufferCnt, btmBufferCnt, outputEnable);
/* completely update the caller's structure */
motionProfileStatus.topBufferRem = topBufferRem;
motionProfileStatus.topBufferCnt = topBufferCnt;
motionProfileStatus.btmBufferCnt = btmBufferCnt;
motionProfileStatus.hasUnderrun = (flags & CanTalonSRX::kMotionProfileFlag_HasUnderrun) ? true :false;
motionProfileStatus.isUnderrun = (flags & CanTalonSRX::kMotionProfileFlag_IsUnderrun) ? true :false;
motionProfileStatus.activePointValid = (flags & CanTalonSRX::kMotionProfileFlag_ActTraj_IsValid) ? true :false;
motionProfileStatus.activePoint.isLastPoint = (flags & CanTalonSRX::kMotionProfileFlag_ActTraj_IsLast) ? true :false;
motionProfileStatus.activePoint.velocityOnly = (flags & CanTalonSRX::kMotionProfileFlag_ActTraj_VelOnly) ? true :false;
motionProfileStatus.activePoint.position = ScaleNativeUnitsToRotations(m_feedbackDevice, targPos);
motionProfileStatus.activePoint.velocity = ScaleNativeUnitsToRpm(m_feedbackDevice, targVel);
motionProfileStatus.activePoint.profileSlotSelect = profileSlotSelect;
switch(outputEnable){
case CanTalonSRX::kMotionProf_Disabled:
motionProfileStatus.outputEnable = SetValueMotionProfileDisable;
break;
case CanTalonSRX::kMotionProf_Enable:
motionProfileStatus.outputEnable = SetValueMotionProfileEnable;
break;
case CanTalonSRX::kMotionProf_Hold:
motionProfileStatus.outputEnable = SetValueMotionProfileHold;
break;
default:
motionProfileStatus.outputEnable = SetValueMotionProfileDisable;
break;
}
motionProfileStatus.activePoint.zeroPos = false; /* this signal is only used sending pts to Talon */
motionProfileStatus.activePoint.timeDurMs = 0; /* this signal is only used sending pts to Talon */
if (status != CTR_OKAY) {
wpi_setErrorWithContext(status, getHALErrorMessage(status));
}
}
/**
* Clear the hasUnderrun flag in Talon's Motion Profile Executer when MPE is ready for another point,
* but the low level buffer is empty.
*
* Once the Motion Profile Executer sets the hasUnderrun flag, it stays set until
* Robot Application clears it with this routine, which ensures Robot Application
* gets a chance to instrument or react. Caller could also check the isUnderrun flag
* which automatically clears when fault condition is removed.
*/
void CANTalon::ClearMotionProfileHasUnderrun()
{
ConfigSetParameter(CanTalonSRX::eMotionProfileHasUnderrunErr, 0);
}
/**
* Common interface for inverting direction of a speed controller.
* Only works in PercentVbus, speed, and Voltage modes.

View File

@@ -136,6 +136,7 @@ task jniHeaders {
args 'edu.wpi.first.wpilibj.hal.JNIWrapper'
args 'edu.wpi.first.wpilibj.hal.AccelerometerJNI'
args 'edu.wpi.first.wpilibj.hal.AnalogJNI'
args 'edu.wpi.first.wpilibj.hal.CanTalonJNI'
args 'edu.wpi.first.wpilibj.hal.CounterJNI'
args 'edu.wpi.first.wpilibj.hal.DigitalGlitchFilterJNI'
args 'edu.wpi.first.wpilibj.hal.DIOJNI'

View File

@@ -0,0 +1,829 @@
#include <jni.h>
#include <assert.h>
#include "edu_wpi_first_wpilibj_hal_CanTalonJNI.h"
#include "HAL/CanTalonSRX.h"
#include "HALUtil.h"
extern "C" {
inline bool CheckCTRStatus(JNIEnv *env, CTR_Code status) {
if (status != CTR_OKAY) ReportError(env, (int32_t)status, false);
return status == CTR_OKAY;
}
/*
* Class: edu_wpi_first_wpilibj_hal_CanTalonJNI
* Method: new_CanTalonSRX
* Signature: (III)J
*/
JNIEXPORT jlong JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_new_1CanTalonSRX__III
(JNIEnv *env, jclass, jint deviceNumber, jint controlPeriodMs, jint enablePeriodMs)
{
return (jlong)(new CanTalonSRX((int)deviceNumber, (int)controlPeriodMs, (int)enablePeriodMs));
}
/*
* Class: edu_wpi_first_wpilibj_hal_CanTalonJNI
* Method: new_CanTalonSRX
* Signature: (II)J
*/
JNIEXPORT jlong JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_new_1CanTalonSRX__II
(JNIEnv *env, jclass, jint deviceNumber, jint controlPeriodMs)
{
return (jlong)(new CanTalonSRX((int)deviceNumber, (int)controlPeriodMs));
}
/*
* Class: edu_wpi_first_wpilibj_hal_CanTalonJNI
* Method: new_CanTalonSRX
* Signature: (I)J
*/
JNIEXPORT jlong JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_new_1CanTalonSRX__I
(JNIEnv *env, jclass, jint deviceNumber)
{
return (jlong)(new CanTalonSRX((int)deviceNumber));
}
/*
* Class: edu_wpi_first_wpilibj_hal_CanTalonJNI
* Method: new_CanTalonSRX
* Signature: ()J
*/
JNIEXPORT jlong JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_new_1CanTalonSRX__
(JNIEnv *env, jclass)
{
return (jlong)(new CanTalonSRX);
}
/*
* Class: edu_wpi_first_wpilibj_hal_CanTalonJNI
* Method: delete_CanTalonSRX
* Signature: (J)V
*/
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_delete_1CanTalonSRX
(JNIEnv *env, jclass, jlong handle)
{
delete (CanTalonSRX*)handle;
}
/*
* Class: edu_wpi_first_wpilibj_hal_CanTalonJNI
* Method: GetMotionProfileStatus
* Signature: (JLedu/wpi/first/wpilibj/CANTalon;Ledu/wpi/first/wpilibj/CANTalon/MotionProfileStatus;)V
*/
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetMotionProfileStatus
(JNIEnv *env, jclass, jlong handle, jobject canTalon, jobject motionProfileStatus)
{
static jmethodID setMotionProfileStatusFromJNI = nullptr;
if (!setMotionProfileStatusFromJNI) {
jclass cls = env->GetObjectClass(canTalon);
setMotionProfileStatusFromJNI = env->GetMethodID(cls, "setMotionProfileStatusFromJNI", "(Ledu/wpi/first/wpilibj/CANTalon$MotionProfileStatus;IIIIIIII)V");
if (!setMotionProfileStatusFromJNI) return;
}
uint32_t flags;
uint32_t profileSlotSelect;
int32_t targPos;
int32_t targVel;
uint32_t topBufferRem;
uint32_t topBufferCnt;
uint32_t btmBufferCnt;
uint32_t outputEnable;
CTR_Code status = ((CanTalonSRX*)handle)->GetMotionProfileStatus(flags, profileSlotSelect, targPos, targVel, topBufferRem, topBufferCnt, btmBufferCnt, outputEnable);
if (!CheckCTRStatus(env, status)) return;
env->CallVoidMethod(canTalon, setMotionProfileStatusFromJNI, motionProfileStatus, (jint)flags, (jint)profileSlotSelect, (jint)targPos, (jint)targVel, (jint)topBufferRem, (jint)topBufferCnt, (jint)btmBufferCnt, (jint)outputEnable);
}
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_Set
(JNIEnv *env, jclass, jlong handle, jdouble value)
{
return ((CanTalonSRX*)handle)->Set((double)value);
}
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_SetParam
(JNIEnv *env, jclass, jlong handle, jint paramEnum, jdouble value)
{
CTR_Code status = ((CanTalonSRX*)handle)->SetParam((CanTalonSRX::param_t)paramEnum, (double)value);
CheckCTRStatus(env, status);
}
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_RequestParam
(JNIEnv *env, jclass, jlong handle, jint paramEnum)
{
CTR_Code status = ((CanTalonSRX*)handle)->RequestParam((CanTalonSRX::param_t)paramEnum);
CheckCTRStatus(env, status);
}
JNIEXPORT jdouble JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetParamResponse
(JNIEnv *env, jclass, jlong handle, jint paramEnum)
{
double value;
CTR_Code status = ((CanTalonSRX*)handle)->GetParamResponse((CanTalonSRX::param_t)paramEnum, value);
CheckCTRStatus(env, status);
return value;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetParamResponseInt32
(JNIEnv *env, jclass, jlong handle, jint paramEnum)
{
int value;
CTR_Code status = ((CanTalonSRX*)handle)->GetParamResponseInt32((CanTalonSRX::param_t)paramEnum, value);
CheckCTRStatus(env, status);
return value;
}
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_SetPgain
(JNIEnv *env, jclass, jlong handle, jint slotIdx, jdouble gain)
{
CTR_Code status = ((CanTalonSRX*)handle)->SetPgain((unsigned)slotIdx, (double)gain);
CheckCTRStatus(env, status);
}
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_SetIgain
(JNIEnv *env, jclass, jlong handle, jint slotIdx, jdouble gain)
{
CTR_Code status = ((CanTalonSRX*)handle)->SetIgain((unsigned)slotIdx, (double)gain);
CheckCTRStatus(env, status);
}
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_SetDgain
(JNIEnv *env, jclass, jlong handle, jint slotIdx, jdouble gain)
{
CTR_Code status = ((CanTalonSRX*)handle)->SetDgain((unsigned)slotIdx, (double)gain);
CheckCTRStatus(env, status);
}
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_SetFgain
(JNIEnv *env, jclass, jlong handle, jint slotIdx, jdouble gain)
{
CTR_Code status = ((CanTalonSRX*)handle)->SetFgain((unsigned)slotIdx, (double)gain);
CheckCTRStatus(env, status);
}
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_SetIzone
(JNIEnv *env, jclass, jlong handle, jint slotIdx, jint zone)
{
CTR_Code status = ((CanTalonSRX*)handle)->SetIzone((unsigned)slotIdx, (int)zone);
CheckCTRStatus(env, status);
}
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_SetCloseLoopRampRate
(JNIEnv *env, jclass, jlong handle, jint slotIdx, jint closeLoopRampRate)
{
CTR_Code status = ((CanTalonSRX*)handle)->SetCloseLoopRampRate((unsigned)slotIdx, (int)closeLoopRampRate);
CheckCTRStatus(env, status);
}
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_SetVoltageCompensationRate
(JNIEnv *env, jclass, jlong handle, jdouble voltagePerMs)
{
CTR_Code status = ((CanTalonSRX*)handle)->SetVoltageCompensationRate((double)voltagePerMs);
CheckCTRStatus(env, status);
}
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_SetSensorPosition
(JNIEnv *env, jclass, jlong handle, jint pos)
{
CTR_Code status = ((CanTalonSRX*)handle)->SetSensorPosition((int)pos);
CheckCTRStatus(env, status);
}
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_SetForwardSoftLimit
(JNIEnv *env, jclass, jlong handle, jint forwardLimit)
{
CTR_Code status = ((CanTalonSRX*)handle)->SetForwardSoftLimit((int)forwardLimit);
CheckCTRStatus(env, status);
}
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_SetReverseSoftLimit
(JNIEnv *env, jclass, jlong handle, jint reverseLimit)
{
CTR_Code status = ((CanTalonSRX*)handle)->SetReverseSoftLimit((int)reverseLimit);
CheckCTRStatus(env, status);
}
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_SetForwardSoftEnable
(JNIEnv *env, jclass, jlong handle, jint enable)
{
CTR_Code status = ((CanTalonSRX*)handle)->SetForwardSoftEnable((int)enable);
CheckCTRStatus(env, status);
}
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_SetReverseSoftEnable
(JNIEnv *env, jclass, jlong handle, jint enable)
{
CTR_Code status = ((CanTalonSRX*)handle)->SetReverseSoftEnable((int)enable);
CheckCTRStatus(env, status);
}
JNIEXPORT jdouble JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetPgain
(JNIEnv *env, jclass, jlong handle, jint slotIdx)
{
double gain;
CTR_Code status = ((CanTalonSRX*)handle)->GetPgain((unsigned)slotIdx, gain);
CheckCTRStatus(env, status);
return gain;
}
JNIEXPORT jdouble JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetIgain
(JNIEnv *env, jclass, jlong handle, jint slotIdx)
{
double gain;
CTR_Code status = ((CanTalonSRX*)handle)->GetIgain((unsigned)slotIdx, gain);
CheckCTRStatus(env, status);
return gain;
}
JNIEXPORT jdouble JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetDgain
(JNIEnv *env, jclass, jlong handle, jint slotIdx)
{
double gain;
CTR_Code status = ((CanTalonSRX*)handle)->GetDgain((unsigned)slotIdx, gain);
CheckCTRStatus(env, status);
return gain;
}
JNIEXPORT jdouble JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetFgain
(JNIEnv *env, jclass, jlong handle, jint slotIdx)
{
double gain;
CTR_Code status = ((CanTalonSRX*)handle)->GetFgain((unsigned)slotIdx, gain);
CheckCTRStatus(env, status);
return gain;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetIzone
(JNIEnv *env, jclass, jlong handle, jint slotIdx)
{
int zone;
CTR_Code status = ((CanTalonSRX*)handle)->GetIzone((unsigned)slotIdx, zone);
CheckCTRStatus(env, status);
return zone;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetCloseLoopRampRate
(JNIEnv *env, jclass, jlong handle, jint slotIdx)
{
int closeLoopRampRate;
CTR_Code status = ((CanTalonSRX*)handle)->GetCloseLoopRampRate((unsigned)slotIdx, closeLoopRampRate);
CheckCTRStatus(env, status);
return closeLoopRampRate;
}
JNIEXPORT jdouble JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetVoltageCompensationRate
(JNIEnv *env, jclass, jlong handle)
{
double voltagePerMs;
CTR_Code status = ((CanTalonSRX*)handle)->GetVoltageCompensationRate(voltagePerMs);
CheckCTRStatus(env, status);
return voltagePerMs;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetForwardSoftLimit
(JNIEnv *env, jclass, jlong handle)
{
int forwardLimit;
CTR_Code status = ((CanTalonSRX*)handle)->GetForwardSoftLimit(forwardLimit);
CheckCTRStatus(env, status);
return forwardLimit;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetReverseSoftLimit
(JNIEnv *env, jclass, jlong handle)
{
int reverseLimit;
CTR_Code status = ((CanTalonSRX*)handle)->GetReverseSoftLimit(reverseLimit);
CheckCTRStatus(env, status);
return reverseLimit;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetForwardSoftEnable
(JNIEnv *env, jclass, jlong handle)
{
int enable;
CTR_Code status = ((CanTalonSRX*)handle)->GetForwardSoftEnable(enable);
CheckCTRStatus(env, status);
return enable;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetReverseSoftEnable
(JNIEnv *env, jclass, jlong handle)
{
int enable;
CTR_Code status = ((CanTalonSRX*)handle)->GetReverseSoftEnable(enable);
CheckCTRStatus(env, status);
return enable;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetPulseWidthRiseToFallUs
(JNIEnv *env, jclass, jlong handle)
{
int param;
CTR_Code status = ((CanTalonSRX*)handle)->GetPulseWidthRiseToFallUs(param);
CheckCTRStatus(env, status);
return param;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_IsPulseWidthSensorPresent
(JNIEnv *env, jclass, jlong handle)
{
int param;
CTR_Code status = ((CanTalonSRX*)handle)->IsPulseWidthSensorPresent(param);
CheckCTRStatus(env, status);
return param;
}
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_SetModeSelect2
(JNIEnv *env, jclass, jlong handle, jint modeSelect, jint demand)
{
CTR_Code status = ((CanTalonSRX*)handle)->SetModeSelect((int)modeSelect, (int)demand);
CheckCTRStatus(env, status);
}
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_SetStatusFrameRate
(JNIEnv *env, jclass, jlong handle, jint frameEnum, jint periodMs)
{
CTR_Code status = ((CanTalonSRX*)handle)->SetStatusFrameRate((unsigned)frameEnum, (unsigned)periodMs);
CheckCTRStatus(env, status);
}
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_ClearStickyFaults
(JNIEnv *env, jclass, jlong handle)
{
CTR_Code status = ((CanTalonSRX*)handle)->ClearStickyFaults();
CheckCTRStatus(env, status);
}
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_ChangeMotionControlFramePeriod
(JNIEnv *env, jclass, jlong handle, jint periodMs)
{
return ((CanTalonSRX*)handle)->ChangeMotionControlFramePeriod((uint32_t)periodMs);
}
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_ClearMotionProfileTrajectories
(JNIEnv *env, jclass, jlong handle)
{
return ((CanTalonSRX*)handle)->ClearMotionProfileTrajectories();
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetMotionProfileTopLevelBufferCount
(JNIEnv *env, jclass, jlong handle)
{
return ((CanTalonSRX*)handle)->GetMotionProfileTopLevelBufferCount();
}
JNIEXPORT jboolean JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_IsMotionProfileTopLevelBufferFull
(JNIEnv *env, jclass, jlong handle)
{
return ((CanTalonSRX*)handle)->IsMotionProfileTopLevelBufferFull();
}
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_PushMotionProfileTrajectory
(JNIEnv *env, jclass, jlong handle, jint targPos, jint targVel, jint profileSlotSelect, jint timeDurMs, jint velOnly, jint isLastPoint, jint zeroPos)
{
CTR_Code status = ((CanTalonSRX*)handle)->PushMotionProfileTrajectory((int)targPos, (int)targVel, (int)profileSlotSelect, (int)timeDurMs, (int)velOnly, (int)isLastPoint, (int)zeroPos);
CheckCTRStatus(env, status);
}
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_ProcessMotionProfileBuffer
(JNIEnv *env, jclass, jlong handle)
{
return ((CanTalonSRX*)handle)->ProcessMotionProfileBuffer();
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetFault_OverTemp
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetFault_OverTemp(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetFault_UnderVoltage
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetFault_UnderVoltage(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetFault_ForLim
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetFault_ForLim(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetFault_RevLim
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetFault_RevLim(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetFault_HardwareFailure
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetFault_HardwareFailure(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetFault_ForSoftLim
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetFault_ForSoftLim(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetFault_RevSoftLim
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetFault_RevSoftLim(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetStckyFault_OverTemp
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetStckyFault_OverTemp(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetStckyFault_UnderVoltage
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetStckyFault_UnderVoltage(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetStckyFault_ForLim
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetStckyFault_ForLim(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetStckyFault_RevLim
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetStckyFault_RevLim(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetStckyFault_ForSoftLim
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetStckyFault_ForSoftLim(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetStckyFault_RevSoftLim
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetStckyFault_RevSoftLim(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetAppliedThrottle
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetAppliedThrottle(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetCloseLoopErr
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetCloseLoopErr(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetFeedbackDeviceSelect
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetFeedbackDeviceSelect(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetModeSelect
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetModeSelect(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetLimitSwitchEn
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetLimitSwitchEn(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetLimitSwitchClosedFor
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetLimitSwitchClosedFor(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetLimitSwitchClosedRev
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetLimitSwitchClosedRev(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetSensorPosition
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetSensorPosition(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetSensorVelocity
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetSensorVelocity(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jdouble JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetCurrent
(JNIEnv * env, jclass, jlong handle)
{
double retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetCurrent(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetBrakeIsEnabled
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetBrakeIsEnabled(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetEncPosition
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetEncPosition(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetEncVel
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetEncVel(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetEncIndexRiseEvents
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetEncIndexRiseEvents(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetQuadApin
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetQuadApin(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetQuadBpin
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetQuadBpin(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetQuadIdxpin
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetQuadIdxpin(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetAnalogInWithOv
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetAnalogInWithOv(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetAnalogInVel
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetAnalogInVel(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jdouble JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetTemp
(JNIEnv * env, jclass, jlong handle)
{
double retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetTemp(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jdouble JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetBatteryV
(JNIEnv * env, jclass, jlong handle)
{
double retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetBatteryV(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetResetCount
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetResetCount(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetResetFlags
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetResetFlags(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetFirmVers
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetFirmVers(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetPulseWidthPosition
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetPulseWidthPosition(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetPulseWidthVelocity
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetPulseWidthVelocity(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetPulseWidthRiseToRiseUs
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetPulseWidthRiseToRiseUs(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetActTraj_IsValid
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetActTraj_IsValid(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetActTraj_ProfileSlotSelect
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetActTraj_ProfileSlotSelect(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetActTraj_VelOnly
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetActTraj_VelOnly(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetActTraj_IsLast
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetActTraj_IsLast(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetOutputType
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetOutputType(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetHasUnderrun
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetHasUnderrun(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetIsUnderrun
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetIsUnderrun(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetNextID
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetNextID(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetBufferIsFull
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetBufferIsFull(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetCount
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetCount(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetActTraj_Velocity
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetActTraj_Velocity(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_GetActTraj_Position
(JNIEnv * env, jclass, jlong handle)
{
int retval;
CTR_Code status = ((CanTalonSRX*)handle)->GetActTraj_Position(retval);
CheckCTRStatus(env, status);
return retval;
}
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_SetDemand
(JNIEnv * env, jclass, jlong handle, jint param)
{
CTR_Code status = ((CanTalonSRX*)handle)->SetDemand(param);
CheckCTRStatus(env, status);
}
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_SetOverrideLimitSwitchEn
(JNIEnv * env, jclass, jlong handle, jint param)
{
CTR_Code status = ((CanTalonSRX*)handle)->SetOverrideLimitSwitchEn(param);
CheckCTRStatus(env, status);
}
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_SetFeedbackDeviceSelect
(JNIEnv * env, jclass, jlong handle, jint param)
{
CTR_Code status = ((CanTalonSRX*)handle)->SetFeedbackDeviceSelect(param);
CheckCTRStatus(env, status);
}
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_SetRevMotDuringCloseLoopEn
(JNIEnv * env, jclass, jlong handle, jint param)
{
CTR_Code status = ((CanTalonSRX*)handle)->SetRevMotDuringCloseLoopEn(param);
CheckCTRStatus(env, status);
}
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_SetOverrideBrakeType
(JNIEnv * env, jclass, jlong handle, jint param)
{
CTR_Code status = ((CanTalonSRX*)handle)->SetOverrideBrakeType(param);
CheckCTRStatus(env, status);
}
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_SetModeSelect
(JNIEnv * env, jclass, jlong handle, jint param)
{
CTR_Code status = ((CanTalonSRX*)handle)->SetModeSelect(param);
CheckCTRStatus(env, status);
}
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_SetProfileSlotSelect
(JNIEnv * env, jclass, jlong handle, jint param)
{
CTR_Code status = ((CanTalonSRX*)handle)->SetProfileSlotSelect(param);
CheckCTRStatus(env, status);
}
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_SetRampThrottle
(JNIEnv * env, jclass, jlong handle, jint param)
{
CTR_Code status = ((CanTalonSRX*)handle)->SetRampThrottle(param);
CheckCTRStatus(env, status);
}
JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_CanTalonJNI_SetRevFeedbackSensor
(JNIEnv * env, jclass, jlong handle, jint param)
{
CTR_Code status = ((CanTalonSRX*)handle)->SetRevFeedbackSensor(param);
CheckCTRStatus(env, status);
}
} // extern "C"

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +0,0 @@
%module CanTalon
%{
#include "ctre/CanTalonSRX.h"
%}
%include "cpointer.i"
%pointer_functions(double, doublep);
%pointer_functions(int, intp);
%pointer_functions(uint32_t, uint32_tp);
%pointer_functions(int32_t, int32_tp);
%pointer_functions(uint8_t, uint8_tp);
%pointer_functions(CTR_Code, CTR_Codep);
%pointer_functions(float, floatp);
%include "CtreCanNode.h"
%include "CanTalonSRX.h"

View File

@@ -1,10 +0,0 @@
The generateJNI.sh script explains how to use it to generate the JNI bindings
for the CAN Talon stuff using swig. This whole directory is a temporary measure
until I (James Kuszmaul--11/18/2014) or someone else figures out how to
integrate the swig stuff into the build system. For now, all the generated JNI
bindings are checked into git, so that it should work until someone goes and updates ctre/CanTalonSRX.*
In order for this to work, I had to change the CanTalonSRX constructor to take a int deviceNumber instead of a uint8_t.
Also, in all the SWIGTYPE* files, you must change protected methods to public functions.
Because the SWIGTYPE* files don't generally change, you can jsut do a git checkout -- SWIGTYPE* in wpilibJavaDevices/....../wpilibj/

View File

@@ -1,18 +0,0 @@
#!/bin/bash
#This script should be able to generate the JNI
# bindings for the CANTalon using swig.At some point,
# it should be integrated into the build system,
# but I[james 18 November 2014] don't know how to do that.
# Assumes running from allwpilib/wpilibj/wpilibJavaJNI/swigTalon
# Get files that we node to generate from.
cp ../../../hal/lib/Athena/ctre/CanTalonSRX.cpp ./
cp ../../../wpilibc/wpilibC++Devices/include/ctre/* ./
# Clean up from previous run.
rm *.java
# Run SWIG.
swig -c++ -package edu.wpi.first.wpilibj.hal -java CanTalonSRX.i
# Stick generated files into appropriate places.
cp CanTalonSRX_wrap.cxx ../lib/CanTalonSRXJNI.cpp
mv CanTalonJNI.java ../../wpilibJavaDevices/src/main/java/edu/wpi/first/wpilibj/hal/
rm CanTalon.java # useless file.
cp *.java ../../wpilibJavaDevices/src/main/java/edu/wpi/first/wpilibj/

File diff suppressed because it is too large Load Diff

View File

@@ -1,745 +0,0 @@
/*
* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org). Version
* 2.0.11
*$
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* -----------------------------------------------------------------------------
*/
package edu.wpi.first.wpilibj.hal;
public class CanTalonSRX extends CtreCanNode {
private long swigCPtr;
protected CanTalonSRX(long cPtr, boolean cMemoryOwn) {
super(CanTalonJNI.CanTalonSRX_SWIGUpcast(cPtr), cMemoryOwn);
swigCPtr = cPtr;
}
protected static long getCPtr(CanTalonSRX obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
protected void finalize() {
delete();
}
public synchronized void delete() {
if (swigCPtr != 0) {
if (swigCMemOwn) {
swigCMemOwn = false;
CanTalonJNI.delete_CanTalonSRX(swigCPtr);
}
swigCPtr = 0;
}
super.delete();
}
public CanTalonSRX(int deviceNumber, int controlPeriodMs) {
this(CanTalonJNI.new_CanTalonSRX__SWIG_0(deviceNumber, controlPeriodMs), true);
}
public CanTalonSRX(int deviceNumber) {
this(CanTalonJNI.new_CanTalonSRX__SWIG_1(deviceNumber), true);
}
public CanTalonSRX() {
this(CanTalonJNI.new_CanTalonSRX__SWIG_2(), true);
}
public void Set(double value) {
CanTalonJNI.CanTalonSRX_Set(swigCPtr, this, value);
}
public SWIGTYPE_p_CTR_Code SetParam(CanTalonSRX.param_t paramEnum, double value) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_SetParam(swigCPtr, this,
paramEnum.swigValue(), value), true);
}
public SWIGTYPE_p_CTR_Code RequestParam(CanTalonSRX.param_t paramEnum) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_RequestParam(swigCPtr, this,
paramEnum.swigValue()), true);
}
public SWIGTYPE_p_CTR_Code GetParamResponse(CanTalonSRX.param_t paramEnum, SWIGTYPE_p_double value) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetParamResponse(swigCPtr, this,
paramEnum.swigValue(), SWIGTYPE_p_double.getCPtr(value)), true);
}
public SWIGTYPE_p_CTR_Code GetParamResponseInt32(CanTalonSRX.param_t paramEnum,
SWIGTYPE_p_int value) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetParamResponseInt32(swigCPtr, this,
paramEnum.swigValue(), SWIGTYPE_p_int.getCPtr(value)), true);
}
public SWIGTYPE_p_CTR_Code SetPgain(long slotIdx, double gain) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_SetPgain(swigCPtr, this, slotIdx, gain),
true);
}
public SWIGTYPE_p_CTR_Code SetIgain(long slotIdx, double gain) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_SetIgain(swigCPtr, this, slotIdx, gain),
true);
}
public SWIGTYPE_p_CTR_Code SetDgain(long slotIdx, double gain) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_SetDgain(swigCPtr, this, slotIdx, gain),
true);
}
public SWIGTYPE_p_CTR_Code SetFgain(long slotIdx, double gain) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_SetFgain(swigCPtr, this, slotIdx, gain),
true);
}
public SWIGTYPE_p_CTR_Code SetIzone(long slotIdx, int zone) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_SetIzone(swigCPtr, this, slotIdx, zone),
true);
}
public SWIGTYPE_p_CTR_Code SetCloseLoopRampRate(long slotIdx, int closeLoopRampRate) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_SetCloseLoopRampRate(swigCPtr, this,
slotIdx, closeLoopRampRate), true);
}
public SWIGTYPE_p_CTR_Code SetVoltageCompensationRate(double vpers) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_SetVoltageCompensationRate(swigCPtr, this,vpers), true);
}
public SWIGTYPE_p_CTR_Code SetSensorPosition(int pos) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_SetSensorPosition(swigCPtr, this, pos),true);
}
public SWIGTYPE_p_CTR_Code SetForwardSoftLimit(int forwardLimit) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_SetForwardSoftLimit(swigCPtr, this,
forwardLimit), true);
}
public SWIGTYPE_p_CTR_Code SetReverseSoftLimit(int reverseLimit) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_SetReverseSoftLimit(swigCPtr, this,
reverseLimit), true);
}
public SWIGTYPE_p_CTR_Code SetForwardSoftEnable(int enable) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_SetForwardSoftEnable(swigCPtr, this,
enable), true);
}
public SWIGTYPE_p_CTR_Code SetReverseSoftEnable(int enable) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_SetReverseSoftEnable(swigCPtr, this,
enable), true);
}
public SWIGTYPE_p_CTR_Code GetPgain(long slotIdx, SWIGTYPE_p_double gain) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetPgain(swigCPtr, this, slotIdx,
SWIGTYPE_p_double.getCPtr(gain)), true);
}
public SWIGTYPE_p_CTR_Code GetIgain(long slotIdx, SWIGTYPE_p_double gain) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetIgain(swigCPtr, this, slotIdx,
SWIGTYPE_p_double.getCPtr(gain)), true);
}
public SWIGTYPE_p_CTR_Code GetDgain(long slotIdx, SWIGTYPE_p_double gain) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetDgain(swigCPtr, this, slotIdx,
SWIGTYPE_p_double.getCPtr(gain)), true);
}
public SWIGTYPE_p_CTR_Code GetFgain(long slotIdx, SWIGTYPE_p_double gain) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetFgain(swigCPtr, this, slotIdx,
SWIGTYPE_p_double.getCPtr(gain)), true);
}
public SWIGTYPE_p_CTR_Code GetIzone(long slotIdx, SWIGTYPE_p_int zone) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetIzone(swigCPtr, this, slotIdx,
SWIGTYPE_p_int.getCPtr(zone)), true);
}
public SWIGTYPE_p_CTR_Code GetCloseLoopRampRate(long slotIdx, SWIGTYPE_p_int closeLoopRampRate) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetCloseLoopRampRate(swigCPtr, this,
slotIdx, SWIGTYPE_p_int.getCPtr(closeLoopRampRate)), true);
}
public SWIGTYPE_p_CTR_Code GetVoltageCompensationRate(SWIGTYPE_p_double vpers) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetVoltageCompensationRate(swigCPtr, this,
SWIGTYPE_p_double.getCPtr(vpers)), true);
}
public SWIGTYPE_p_CTR_Code GetForwardSoftLimit(SWIGTYPE_p_int forwardLimit) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetForwardSoftLimit(swigCPtr, this,
SWIGTYPE_p_int.getCPtr(forwardLimit)), true);
}
public SWIGTYPE_p_CTR_Code GetReverseSoftLimit(SWIGTYPE_p_int reverseLimit) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetReverseSoftLimit(swigCPtr, this,
SWIGTYPE_p_int.getCPtr(reverseLimit)), true);
}
public SWIGTYPE_p_CTR_Code GetForwardSoftEnable(SWIGTYPE_p_int enable) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetForwardSoftEnable(swigCPtr, this,
SWIGTYPE_p_int.getCPtr(enable)), true);
}
public SWIGTYPE_p_CTR_Code GetReverseSoftEnable(SWIGTYPE_p_int enable) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetReverseSoftEnable(swigCPtr, this,
SWIGTYPE_p_int.getCPtr(enable)), true);
}
public SWIGTYPE_p_CTR_Code SetStatusFrameRate(long frameEnum, long periodMs) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_SetStatusFrameRate(swigCPtr, this,
frameEnum, periodMs), true);
}
public SWIGTYPE_p_CTR_Code ClearStickyFaults() {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_ClearStickyFaults(swigCPtr, this), true);
}
public SWIGTYPE_p_CTR_Code GetFault_OverTemp(SWIGTYPE_p_int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetFault_OverTemp(swigCPtr, this,
SWIGTYPE_p_int.getCPtr(param)), true);
}
public SWIGTYPE_p_CTR_Code GetFault_UnderVoltage(SWIGTYPE_p_int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetFault_UnderVoltage(swigCPtr, this,
SWIGTYPE_p_int.getCPtr(param)), true);
}
public SWIGTYPE_p_CTR_Code GetFault_ForLim(SWIGTYPE_p_int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetFault_ForLim(swigCPtr, this,
SWIGTYPE_p_int.getCPtr(param)), true);
}
public SWIGTYPE_p_CTR_Code GetFault_RevLim(SWIGTYPE_p_int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetFault_RevLim(swigCPtr, this,
SWIGTYPE_p_int.getCPtr(param)), true);
}
public SWIGTYPE_p_CTR_Code GetFault_HardwareFailure(SWIGTYPE_p_int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetFault_HardwareFailure(swigCPtr, this,
SWIGTYPE_p_int.getCPtr(param)), true);
}
public SWIGTYPE_p_CTR_Code GetFault_ForSoftLim(SWIGTYPE_p_int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetFault_ForSoftLim(swigCPtr, this,
SWIGTYPE_p_int.getCPtr(param)), true);
}
public SWIGTYPE_p_CTR_Code GetFault_RevSoftLim(SWIGTYPE_p_int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetFault_RevSoftLim(swigCPtr, this,
SWIGTYPE_p_int.getCPtr(param)), true);
}
public SWIGTYPE_p_CTR_Code GetStckyFault_OverTemp(SWIGTYPE_p_int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetStckyFault_OverTemp(swigCPtr, this,
SWIGTYPE_p_int.getCPtr(param)), true);
}
public SWIGTYPE_p_CTR_Code GetStckyFault_UnderVoltage(SWIGTYPE_p_int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetStckyFault_UnderVoltage(swigCPtr,
this, SWIGTYPE_p_int.getCPtr(param)), true);
}
public SWIGTYPE_p_CTR_Code GetStckyFault_ForLim(SWIGTYPE_p_int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetStckyFault_ForLim(swigCPtr, this,
SWIGTYPE_p_int.getCPtr(param)), true);
}
public SWIGTYPE_p_CTR_Code GetStckyFault_RevLim(SWIGTYPE_p_int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetStckyFault_RevLim(swigCPtr, this,
SWIGTYPE_p_int.getCPtr(param)), true);
}
public SWIGTYPE_p_CTR_Code GetStckyFault_ForSoftLim(SWIGTYPE_p_int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetStckyFault_ForSoftLim(swigCPtr, this,
SWIGTYPE_p_int.getCPtr(param)), true);
}
public SWIGTYPE_p_CTR_Code GetStckyFault_RevSoftLim(SWIGTYPE_p_int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetStckyFault_RevSoftLim(swigCPtr, this,
SWIGTYPE_p_int.getCPtr(param)), true);
}
public SWIGTYPE_p_CTR_Code GetAppliedThrottle(SWIGTYPE_p_int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetAppliedThrottle(swigCPtr, this,
SWIGTYPE_p_int.getCPtr(param)), true);
}
public SWIGTYPE_p_CTR_Code GetCloseLoopErr(SWIGTYPE_p_int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetCloseLoopErr(swigCPtr, this,
SWIGTYPE_p_int.getCPtr(param)), true);
}
public SWIGTYPE_p_CTR_Code GetFeedbackDeviceSelect(SWIGTYPE_p_int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetFeedbackDeviceSelect(swigCPtr, this,
SWIGTYPE_p_int.getCPtr(param)), true);
}
public SWIGTYPE_p_CTR_Code GetModeSelect(SWIGTYPE_p_int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetModeSelect(swigCPtr, this,
SWIGTYPE_p_int.getCPtr(param)), true);
}
public SWIGTYPE_p_CTR_Code GetLimitSwitchEn(SWIGTYPE_p_int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetLimitSwitchEn(swigCPtr, this,
SWIGTYPE_p_int.getCPtr(param)), true);
}
public SWIGTYPE_p_CTR_Code GetLimitSwitchClosedFor(SWIGTYPE_p_int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetLimitSwitchClosedFor(swigCPtr, this,
SWIGTYPE_p_int.getCPtr(param)), true);
}
public SWIGTYPE_p_CTR_Code GetLimitSwitchClosedRev(SWIGTYPE_p_int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetLimitSwitchClosedRev(swigCPtr, this,
SWIGTYPE_p_int.getCPtr(param)), true);
}
public SWIGTYPE_p_CTR_Code GetSensorPosition(SWIGTYPE_p_int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetSensorPosition(swigCPtr, this,
SWIGTYPE_p_int.getCPtr(param)), true);
}
public SWIGTYPE_p_CTR_Code GetSensorVelocity(SWIGTYPE_p_int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetSensorVelocity(swigCPtr, this,
SWIGTYPE_p_int.getCPtr(param)), true);
}
public SWIGTYPE_p_CTR_Code GetCurrent(SWIGTYPE_p_double param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetCurrent(swigCPtr, this,
SWIGTYPE_p_double.getCPtr(param)), true);
}
public SWIGTYPE_p_CTR_Code GetBrakeIsEnabled(SWIGTYPE_p_int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetBrakeIsEnabled(swigCPtr, this,
SWIGTYPE_p_int.getCPtr(param)), true);
}
public SWIGTYPE_p_CTR_Code GetEncPosition(SWIGTYPE_p_int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetEncPosition(swigCPtr, this,
SWIGTYPE_p_int.getCPtr(param)), true);
}
public SWIGTYPE_p_CTR_Code GetEncVel(SWIGTYPE_p_int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetEncVel(swigCPtr, this,
SWIGTYPE_p_int.getCPtr(param)), true);
}
public SWIGTYPE_p_CTR_Code GetEncIndexRiseEvents(SWIGTYPE_p_int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetEncIndexRiseEvents(swigCPtr, this,
SWIGTYPE_p_int.getCPtr(param)), true);
}
public SWIGTYPE_p_CTR_Code GetQuadApin(SWIGTYPE_p_int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetQuadApin(swigCPtr, this,
SWIGTYPE_p_int.getCPtr(param)), true);
}
public SWIGTYPE_p_CTR_Code GetQuadBpin(SWIGTYPE_p_int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetQuadBpin(swigCPtr, this,
SWIGTYPE_p_int.getCPtr(param)), true);
}
public SWIGTYPE_p_CTR_Code GetQuadIdxpin(SWIGTYPE_p_int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetQuadIdxpin(swigCPtr, this,
SWIGTYPE_p_int.getCPtr(param)), true);
}
public SWIGTYPE_p_CTR_Code GetAnalogInWithOv(SWIGTYPE_p_int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetAnalogInWithOv(swigCPtr, this,
SWIGTYPE_p_int.getCPtr(param)), true);
}
public SWIGTYPE_p_CTR_Code GetAnalogInVel(SWIGTYPE_p_int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetAnalogInVel(swigCPtr, this,
SWIGTYPE_p_int.getCPtr(param)), true);
}
public SWIGTYPE_p_CTR_Code GetTemp(SWIGTYPE_p_double param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetTemp(swigCPtr, this,
SWIGTYPE_p_double.getCPtr(param)), true);
}
public SWIGTYPE_p_CTR_Code GetBatteryV(SWIGTYPE_p_double param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetBatteryV(swigCPtr, this,
SWIGTYPE_p_double.getCPtr(param)), true);
}
public SWIGTYPE_p_CTR_Code GetResetCount(SWIGTYPE_p_int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetResetCount(swigCPtr, this,
SWIGTYPE_p_int.getCPtr(param)), true);
}
public SWIGTYPE_p_CTR_Code GetResetFlags(SWIGTYPE_p_int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetResetFlags(swigCPtr, this,
SWIGTYPE_p_int.getCPtr(param)), true);
}
public SWIGTYPE_p_CTR_Code GetFirmVers(SWIGTYPE_p_int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetFirmVers(swigCPtr, this,
SWIGTYPE_p_int.getCPtr(param)), true);
}
public SWIGTYPE_p_CTR_Code SetDemand(int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_SetDemand(swigCPtr, this, param), true);
}
public SWIGTYPE_p_CTR_Code SetOverrideLimitSwitchEn(int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_SetOverrideLimitSwitchEn(swigCPtr, this,
param), true);
}
public SWIGTYPE_p_CTR_Code SetFeedbackDeviceSelect(int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_SetFeedbackDeviceSelect(swigCPtr, this,
param), true);
}
public SWIGTYPE_p_CTR_Code SetRevMotDuringCloseLoopEn(int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_SetRevMotDuringCloseLoopEn(swigCPtr,
this, param), true);
}
public SWIGTYPE_p_CTR_Code SetOverrideBrakeType(int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_SetOverrideBrakeType(swigCPtr, this,
param), true);
}
public SWIGTYPE_p_CTR_Code SetModeSelect(int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_SetModeSelect(swigCPtr, this, param),
true);
}
public SWIGTYPE_p_CTR_Code SetProfileSlotSelect(int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_SetProfileSlotSelect(swigCPtr, this,
param), true);
}
public SWIGTYPE_p_CTR_Code SetRampThrottle(int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_SetRampThrottle(swigCPtr, this, param),
true);
}
public SWIGTYPE_p_CTR_Code SetRevFeedbackSensor(int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_SetRevFeedbackSensor(swigCPtr, this,
param), true);
}
public SWIGTYPE_p_CTR_Code GetPulseWidthPosition(SWIGTYPE_p_int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetPulseWidthPosition(swigCPtr, this,
SWIGTYPE_p_int.getCPtr(param)), true);
}
public SWIGTYPE_p_CTR_Code GetPulseWidthVelocity(SWIGTYPE_p_int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetPulseWidthVelocity(swigCPtr, this,
SWIGTYPE_p_int.getCPtr(param)), true);
}
public SWIGTYPE_p_CTR_Code GetPulseWidthRiseToFallUs(SWIGTYPE_p_int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetPulseWidthRiseToFallUs(swigCPtr, this,
SWIGTYPE_p_int.getCPtr(param)), true);
}
public SWIGTYPE_p_CTR_Code GetPulseWidthRiseToRiseUs(SWIGTYPE_p_int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_GetPulseWidthRiseToRiseUs(swigCPtr, this,
SWIGTYPE_p_int.getCPtr(param)), true);
}
public SWIGTYPE_p_CTR_Code IsPulseWidthSensorPresent(SWIGTYPE_p_int param) {
return new SWIGTYPE_p_CTR_Code(CanTalonJNI.CanTalonSRX_IsPulseWidthSensorPresent(swigCPtr, this,
SWIGTYPE_p_int.getCPtr(param)), true);
}
public final static int kDefaultControlPeriodMs = CanTalonJNI
.CanTalonSRX_kDefaultControlPeriodMs_get();
public final static int kMode_DutyCycle = CanTalonJNI.CanTalonSRX_kMode_DutyCycle_get();
public final static int kMode_PositionCloseLoop = CanTalonJNI
.CanTalonSRX_kMode_PositionCloseLoop_get();
public final static int kMode_VelocityCloseLoop = CanTalonJNI
.CanTalonSRX_kMode_VelocityCloseLoop_get();
public final static int kMode_CurrentCloseLoop = CanTalonJNI
.CanTalonSRX_kMode_CurrentCloseLoop_get();
public final static int kMode_VoltCompen = CanTalonJNI.CanTalonSRX_kMode_VoltCompen_get();
public final static int kMode_SlaveFollower = CanTalonJNI.CanTalonSRX_kMode_SlaveFollower_get();
public final static int kMode_NoDrive = CanTalonJNI.CanTalonSRX_kMode_NoDrive_get();
public final static int kLimitSwitchOverride_UseDefaultsFromFlash = CanTalonJNI
.CanTalonSRX_kLimitSwitchOverride_UseDefaultsFromFlash_get();
public final static int kLimitSwitchOverride_DisableFwd_DisableRev = CanTalonJNI
.CanTalonSRX_kLimitSwitchOverride_DisableFwd_DisableRev_get();
public final static int kLimitSwitchOverride_DisableFwd_EnableRev = CanTalonJNI
.CanTalonSRX_kLimitSwitchOverride_DisableFwd_EnableRev_get();
public final static int kLimitSwitchOverride_EnableFwd_DisableRev = CanTalonJNI
.CanTalonSRX_kLimitSwitchOverride_EnableFwd_DisableRev_get();
public final static int kLimitSwitchOverride_EnableFwd_EnableRev = CanTalonJNI
.CanTalonSRX_kLimitSwitchOverride_EnableFwd_EnableRev_get();
public final static int kBrakeOverride_UseDefaultsFromFlash = CanTalonJNI
.CanTalonSRX_kBrakeOverride_UseDefaultsFromFlash_get();
public final static int kBrakeOverride_OverrideCoast = CanTalonJNI
.CanTalonSRX_kBrakeOverride_OverrideCoast_get();
public final static int kBrakeOverride_OverrideBrake = CanTalonJNI
.CanTalonSRX_kBrakeOverride_OverrideBrake_get();
public final static int kFeedbackDev_DigitalQuadEnc = CanTalonJNI
.CanTalonSRX_kFeedbackDev_DigitalQuadEnc_get();
public final static int kFeedbackDev_AnalogPot = CanTalonJNI
.CanTalonSRX_kFeedbackDev_AnalogPot_get();
public final static int kFeedbackDev_AnalogEncoder = CanTalonJNI
.CanTalonSRX_kFeedbackDev_AnalogEncoder_get();
public final static int kFeedbackDev_CountEveryRisingEdge = CanTalonJNI
.CanTalonSRX_kFeedbackDev_CountEveryRisingEdge_get();
public final static int kFeedbackDev_CountEveryFallingEdge = CanTalonJNI
.CanTalonSRX_kFeedbackDev_CountEveryFallingEdge_get();
public final static int kFeedbackDev_PosIsPulseWidth = CanTalonJNI
.CanTalonSRX_kFeedbackDev_PosIsPulseWidth_get();
public final static int kProfileSlotSelect_Slot0 = CanTalonJNI
.CanTalonSRX_kProfileSlotSelect_Slot0_get();
public final static int kProfileSlotSelect_Slot1 = CanTalonJNI
.CanTalonSRX_kProfileSlotSelect_Slot1_get();
public final static int kStatusFrame_General = CanTalonJNI.CanTalonSRX_kStatusFrame_General_get();
public final static int kStatusFrame_Feedback = CanTalonJNI
.CanTalonSRX_kStatusFrame_Feedback_get();
public final static int kStatusFrame_Encoder = CanTalonJNI.CanTalonSRX_kStatusFrame_Encoder_get();
public final static int kStatusFrame_AnalogTempVbat = CanTalonJNI
.CanTalonSRX_kStatusFrame_AnalogTempVbat_get();
public final static int kStatusFrame_PulseWidthMeas = CanTalonJNI
.CanTalonSRX_kStatusFrame_PulseWidthMeas_get();
public final static class param_t {
public final static CanTalonSRX.param_t eProfileParamSlot0_P = new CanTalonSRX.param_t(
"eProfileParamSlot0_P", CanTalonJNI.CanTalonSRX_eProfileParamSlot0_P_get());
public final static CanTalonSRX.param_t eProfileParamSlot0_I = new CanTalonSRX.param_t(
"eProfileParamSlot0_I", CanTalonJNI.CanTalonSRX_eProfileParamSlot0_I_get());
public final static CanTalonSRX.param_t eProfileParamSlot0_D = new CanTalonSRX.param_t(
"eProfileParamSlot0_D", CanTalonJNI.CanTalonSRX_eProfileParamSlot0_D_get());
public final static CanTalonSRX.param_t eProfileParamSlot0_F = new CanTalonSRX.param_t(
"eProfileParamSlot0_F", CanTalonJNI.CanTalonSRX_eProfileParamSlot0_F_get());
public final static CanTalonSRX.param_t eProfileParamSlot0_IZone = new CanTalonSRX.param_t(
"eProfileParamSlot0_IZone", CanTalonJNI.CanTalonSRX_eProfileParamSlot0_IZone_get());
public final static CanTalonSRX.param_t eProfileParamSlot0_CloseLoopRampRate =
new CanTalonSRX.param_t("eProfileParamSlot0_CloseLoopRampRate",
CanTalonJNI.CanTalonSRX_eProfileParamSlot0_CloseLoopRampRate_get());
public final static CanTalonSRX.param_t eProfileParamSlot1_P = new CanTalonSRX.param_t(
"eProfileParamSlot1_P", CanTalonJNI.CanTalonSRX_eProfileParamSlot1_P_get());
public final static CanTalonSRX.param_t eProfileParamSlot1_I = new CanTalonSRX.param_t(
"eProfileParamSlot1_I", CanTalonJNI.CanTalonSRX_eProfileParamSlot1_I_get());
public final static CanTalonSRX.param_t eProfileParamSlot1_D = new CanTalonSRX.param_t(
"eProfileParamSlot1_D", CanTalonJNI.CanTalonSRX_eProfileParamSlot1_D_get());
public final static CanTalonSRX.param_t eProfileParamSlot1_F = new CanTalonSRX.param_t(
"eProfileParamSlot1_F", CanTalonJNI.CanTalonSRX_eProfileParamSlot1_F_get());
public final static CanTalonSRX.param_t eProfileParamSlot1_IZone = new CanTalonSRX.param_t(
"eProfileParamSlot1_IZone", CanTalonJNI.CanTalonSRX_eProfileParamSlot1_IZone_get());
public final static CanTalonSRX.param_t eProfileParamSlot1_CloseLoopRampRate =
new CanTalonSRX.param_t("eProfileParamSlot1_CloseLoopRampRate",
CanTalonJNI.CanTalonSRX_eProfileParamSlot1_CloseLoopRampRate_get());
public final static CanTalonSRX.param_t eProfileParamSoftLimitForThreshold =
new CanTalonSRX.param_t("eProfileParamSoftLimitForThreshold",
CanTalonJNI.CanTalonSRX_eProfileParamSoftLimitForThreshold_get());
public final static CanTalonSRX.param_t eProfileParamSoftLimitRevThreshold =
new CanTalonSRX.param_t("eProfileParamSoftLimitRevThreshold",
CanTalonJNI.CanTalonSRX_eProfileParamSoftLimitRevThreshold_get());
public final static CanTalonSRX.param_t eProfileParamSoftLimitForEnable =
new CanTalonSRX.param_t("eProfileParamSoftLimitForEnable",
CanTalonJNI.CanTalonSRX_eProfileParamSoftLimitForEnable_get());
public final static CanTalonSRX.param_t eProfileParamSoftLimitRevEnable =
new CanTalonSRX.param_t("eProfileParamSoftLimitRevEnable",
CanTalonJNI.CanTalonSRX_eProfileParamSoftLimitRevEnable_get());
public final static CanTalonSRX.param_t eOnBoot_BrakeMode = new CanTalonSRX.param_t(
"eOnBoot_BrakeMode", CanTalonJNI.CanTalonSRX_eOnBoot_BrakeMode_get());
public final static CanTalonSRX.param_t eOnBoot_LimitSwitch_Forward_NormallyClosed =
new CanTalonSRX.param_t("eOnBoot_LimitSwitch_Forward_NormallyClosed",
CanTalonJNI.CanTalonSRX_eOnBoot_LimitSwitch_Forward_NormallyClosed_get());
public final static CanTalonSRX.param_t eOnBoot_LimitSwitch_Reverse_NormallyClosed =
new CanTalonSRX.param_t("eOnBoot_LimitSwitch_Reverse_NormallyClosed",
CanTalonJNI.CanTalonSRX_eOnBoot_LimitSwitch_Reverse_NormallyClosed_get());
public final static CanTalonSRX.param_t eOnBoot_LimitSwitch_Forward_Disable =
new CanTalonSRX.param_t("eOnBoot_LimitSwitch_Forward_Disable",
CanTalonJNI.CanTalonSRX_eOnBoot_LimitSwitch_Forward_Disable_get());
public final static CanTalonSRX.param_t eOnBoot_LimitSwitch_Reverse_Disable =
new CanTalonSRX.param_t("eOnBoot_LimitSwitch_Reverse_Disable",
CanTalonJNI.CanTalonSRX_eOnBoot_LimitSwitch_Reverse_Disable_get());
public final static CanTalonSRX.param_t eFault_OverTemp = new CanTalonSRX.param_t(
"eFault_OverTemp", CanTalonJNI.CanTalonSRX_eFault_OverTemp_get());
public final static CanTalonSRX.param_t eFault_UnderVoltage = new CanTalonSRX.param_t(
"eFault_UnderVoltage", CanTalonJNI.CanTalonSRX_eFault_UnderVoltage_get());
public final static CanTalonSRX.param_t eFault_ForLim = new CanTalonSRX.param_t(
"eFault_ForLim", CanTalonJNI.CanTalonSRX_eFault_ForLim_get());
public final static CanTalonSRX.param_t eFault_RevLim = new CanTalonSRX.param_t(
"eFault_RevLim", CanTalonJNI.CanTalonSRX_eFault_RevLim_get());
public final static CanTalonSRX.param_t eFault_HardwareFailure = new CanTalonSRX.param_t(
"eFault_HardwareFailure", CanTalonJNI.CanTalonSRX_eFault_HardwareFailure_get());
public final static CanTalonSRX.param_t eFault_ForSoftLim = new CanTalonSRX.param_t(
"eFault_ForSoftLim", CanTalonJNI.CanTalonSRX_eFault_ForSoftLim_get());
public final static CanTalonSRX.param_t eFault_RevSoftLim = new CanTalonSRX.param_t(
"eFault_RevSoftLim", CanTalonJNI.CanTalonSRX_eFault_RevSoftLim_get());
public final static CanTalonSRX.param_t eStckyFault_OverTemp = new CanTalonSRX.param_t(
"eStckyFault_OverTemp", CanTalonJNI.CanTalonSRX_eStckyFault_OverTemp_get());
public final static CanTalonSRX.param_t eStckyFault_UnderVoltage = new CanTalonSRX.param_t(
"eStckyFault_UnderVoltage", CanTalonJNI.CanTalonSRX_eStckyFault_UnderVoltage_get());
public final static CanTalonSRX.param_t eStckyFault_ForLim = new CanTalonSRX.param_t(
"eStckyFault_ForLim", CanTalonJNI.CanTalonSRX_eStckyFault_ForLim_get());
public final static CanTalonSRX.param_t eStckyFault_RevLim = new CanTalonSRX.param_t(
"eStckyFault_RevLim", CanTalonJNI.CanTalonSRX_eStckyFault_RevLim_get());
public final static CanTalonSRX.param_t eStckyFault_ForSoftLim = new CanTalonSRX.param_t(
"eStckyFault_ForSoftLim", CanTalonJNI.CanTalonSRX_eStckyFault_ForSoftLim_get());
public final static CanTalonSRX.param_t eStckyFault_RevSoftLim = new CanTalonSRX.param_t(
"eStckyFault_RevSoftLim", CanTalonJNI.CanTalonSRX_eStckyFault_RevSoftLim_get());
public final static CanTalonSRX.param_t eAppliedThrottle = new CanTalonSRX.param_t(
"eAppliedThrottle", CanTalonJNI.CanTalonSRX_eAppliedThrottle_get());
public final static CanTalonSRX.param_t eCloseLoopErr = new CanTalonSRX.param_t(
"eCloseLoopErr", CanTalonJNI.CanTalonSRX_eCloseLoopErr_get());
public final static CanTalonSRX.param_t eFeedbackDeviceSelect = new CanTalonSRX.param_t(
"eFeedbackDeviceSelect", CanTalonJNI.CanTalonSRX_eFeedbackDeviceSelect_get());
public final static CanTalonSRX.param_t eRevMotDuringCloseLoopEn = new CanTalonSRX.param_t(
"eRevMotDuringCloseLoopEn", CanTalonJNI.CanTalonSRX_eRevMotDuringCloseLoopEn_get());
public final static CanTalonSRX.param_t eModeSelect = new CanTalonSRX.param_t("eModeSelect",
CanTalonJNI.CanTalonSRX_eModeSelect_get());
public final static CanTalonSRX.param_t eProfileSlotSelect = new CanTalonSRX.param_t(
"eProfileSlotSelect", CanTalonJNI.CanTalonSRX_eProfileSlotSelect_get());
public final static CanTalonSRX.param_t eRampThrottle = new CanTalonSRX.param_t(
"eRampThrottle", CanTalonJNI.CanTalonSRX_eRampThrottle_get());
public final static CanTalonSRX.param_t eRevFeedbackSensor = new CanTalonSRX.param_t(
"eRevFeedbackSensor", CanTalonJNI.CanTalonSRX_eRevFeedbackSensor_get());
public final static CanTalonSRX.param_t eLimitSwitchEn = new CanTalonSRX.param_t(
"eLimitSwitchEn", CanTalonJNI.CanTalonSRX_eLimitSwitchEn_get());
public final static CanTalonSRX.param_t eLimitSwitchClosedFor = new CanTalonSRX.param_t(
"eLimitSwitchClosedFor", CanTalonJNI.CanTalonSRX_eLimitSwitchClosedFor_get());
public final static CanTalonSRX.param_t eLimitSwitchClosedRev = new CanTalonSRX.param_t(
"eLimitSwitchClosedRev", CanTalonJNI.CanTalonSRX_eLimitSwitchClosedRev_get());
public final static CanTalonSRX.param_t eSensorPosition = new CanTalonSRX.param_t(
"eSensorPosition", CanTalonJNI.CanTalonSRX_eSensorPosition_get());
public final static CanTalonSRX.param_t eSensorVelocity = new CanTalonSRX.param_t(
"eSensorVelocity", CanTalonJNI.CanTalonSRX_eSensorVelocity_get());
public final static CanTalonSRX.param_t eCurrent = new CanTalonSRX.param_t("eCurrent",
CanTalonJNI.CanTalonSRX_eCurrent_get());
public final static CanTalonSRX.param_t eBrakeIsEnabled = new CanTalonSRX.param_t(
"eBrakeIsEnabled", CanTalonJNI.CanTalonSRX_eBrakeIsEnabled_get());
public final static CanTalonSRX.param_t eEncPosition = new CanTalonSRX.param_t("eEncPosition",
CanTalonJNI.CanTalonSRX_eEncPosition_get());
public final static CanTalonSRX.param_t eEncVel = new CanTalonSRX.param_t("eEncVel",
CanTalonJNI.CanTalonSRX_eEncVel_get());
public final static CanTalonSRX.param_t eEncIndexRiseEvents = new CanTalonSRX.param_t(
"eEncIndexRiseEvents", CanTalonJNI.CanTalonSRX_eEncIndexRiseEvents_get());
public final static CanTalonSRX.param_t eQuadApin = new CanTalonSRX.param_t("eQuadApin",
CanTalonJNI.CanTalonSRX_eQuadApin_get());
public final static CanTalonSRX.param_t eQuadBpin = new CanTalonSRX.param_t("eQuadBpin",
CanTalonJNI.CanTalonSRX_eQuadBpin_get());
public final static CanTalonSRX.param_t eQuadIdxpin = new CanTalonSRX.param_t("eQuadIdxpin",
CanTalonJNI.CanTalonSRX_eQuadIdxpin_get());
public final static CanTalonSRX.param_t eAnalogInWithOv = new CanTalonSRX.param_t(
"eAnalogInWithOv", CanTalonJNI.CanTalonSRX_eAnalogInWithOv_get());
public final static CanTalonSRX.param_t eAnalogInVel = new CanTalonSRX.param_t("eAnalogInVel",
CanTalonJNI.CanTalonSRX_eAnalogInVel_get());
public final static CanTalonSRX.param_t eTemp = new CanTalonSRX.param_t("eTemp",
CanTalonJNI.CanTalonSRX_eTemp_get());
public final static CanTalonSRX.param_t eBatteryV = new CanTalonSRX.param_t("eBatteryV",
CanTalonJNI.CanTalonSRX_eBatteryV_get());
public final static CanTalonSRX.param_t eResetCount = new CanTalonSRX.param_t("eResetCount",
CanTalonJNI.CanTalonSRX_eResetCount_get());
public final static CanTalonSRX.param_t eResetFlags = new CanTalonSRX.param_t("eResetFlags",
CanTalonJNI.CanTalonSRX_eResetFlags_get());
public final static CanTalonSRX.param_t eFirmVers = new CanTalonSRX.param_t("eFirmVers",
CanTalonJNI.CanTalonSRX_eFirmVers_get());
public final static CanTalonSRX.param_t eSettingsChanged = new CanTalonSRX.param_t(
"eSettingsChanged", CanTalonJNI.CanTalonSRX_eSettingsChanged_get());
public final static CanTalonSRX.param_t eQuadFilterEn = new CanTalonSRX.param_t(
"eQuadFilterEn", CanTalonJNI.CanTalonSRX_eQuadFilterEn_get());
public final static CanTalonSRX.param_t ePidIaccum = new CanTalonSRX.param_t("ePidIaccum",
CanTalonJNI.CanTalonSRX_ePidIaccum_get());
public final static CanTalonSRX.param_t eStatus1FrameRate = new CanTalonSRX.param_t("eStatus1FrameRate",
CanTalonJNI.CanTalonSRX_eStatus1FrameRate_get());
public final static CanTalonSRX.param_t eStatus2FrameRate = new CanTalonSRX.param_t("eStatus2FrameRate",
CanTalonJNI.CanTalonSRX_eStatus2FrameRate_get());
public final static CanTalonSRX.param_t eStatus3FrameRate = new CanTalonSRX.param_t("eStatus3FrameRate",
CanTalonJNI.CanTalonSRX_eStatus3FrameRate_get());
public final static CanTalonSRX.param_t eStatus4FrameRate = new CanTalonSRX.param_t("eStatus4FrameRate",
CanTalonJNI.CanTalonSRX_eStatus4FrameRate_get());
public final static CanTalonSRX.param_t eStatus6FrameRate = new CanTalonSRX.param_t("eStatus6FrameRate",
CanTalonJNI.CanTalonSRX_eStatus6FrameRate_get());
public final static CanTalonSRX.param_t eStatus7FrameRate = new CanTalonSRX.param_t("eStatus7FrameRate",
CanTalonJNI.CanTalonSRX_eStatus7FrameRate_get());
public final static CanTalonSRX.param_t eClearPositionOnIdx = new CanTalonSRX.param_t("eClearPositionOnIdx",
CanTalonJNI.CanTalonSRX_eClearPositionOnIdx_get());
public final static CanTalonSRX.param_t ePeakPosOutput = new CanTalonSRX.param_t("ePeakPosOutput",
CanTalonJNI.CanTalonSRX_ePeakPosOutput_get());
public final static CanTalonSRX.param_t eNominalPosOutput = new CanTalonSRX.param_t("eNominalPosOutput",
CanTalonJNI.CanTalonSRX_eNominalPosOutput_get());
public final static CanTalonSRX.param_t ePeakNegOutput = new CanTalonSRX.param_t("ePeakNegOutput",
CanTalonJNI.CanTalonSRX_ePeakNegOutput_get());
public final static CanTalonSRX.param_t eNominalNegOutput = new CanTalonSRX.param_t("eNominalNegOutput",
CanTalonJNI.CanTalonSRX_eNominalNegOutput_get());
public final static CanTalonSRX.param_t eQuadIdxPolarity = new CanTalonSRX.param_t("eQuadIdxPolarity",
CanTalonJNI.CanTalonSRX_eQuadIdxPolarity_get());
public final static CanTalonSRX.param_t eStatus8FrameRate = new CanTalonSRX.param_t("eStatus8FrameRate",
CanTalonJNI.CanTalonSRX_eStatus8FrameRate_get());
public final static CanTalonSRX.param_t eAllowPosOverflow = new CanTalonSRX.param_t("eAllowPosOverflow",
CanTalonJNI.CanTalonSRX_eAllowPosOverflow_get());
public final static CanTalonSRX.param_t eProfileParamSlot0_AllowableClosedLoopErr = new CanTalonSRX.param_t("eProfileParamSlot0_AllowableClosedLoopErr",
CanTalonJNI.CanTalonSRX_eProfileParamSlot0_AllowableClosedLoopErr_get());
public final static CanTalonSRX.param_t eNumberPotTurns = new CanTalonSRX.param_t("eNumberPotTurns",
CanTalonJNI.CanTalonSRX_eNumberPotTurns_get());
public final static CanTalonSRX.param_t eNumberEncoderCPR = new CanTalonSRX.param_t("eNumberEncoderCPR",
CanTalonJNI.CanTalonSRX_eNumberEncoderCPR_get());
public final static CanTalonSRX.param_t ePwdPosition = new CanTalonSRX.param_t("ePwdPosition",
CanTalonJNI.CanTalonSRX_ePwdPosition_get());
public final static CanTalonSRX.param_t eAinPosition = new CanTalonSRX.param_t("eAinPosition",
CanTalonJNI.CanTalonSRX_eAinPosition_get());
public final static CanTalonSRX.param_t eProfileParamVcompRate = new CanTalonSRX.param_t("eProfileParamVcompRate",
CanTalonJNI.CanTalonSRX_eProfileParamVcompRate_get());
public final static CanTalonSRX.param_t eProfileParamSlot1_AllowableClosedLoopErr = new CanTalonSRX.param_t("eProfileParamSlot1_AllowableClosedLoopErr",
CanTalonJNI.CanTalonSRX_eProfileParamSlot1_AllowableClosedLoopErr_get());
public final int swigValue() {
return swigValue;
}
public String toString() {
return swigName;
}
public static param_t swigToEnum(int swigValue) {
if (swigValue < swigValues.length && swigValue >= 0
&& swigValues[swigValue].swigValue == swigValue)
return swigValues[swigValue];
for (int i = 0; i < swigValues.length; i++)
if (swigValues[i].swigValue == swigValue)
return swigValues[i];
throw new IllegalArgumentException("No enum " + param_t.class + " with value " + swigValue);
}
private param_t(String swigName) {
this.swigName = swigName;
this.swigValue = swigNext++;
}
private param_t(String swigName, int swigValue) {
this.swigName = swigName;
this.swigValue = swigValue;
swigNext = swigValue + 1;
}
private param_t(String swigName, param_t swigEnum) {
this.swigName = swigName;
this.swigValue = swigEnum.swigValue;
swigNext = this.swigValue + 1;
}
private static param_t[] swigValues = {eProfileParamSlot0_P, eProfileParamSlot0_I,
eProfileParamSlot0_D, eProfileParamSlot0_F, eProfileParamSlot0_IZone,
eProfileParamSlot0_CloseLoopRampRate, eProfileParamSlot1_P, eProfileParamSlot1_I,
eProfileParamSlot1_D, eProfileParamSlot1_F, eProfileParamSlot1_IZone,
eProfileParamSlot1_CloseLoopRampRate, eProfileParamSoftLimitForThreshold,
eProfileParamSoftLimitRevThreshold, eProfileParamSoftLimitForEnable,
eProfileParamSoftLimitRevEnable, eOnBoot_BrakeMode,
eOnBoot_LimitSwitch_Forward_NormallyClosed, eOnBoot_LimitSwitch_Reverse_NormallyClosed,
eOnBoot_LimitSwitch_Forward_Disable, eOnBoot_LimitSwitch_Reverse_Disable, eFault_OverTemp,
eFault_UnderVoltage, eFault_ForLim, eFault_RevLim, eFault_HardwareFailure,
eFault_ForSoftLim, eFault_RevSoftLim, eStckyFault_OverTemp, eStckyFault_UnderVoltage,
eStckyFault_ForLim, eStckyFault_RevLim, eStckyFault_ForSoftLim, eStckyFault_RevSoftLim,
eAppliedThrottle, eCloseLoopErr, eFeedbackDeviceSelect, eRevMotDuringCloseLoopEn,
eModeSelect, eProfileSlotSelect, eRampThrottle, eRevFeedbackSensor, eLimitSwitchEn,
eLimitSwitchClosedFor, eLimitSwitchClosedRev, eSensorPosition, eSensorVelocity, eCurrent,
eBrakeIsEnabled, eEncPosition, eEncVel, eEncIndexRiseEvents, eQuadApin, eQuadBpin,
eQuadIdxpin, eAnalogInWithOv, eAnalogInVel, eTemp, eBatteryV, eResetCount, eResetFlags,
eFirmVers, eSettingsChanged, eQuadFilterEn, ePidIaccum};
private static int swigNext = 0;
private final int swigValue;
private final String swigName;
}
}

View File

@@ -1,48 +0,0 @@
/*
* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org). Version
* 2.0.11
*$
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* -----------------------------------------------------------------------------
*/
package edu.wpi.first.wpilibj.hal;
public class CtreCanNode {
private long swigCPtr;
protected boolean swigCMemOwn;
protected CtreCanNode(long cPtr, boolean cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = cPtr;
}
protected static long getCPtr(CtreCanNode obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
protected void finalize() {
delete();
}
public synchronized void delete() {
if (swigCPtr != 0) {
if (swigCMemOwn) {
swigCMemOwn = false;
CanTalonJNI.delete_CtreCanNode(swigCPtr);
}
swigCPtr = 0;
}
}
public CtreCanNode(SWIGTYPE_p_UINT8 deviceNumber) {
this(CanTalonJNI.new_CtreCanNode(SWIGTYPE_p_UINT8.getCPtr(deviceNumber)), true);
}
public SWIGTYPE_p_UINT8 GetDeviceNumber() {
return new SWIGTYPE_p_UINT8(CanTalonJNI.CtreCanNode_GetDeviceNumber(swigCPtr, this), true);
}
}

View File

@@ -1,27 +0,0 @@
/*
* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org). Version
* 2.0.11
*$
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* -----------------------------------------------------------------------------
*/
package edu.wpi.first.wpilibj.hal;
public class SWIGTYPE_p_CTR_Code {
private long swigCPtr;
public SWIGTYPE_p_CTR_Code(long cPtr, boolean futureUse) {
swigCPtr = cPtr;
}
public SWIGTYPE_p_CTR_Code() {
swigCPtr = 0;
}
public static long getCPtr(SWIGTYPE_p_CTR_Code obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
}

View File

@@ -1,27 +0,0 @@
/*
* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org). Version
* 2.0.11
*$
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* -----------------------------------------------------------------------------
*/
package edu.wpi.first.wpilibj.hal;
public class SWIGTYPE_p_UINT8 {
private long swigCPtr;
public SWIGTYPE_p_UINT8(long cPtr, boolean futureUse) {
swigCPtr = cPtr;
}
public SWIGTYPE_p_UINT8() {
swigCPtr = 0;
}
public static long getCPtr(SWIGTYPE_p_UINT8 obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
}

View File

@@ -1,27 +0,0 @@
/*
* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org). Version
* 2.0.11
*$
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* -----------------------------------------------------------------------------
*/
package edu.wpi.first.wpilibj.hal;
public class SWIGTYPE_p_double {
private long swigCPtr;
public SWIGTYPE_p_double(long cPtr, boolean futureUse) {
swigCPtr = cPtr;
}
public SWIGTYPE_p_double() {
swigCPtr = 0;
}
public static long getCPtr(SWIGTYPE_p_double obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
}

View File

@@ -1,27 +0,0 @@
/*
* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org). Version
* 2.0.11
*$
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* -----------------------------------------------------------------------------
*/
package edu.wpi.first.wpilibj.hal;
public class SWIGTYPE_p_float {
private long swigCPtr;
public SWIGTYPE_p_float(long cPtr, boolean futureUse) {
swigCPtr = cPtr;
}
public SWIGTYPE_p_float() {
swigCPtr = 0;
}
public static long getCPtr(SWIGTYPE_p_float obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
}

View File

@@ -1,27 +0,0 @@
/*
* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org). Version
* 2.0.11
*$
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* -----------------------------------------------------------------------------
*/
package edu.wpi.first.wpilibj.hal;
public class SWIGTYPE_p_int {
private long swigCPtr;
public SWIGTYPE_p_int(long cPtr, boolean futureUse) {
swigCPtr = cPtr;
}
public SWIGTYPE_p_int() {
swigCPtr = 0;
}
public static long getCPtr(SWIGTYPE_p_int obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
}

View File

@@ -1,27 +0,0 @@
/*
* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org). Version
* 2.0.11
*$
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* -----------------------------------------------------------------------------
*/
package edu.wpi.first.wpilibj.hal;
public class SWIGTYPE_p_int32_t {
private long swigCPtr;
public SWIGTYPE_p_int32_t(long cPtr, boolean futureUse) {
swigCPtr = cPtr;
}
public SWIGTYPE_p_int32_t() {
swigCPtr = 0;
}
public static long getCPtr(SWIGTYPE_p_int32_t obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
}

View File

@@ -1,27 +0,0 @@
/*
* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org). Version
* 2.0.11
*$
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* -----------------------------------------------------------------------------
*/
package edu.wpi.first.wpilibj.hal;
public class SWIGTYPE_p_uint32_t {
private long swigCPtr;
public SWIGTYPE_p_uint32_t(long cPtr, boolean futureUse) {
swigCPtr = cPtr;
}
public SWIGTYPE_p_uint32_t() {
swigCPtr = 0;
}
public static long getCPtr(SWIGTYPE_p_uint32_t obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
}

View File

@@ -1,27 +0,0 @@
/*
* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org). Version
* 2.0.11
*$
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* -----------------------------------------------------------------------------
*/
package edu.wpi.first.wpilibj.hal;
public class SWIGTYPE_p_uint8_t {
private long swigCPtr;
public SWIGTYPE_p_uint8_t(long cPtr, boolean futureUse) {
swigCPtr = cPtr;
}
public SWIGTYPE_p_uint8_t() {
swigCPtr = 0;
}
public static long getCPtr(SWIGTYPE_p_uint8_t obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
}

View File

@@ -1,556 +1,225 @@
/*
* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org). Version
* 2.0.11
*$
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* -----------------------------------------------------------------------------
*/
package edu.wpi.first.wpilibj.hal;
public class CanTalonJNI {
public final static native long new_doublep();
public final static native long copy_doublep(double jarg1);
public final static native void delete_doublep(long jarg1);
public final static native void doublep_assign(long jarg1, double jarg2);
public final static native double doublep_value(long jarg1);
public final static native long new_intp();
public final static native long copy_intp(int jarg1);
public final static native void delete_intp(long jarg1);
public final static native void intp_assign(long jarg1, int jarg2);
public final static native int intp_value(long jarg1);
public final static native long new_uint32_tp();
public final static native long copy_uint32_tp(long jarg1);
public final static native void delete_uint32_tp(long jarg1);
public final static native void uint32_tp_assign(long jarg1, long jarg2);
public final static native long uint32_tp_value(long jarg1);
public final static native long new_int32_tp();
public final static native long copy_int32_tp(long jarg1);
public final static native void delete_int32_tp(long jarg1);
public final static native void int32_tp_assign(long jarg1, long jarg2);
public final static native long int32_tp_value(long jarg1);
public final static native long new_uint8_tp();
public final static native long copy_uint8_tp(long jarg1);
public final static native void delete_uint8_tp(long jarg1);
public final static native void uint8_tp_assign(long jarg1, long jarg2);
public final static native long uint8_tp_value(long jarg1);
public final static native long new_CTR_Codep();
public final static native long copy_CTR_Codep(long jarg1);
public final static native void delete_CTR_Codep(long jarg1);
public final static native void CTR_Codep_assign(long jarg1, long jarg2);
public final static native long CTR_Codep_value(long jarg1);
public final static native long new_floatp();
public final static native long copy_floatp(float jarg1);
public final static native void delete_floatp(long jarg1);
public final static native void floatp_assign(long jarg1, float jarg2);
public final static native float floatp_value(long jarg1);
public final static native long new_CtreCanNode(long jarg1);
public final static native void delete_CtreCanNode(long jarg1);
public final static native long CtreCanNode_GetDeviceNumber(long jarg1, CtreCanNode jarg1_);
public final static native int CanTalonSRX_kDefaultControlPeriodMs_get();
public final static native long new_CanTalonSRX__SWIG_0(int jarg1, int jarg2);
public final static native long new_CanTalonSRX__SWIG_1(int jarg1);
public final static native long new_CanTalonSRX__SWIG_2();
public final static native void delete_CanTalonSRX(long jarg1);
public final static native void CanTalonSRX_Set(long jarg1, CanTalonSRX jarg1_, double jarg2);
public final static native int CanTalonSRX_kMode_DutyCycle_get();
public final static native int CanTalonSRX_kMode_PositionCloseLoop_get();
public final static native int CanTalonSRX_kMode_VelocityCloseLoop_get();
public final static native int CanTalonSRX_kMode_CurrentCloseLoop_get();
public final static native int CanTalonSRX_kMode_VoltCompen_get();
public final static native int CanTalonSRX_kMode_SlaveFollower_get();
public final static native int CanTalonSRX_kMode_NoDrive_get();
public final static native int CanTalonSRX_kLimitSwitchOverride_UseDefaultsFromFlash_get();
public final static native int CanTalonSRX_kLimitSwitchOverride_DisableFwd_DisableRev_get();
public final static native int CanTalonSRX_kLimitSwitchOverride_DisableFwd_EnableRev_get();
public final static native int CanTalonSRX_kLimitSwitchOverride_EnableFwd_DisableRev_get();
public final static native int CanTalonSRX_kLimitSwitchOverride_EnableFwd_EnableRev_get();
public final static native int CanTalonSRX_kBrakeOverride_UseDefaultsFromFlash_get();
public final static native int CanTalonSRX_kBrakeOverride_OverrideCoast_get();
public final static native int CanTalonSRX_kBrakeOverride_OverrideBrake_get();
public final static native int CanTalonSRX_kFeedbackDev_DigitalQuadEnc_get();
public final static native int CanTalonSRX_kFeedbackDev_AnalogPot_get();
public final static native int CanTalonSRX_kFeedbackDev_AnalogEncoder_get();
public final static native int CanTalonSRX_kFeedbackDev_CountEveryRisingEdge_get();
public final static native int CanTalonSRX_kFeedbackDev_CountEveryFallingEdge_get();
public final static native int CanTalonSRX_kFeedbackDev_PosIsPulseWidth_get();
public final static native int CanTalonSRX_kProfileSlotSelect_Slot0_get();
public final static native int CanTalonSRX_kProfileSlotSelect_Slot1_get();
public final static native int CanTalonSRX_kStatusFrame_General_get();
public final static native int CanTalonSRX_kStatusFrame_Feedback_get();
public final static native int CanTalonSRX_kStatusFrame_Encoder_get();
public final static native int CanTalonSRX_kStatusFrame_AnalogTempVbat_get();
public final static native int CanTalonSRX_kStatusFrame_PulseWidthMeas_get();
public final static native int CanTalonSRX_eProfileParamSlot0_P_get();
public final static native int CanTalonSRX_eProfileParamSlot0_I_get();
public final static native int CanTalonSRX_eProfileParamSlot0_D_get();
public final static native int CanTalonSRX_eProfileParamSlot0_F_get();
public final static native int CanTalonSRX_eProfileParamSlot0_IZone_get();
public final static native int CanTalonSRX_eProfileParamSlot0_CloseLoopRampRate_get();
public final static native int CanTalonSRX_eProfileParamSlot1_P_get();
public final static native int CanTalonSRX_eProfileParamSlot1_I_get();
public final static native int CanTalonSRX_eProfileParamSlot1_D_get();
public final static native int CanTalonSRX_eProfileParamSlot1_F_get();
public final static native int CanTalonSRX_eProfileParamSlot1_IZone_get();
public final static native int CanTalonSRX_eProfileParamSlot1_CloseLoopRampRate_get();
public final static native int CanTalonSRX_eProfileParamSoftLimitForThreshold_get();
public final static native int CanTalonSRX_eProfileParamSoftLimitRevThreshold_get();
public final static native int CanTalonSRX_eProfileParamSoftLimitForEnable_get();
public final static native int CanTalonSRX_eProfileParamSoftLimitRevEnable_get();
public final static native int CanTalonSRX_eOnBoot_BrakeMode_get();
public final static native int CanTalonSRX_eOnBoot_LimitSwitch_Forward_NormallyClosed_get();
public final static native int CanTalonSRX_eOnBoot_LimitSwitch_Reverse_NormallyClosed_get();
public final static native int CanTalonSRX_eOnBoot_LimitSwitch_Forward_Disable_get();
public final static native int CanTalonSRX_eOnBoot_LimitSwitch_Reverse_Disable_get();
public final static native int CanTalonSRX_eFault_OverTemp_get();
public final static native int CanTalonSRX_eFault_UnderVoltage_get();
public final static native int CanTalonSRX_eFault_ForLim_get();
public final static native int CanTalonSRX_eFault_RevLim_get();
public final static native int CanTalonSRX_eFault_HardwareFailure_get();
public final static native int CanTalonSRX_eFault_ForSoftLim_get();
public final static native int CanTalonSRX_eFault_RevSoftLim_get();
public final static native int CanTalonSRX_eStckyFault_OverTemp_get();
public final static native int CanTalonSRX_eStckyFault_UnderVoltage_get();
public final static native int CanTalonSRX_eStckyFault_ForLim_get();
public final static native int CanTalonSRX_eStckyFault_RevLim_get();
public final static native int CanTalonSRX_eStckyFault_ForSoftLim_get();
public final static native int CanTalonSRX_eStckyFault_RevSoftLim_get();
public final static native int CanTalonSRX_eAppliedThrottle_get();
public final static native int CanTalonSRX_eCloseLoopErr_get();
public final static native int CanTalonSRX_eFeedbackDeviceSelect_get();
public final static native int CanTalonSRX_eRevMotDuringCloseLoopEn_get();
public final static native int CanTalonSRX_eModeSelect_get();
public final static native int CanTalonSRX_eProfileSlotSelect_get();
public final static native int CanTalonSRX_eRampThrottle_get();
public final static native int CanTalonSRX_eRevFeedbackSensor_get();
public final static native int CanTalonSRX_eLimitSwitchEn_get();
public final static native int CanTalonSRX_eLimitSwitchClosedFor_get();
public final static native int CanTalonSRX_eLimitSwitchClosedRev_get();
public final static native int CanTalonSRX_eSensorPosition_get();
public final static native int CanTalonSRX_eSensorVelocity_get();
public final static native int CanTalonSRX_eCurrent_get();
public final static native int CanTalonSRX_eBrakeIsEnabled_get();
public final static native int CanTalonSRX_eEncPosition_get();
public final static native int CanTalonSRX_eEncVel_get();
public final static native int CanTalonSRX_eEncIndexRiseEvents_get();
public final static native int CanTalonSRX_eQuadApin_get();
public final static native int CanTalonSRX_eQuadBpin_get();
public final static native int CanTalonSRX_eQuadIdxpin_get();
public final static native int CanTalonSRX_eAnalogInWithOv_get();
public final static native int CanTalonSRX_eAnalogInVel_get();
public final static native int CanTalonSRX_eTemp_get();
public final static native int CanTalonSRX_eBatteryV_get();
public final static native int CanTalonSRX_eResetCount_get();
public final static native int CanTalonSRX_eResetFlags_get();
public final static native int CanTalonSRX_eFirmVers_get();
public final static native int CanTalonSRX_eSettingsChanged_get();
public final static native int CanTalonSRX_eQuadFilterEn_get();
public final static native int CanTalonSRX_ePidIaccum_get();
public final static native int CanTalonSRX_eStatus1FrameRate_get();
public final static native int CanTalonSRX_eStatus2FrameRate_get();
public final static native int CanTalonSRX_eStatus3FrameRate_get();
public final static native int CanTalonSRX_eStatus4FrameRate_get();
public final static native int CanTalonSRX_eStatus6FrameRate_get();
public final static native int CanTalonSRX_eStatus7FrameRate_get();
public final static native int CanTalonSRX_eClearPositionOnIdx_get();
public final static native int CanTalonSRX_ePeakPosOutput_get();
public final static native int CanTalonSRX_eNominalPosOutput_get();
public final static native int CanTalonSRX_ePeakNegOutput_get();
public final static native int CanTalonSRX_eNominalNegOutput_get();
public final static native int CanTalonSRX_eQuadIdxPolarity_get();
public final static native int CanTalonSRX_eStatus8FrameRate_get();
public final static native int CanTalonSRX_eAllowPosOverflow_get();
public final static native int CanTalonSRX_eProfileParamSlot0_AllowableClosedLoopErr_get();
public final static native int CanTalonSRX_eNumberPotTurns_get();
public final static native int CanTalonSRX_eNumberEncoderCPR_get();
public final static native int CanTalonSRX_ePwdPosition_get();
public final static native int CanTalonSRX_eAinPosition_get();
public final static native int CanTalonSRX_eProfileParamVcompRate_get();
public final static native int CanTalonSRX_eProfileParamSlot1_AllowableClosedLoopErr_get();
public final static native long CanTalonSRX_SetParam(long jarg1, CanTalonSRX jarg1_, int jarg2,
double jarg3);
public final static native long CanTalonSRX_RequestParam(long jarg1, CanTalonSRX jarg1_, int jarg2);
public final static native long CanTalonSRX_GetParamResponse(long jarg1, CanTalonSRX jarg1_,
int jarg2, long jarg3);
public final static native long CanTalonSRX_GetParamResponseInt32(long jarg1, CanTalonSRX jarg1_,
int jarg2, long jarg3);
public final static native long CanTalonSRX_SetPgain(long jarg1, CanTalonSRX jarg1_, long jarg2,
double jarg3);
public final static native long CanTalonSRX_SetIgain(long jarg1, CanTalonSRX jarg1_, long jarg2,
double jarg3);
public final static native long CanTalonSRX_SetDgain(long jarg1, CanTalonSRX jarg1_, long jarg2,
double jarg3);
public final static native long CanTalonSRX_SetFgain(long jarg1, CanTalonSRX jarg1_, long jarg2,
double jarg3);
public final static native long CanTalonSRX_SetIzone(long jarg1, CanTalonSRX jarg1_, long jarg2,
int jarg3);
public final static native long CanTalonSRX_SetCloseLoopRampRate(long jarg1, CanTalonSRX jarg1_,
long jarg2, int jarg3);
public final static native long CanTalonSRX_SetSensorPosition(long jarg1, CanTalonSRX jarg1_,
int jarg2);
public final static native long CanTalonSRX_SetForwardSoftLimit(long jarg1, CanTalonSRX jarg1_,
int jarg2);
public final static native long CanTalonSRX_SetReverseSoftLimit(long jarg1, CanTalonSRX jarg1_,
int jarg2);
public final static native long CanTalonSRX_SetForwardSoftEnable(long jarg1, CanTalonSRX jarg1_,
int jarg2);
public final static native long CanTalonSRX_SetReverseSoftEnable(long jarg1, CanTalonSRX jarg1_,
int jarg2);
public final static native long CanTalonSRX_GetPgain(long jarg1, CanTalonSRX jarg1_, long jarg2,
long jarg3);
public final static native long CanTalonSRX_GetIgain(long jarg1, CanTalonSRX jarg1_, long jarg2,
long jarg3);
public final static native long CanTalonSRX_GetDgain(long jarg1, CanTalonSRX jarg1_, long jarg2,
long jarg3);
public final static native long CanTalonSRX_GetFgain(long jarg1, CanTalonSRX jarg1_, long jarg2,
long jarg3);
public final static native long CanTalonSRX_GetIzone(long jarg1, CanTalonSRX jarg1_, long jarg2,
long jarg3);
public final static native long CanTalonSRX_GetCloseLoopRampRate(long jarg1, CanTalonSRX jarg1_,
long jarg2, long jarg3);
public final static native long CanTalonSRX_GetVoltageCompensationRate(long jarg1,
CanTalonSRX jarg1_, long jarg2);
public final static native long CanTalonSRX_GetForwardSoftLimit(long jarg1, CanTalonSRX jarg1_,
long jarg2);
public final static native long CanTalonSRX_GetReverseSoftLimit(long jarg1, CanTalonSRX jarg1_,
long jarg2);
public final static native long CanTalonSRX_GetForwardSoftEnable(long jarg1, CanTalonSRX jarg1_,
long jarg2);
public final static native long CanTalonSRX_GetReverseSoftEnable(long jarg1, CanTalonSRX jarg1_,
long jarg2);
public final static native long CanTalonSRX_SetStatusFrameRate(long jarg1, CanTalonSRX jarg1_,
long jarg2, long jarg3);
public final static native long CanTalonSRX_ClearStickyFaults(long jarg1, CanTalonSRX jarg1_);
public final static native long CanTalonSRX_GetFault_OverTemp(long jarg1, CanTalonSRX jarg1_,
long jarg2);
public final static native long CanTalonSRX_GetFault_UnderVoltage(long jarg1, CanTalonSRX jarg1_,
long jarg2);
public final static native long CanTalonSRX_GetFault_ForLim(long jarg1, CanTalonSRX jarg1_,
long jarg2);
public final static native long CanTalonSRX_GetFault_RevLim(long jarg1, CanTalonSRX jarg1_,
long jarg2);
public final static native long CanTalonSRX_GetFault_HardwareFailure(long jarg1,
CanTalonSRX jarg1_, long jarg2);
public final static native long CanTalonSRX_GetFault_ForSoftLim(long jarg1, CanTalonSRX jarg1_,
long jarg2);
public final static native long CanTalonSRX_GetFault_RevSoftLim(long jarg1, CanTalonSRX jarg1_,
long jarg2);
public final static native long CanTalonSRX_GetStckyFault_OverTemp(long jarg1,
CanTalonSRX jarg1_, long jarg2);
public final static native long CanTalonSRX_GetStckyFault_UnderVoltage(long jarg1,
CanTalonSRX jarg1_, long jarg2);
public final static native long CanTalonSRX_GetStckyFault_ForLim(long jarg1, CanTalonSRX jarg1_,
long jarg2);
public final static native long CanTalonSRX_GetStckyFault_RevLim(long jarg1, CanTalonSRX jarg1_,
long jarg2);
public final static native long CanTalonSRX_GetStckyFault_ForSoftLim(long jarg1,
CanTalonSRX jarg1_, long jarg2);
public final static native long CanTalonSRX_GetStckyFault_RevSoftLim(long jarg1,
CanTalonSRX jarg1_, long jarg2);
public final static native long CanTalonSRX_GetAppliedThrottle(long jarg1, CanTalonSRX jarg1_,
long jarg2);
public final static native long CanTalonSRX_GetCloseLoopErr(long jarg1, CanTalonSRX jarg1_,
long jarg2);
public final static native long CanTalonSRX_GetFeedbackDeviceSelect(long jarg1,
CanTalonSRX jarg1_, long jarg2);
public final static native long CanTalonSRX_GetModeSelect(long jarg1, CanTalonSRX jarg1_,
long jarg2);
public final static native long CanTalonSRX_GetLimitSwitchEn(long jarg1, CanTalonSRX jarg1_,
long jarg2);
public final static native long CanTalonSRX_GetLimitSwitchClosedFor(long jarg1,
CanTalonSRX jarg1_, long jarg2);
public final static native long CanTalonSRX_GetLimitSwitchClosedRev(long jarg1,
CanTalonSRX jarg1_, long jarg2);
public final static native long CanTalonSRX_GetSensorPosition(long jarg1, CanTalonSRX jarg1_,
long jarg2);
public final static native long CanTalonSRX_GetSensorVelocity(long jarg1, CanTalonSRX jarg1_,
long jarg2);
public final static native long CanTalonSRX_GetCurrent(long jarg1, CanTalonSRX jarg1_, long jarg2);
public final static native long CanTalonSRX_GetBrakeIsEnabled(long jarg1, CanTalonSRX jarg1_,
long jarg2);
public final static native long CanTalonSRX_GetEncPosition(long jarg1, CanTalonSRX jarg1_,
long jarg2);
public final static native long CanTalonSRX_GetEncVel(long jarg1, CanTalonSRX jarg1_, long jarg2);
public final static native long CanTalonSRX_GetEncIndexRiseEvents(long jarg1, CanTalonSRX jarg1_,
long jarg2);
public final static native long CanTalonSRX_GetQuadApin(long jarg1, CanTalonSRX jarg1_, long jarg2);
public final static native long CanTalonSRX_GetQuadBpin(long jarg1, CanTalonSRX jarg1_, long jarg2);
public final static native long CanTalonSRX_GetQuadIdxpin(long jarg1, CanTalonSRX jarg1_,
long jarg2);
public final static native long CanTalonSRX_GetAnalogInWithOv(long jarg1, CanTalonSRX jarg1_,
long jarg2);
public final static native long CanTalonSRX_GetAnalogInVel(long jarg1, CanTalonSRX jarg1_,
long jarg2);
public final static native long CanTalonSRX_GetTemp(long jarg1, CanTalonSRX jarg1_, long jarg2);
public final static native long CanTalonSRX_GetBatteryV(long jarg1, CanTalonSRX jarg1_, long jarg2);
public final static native long CanTalonSRX_GetResetCount(long jarg1, CanTalonSRX jarg1_,
long jarg2);
public final static native long CanTalonSRX_GetResetFlags(long jarg1, CanTalonSRX jarg1_,
long jarg2);
public final static native long CanTalonSRX_GetFirmVers(long jarg1, CanTalonSRX jarg1_, long jarg2);
public final static native long CanTalonSRX_SetDemand(long jarg1, CanTalonSRX jarg1_, int jarg2);
public final static native long CanTalonSRX_SetOverrideLimitSwitchEn(long jarg1,
CanTalonSRX jarg1_, int jarg2);
public final static native long CanTalonSRX_SetFeedbackDeviceSelect(long jarg1,
CanTalonSRX jarg1_, int jarg2);
public final static native long CanTalonSRX_SetRevMotDuringCloseLoopEn(long jarg1,
CanTalonSRX jarg1_, int jarg2);
public final static native long CanTalonSRX_SetOverrideBrakeType(long jarg1, CanTalonSRX jarg1_,
int jarg2);
public final static native long CanTalonSRX_SetModeSelect(long jarg1, CanTalonSRX jarg1_,
int jarg2);
public final static native long CanTalonSRX_SetProfileSlotSelect(long jarg1, CanTalonSRX jarg1_,
int jarg2);
public final static native long CanTalonSRX_SetRampThrottle(long jarg1, CanTalonSRX jarg1_,
int jarg2);
public final static native long CanTalonSRX_SetVoltageCompensationRate(long jarg1, CanTalonSRX jarg1_,
double jarg2);
public final static native long CanTalonSRX_SetRevFeedbackSensor(long jarg1, CanTalonSRX jarg1_,
int jarg2);
public final static native long CanTalonSRX_GetPulseWidthPosition(long jarg1, CanTalonSRX jarg1_, long jarg2);
public final static native long CanTalonSRX_GetPulseWidthVelocity(long jarg1, CanTalonSRX jarg1_, long jarg2);
public final static native long CanTalonSRX_GetPulseWidthRiseToFallUs(long jarg1, CanTalonSRX jarg1_, long jarg2);
public final static native long CanTalonSRX_GetPulseWidthRiseToRiseUs(long jarg1, CanTalonSRX jarg1_, long jarg2);
public final static native long CanTalonSRX_IsPulseWidthSensorPresent(long jarg1, CanTalonSRX jarg1_, long jarg2);
public final static native long CanTalonSRX_SWIGUpcast(long jarg1);
public class CanTalonJNI extends JNIWrapper {
// Motion Profile status bits
public static final int kMotionProfileFlag_ActTraj_IsValid = 0x1;
public static final int kMotionProfileFlag_HasUnderrun = 0x2;
public static final int kMotionProfileFlag_IsUnderrun = 0x4;
public static final int kMotionProfileFlag_ActTraj_IsLast = 0x8;
public static final int kMotionProfileFlag_ActTraj_VelOnly = 0x10;
/**
* Signal enumeration for generic signal access.
* Although every signal is enumerated, only use this for traffic that must be solicited.
* Use the auto generated getters/setters at bottom of this header as much as possible.
*/
public enum param_t {
eProfileParamSlot0_P(1),
eProfileParamSlot0_I(2),
eProfileParamSlot0_D(3),
eProfileParamSlot0_F(4),
eProfileParamSlot0_IZone(5),
eProfileParamSlot0_CloseLoopRampRate(6),
eProfileParamSlot1_P(11),
eProfileParamSlot1_I(12),
eProfileParamSlot1_D(13),
eProfileParamSlot1_F(14),
eProfileParamSlot1_IZone(15),
eProfileParamSlot1_CloseLoopRampRate(16),
eProfileParamSoftLimitForThreshold(21),
eProfileParamSoftLimitRevThreshold(22),
eProfileParamSoftLimitForEnable(23),
eProfileParamSoftLimitRevEnable(24),
eOnBoot_BrakeMode(31),
eOnBoot_LimitSwitch_Forward_NormallyClosed(32),
eOnBoot_LimitSwitch_Reverse_NormallyClosed(33),
eOnBoot_LimitSwitch_Forward_Disable(34),
eOnBoot_LimitSwitch_Reverse_Disable(35),
eFault_OverTemp(41),
eFault_UnderVoltage(42),
eFault_ForLim(43),
eFault_RevLim(44),
eFault_HardwareFailure(45),
eFault_ForSoftLim(46),
eFault_RevSoftLim(47),
eStckyFault_OverTemp(48),
eStckyFault_UnderVoltage(49),
eStckyFault_ForLim(50),
eStckyFault_RevLim(51),
eStckyFault_ForSoftLim(52),
eStckyFault_RevSoftLim(53),
eAppliedThrottle(61),
eCloseLoopErr(62),
eFeedbackDeviceSelect(63),
eRevMotDuringCloseLoopEn(64),
eModeSelect(65),
eProfileSlotSelect(66),
eRampThrottle(67),
eRevFeedbackSensor(68),
eLimitSwitchEn(69),
eLimitSwitchClosedFor(70),
eLimitSwitchClosedRev(71),
eSensorPosition(73),
eSensorVelocity(74),
eCurrent(75),
eBrakeIsEnabled(76),
eEncPosition(77),
eEncVel(78),
eEncIndexRiseEvents(79),
eQuadApin(80),
eQuadBpin(81),
eQuadIdxpin(82),
eAnalogInWithOv(83),
eAnalogInVel(84),
eTemp(85),
eBatteryV(86),
eResetCount(87),
eResetFlags(88),
eFirmVers(89),
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),
eStatus9FrameRate(118), // TALON_Status_9_MotProfBuffer_100ms_t
eMotionProfileHasUnderrunErr(119),
eReserved120(120),
eLegacyControlMode(121);
public final int value;
private param_t(int value) {
this.value = value;
}
}
public static native long new_CanTalonSRX(int deviceNumber, int controlPeriodMs, int enablePeriodMs);
public static native long new_CanTalonSRX(int deviceNumber, int controlPeriodMs);
public static native long new_CanTalonSRX(int deviceNumber);
public static native long new_CanTalonSRX();
public static native void delete_CanTalonSRX(long handle);
public static native void GetMotionProfileStatus(long handle, Object canTalon, Object motionProfileStatus);
public static native void Set(long handle, double value);
public static native void SetParam(long handle, int paramEnum, double value);
public static native void RequestParam(long handle, int paramEnum);
public static native double GetParamResponse(long handle, int paramEnum);
public static native int GetParamResponseInt32(long handle, int paramEnum);
public static native void SetPgain(long handle, int slotIdx, double gain);
public static native void SetIgain(long handle, int slotIdx, double gain);
public static native void SetDgain(long handle, int slotIdx, double gain);
public static native void SetFgain(long handle, int slotIdx, double gain);
public static native void SetIzone(long handle, int slotIdx, int zone);
public static native void SetCloseLoopRampRate(long handle, int slotIdx, int closeLoopRampRate);
public static native void SetVoltageCompensationRate(long handle, double voltagePerMs);
public static native void SetSensorPosition(long handle, int pos);
public static native void SetForwardSoftLimit(long handle, int forwardLimit);
public static native void SetReverseSoftLimit(long handle, int reverseLimit);
public static native void SetForwardSoftEnable(long handle, int enable);
public static native void SetReverseSoftEnable(long handle, int enable);
public static native double GetPgain(long handle, int slotIdx);
public static native double GetIgain(long handle, int slotIdx);
public static native double GetDgain(long handle, int slotIdx);
public static native double GetFgain(long handle, int slotIdx);
public static native int GetIzone(long handle, int slotIdx);
public static native int GetCloseLoopRampRate(long handle, int slotIdx);
public static native double GetVoltageCompensationRate(long handle);
public static native int GetForwardSoftLimit(long handle);
public static native int GetReverseSoftLimit(long handle);
public static native int GetForwardSoftEnable(long handle);
public static native int GetReverseSoftEnable(long handle);
public static native int GetPulseWidthRiseToFallUs(long handle);
public static native int IsPulseWidthSensorPresent(long handle);
public static native void SetModeSelect2(long handle, int modeSelect, int demand);
public static native void SetStatusFrameRate(long handle, int frameEnum, int periodMs);
public static native void ClearStickyFaults(long handle);
public static native void ChangeMotionControlFramePeriod(long handle, int periodMs);
public static native void ClearMotionProfileTrajectories(long handle);
public static native int GetMotionProfileTopLevelBufferCount(long handle);
public static native boolean IsMotionProfileTopLevelBufferFull(long handle);
public static native void PushMotionProfileTrajectory(long handle, int targPos, int targVel, int profileSlotSelect, int timeDurMs, int velOnly, int isLastPoint, int zeroPos);
public static native void ProcessMotionProfileBuffer(long handle);
public static native int GetFault_OverTemp(long handle);
public static native int GetFault_UnderVoltage(long handle);
public static native int GetFault_ForLim(long handle);
public static native int GetFault_RevLim(long handle);
public static native int GetFault_HardwareFailure(long handle);
public static native int GetFault_ForSoftLim(long handle);
public static native int GetFault_RevSoftLim(long handle);
public static native int GetStckyFault_OverTemp(long handle);
public static native int GetStckyFault_UnderVoltage(long handle);
public static native int GetStckyFault_ForLim(long handle);
public static native int GetStckyFault_RevLim(long handle);
public static native int GetStckyFault_ForSoftLim(long handle);
public static native int GetStckyFault_RevSoftLim(long handle);
public static native int GetAppliedThrottle(long handle);
public static native int GetCloseLoopErr(long handle);
public static native int GetFeedbackDeviceSelect(long handle);
public static native int GetModeSelect(long handle);
public static native int GetLimitSwitchEn(long handle);
public static native int GetLimitSwitchClosedFor(long handle);
public static native int GetLimitSwitchClosedRev(long handle);
public static native int GetSensorPosition(long handle);
public static native int GetSensorVelocity(long handle);
public static native double GetCurrent(long handle);
public static native int GetBrakeIsEnabled(long handle);
public static native int GetEncPosition(long handle);
public static native int GetEncVel(long handle);
public static native int GetEncIndexRiseEvents(long handle);
public static native int GetQuadApin(long handle);
public static native int GetQuadBpin(long handle);
public static native int GetQuadIdxpin(long handle);
public static native int GetAnalogInWithOv(long handle);
public static native int GetAnalogInVel(long handle);
public static native double GetTemp(long handle);
public static native double GetBatteryV(long handle);
public static native int GetResetCount(long handle);
public static native int GetResetFlags(long handle);
public static native int GetFirmVers(long handle);
public static native int GetPulseWidthPosition(long handle);
public static native int GetPulseWidthVelocity(long handle);
public static native int GetPulseWidthRiseToRiseUs(long handle);
public static native int GetActTraj_IsValid(long handle);
public static native int GetActTraj_ProfileSlotSelect(long handle);
public static native int GetActTraj_VelOnly(long handle);
public static native int GetActTraj_IsLast(long handle);
public static native int GetOutputType(long handle);
public static native int GetHasUnderrun(long handle);
public static native int GetIsUnderrun(long handle);
public static native int GetNextID(long handle);
public static native int GetBufferIsFull(long handle);
public static native int GetCount(long handle);
public static native int GetActTraj_Velocity(long handle);
public static native int GetActTraj_Position(long handle);
public static native void SetDemand(long handle, int param);
public static native void SetOverrideLimitSwitchEn(long handle, int param);
public static native void SetFeedbackDeviceSelect(long handle, int param);
public static native void SetRevMotDuringCloseLoopEn(long handle, int param);
public static native void SetOverrideBrakeType(long handle, int param);
public static native void SetModeSelect(long handle, int param);
public static native void SetProfileSlotSelect(long handle, int param);
public static native void SetRampThrottle(long handle, int param);
public static native void SetRevFeedbackSensor(long handle, int param);
}

View File

@@ -18,9 +18,7 @@ import org.junit.Test;
import edu.wpi.first.wpilibj.fixtures.SampleFixture;
import edu.wpi.first.wpilibj.test.AbstractComsSetup;
import edu.wpi.first.wpilibj.hal.CanTalonSRX;
import edu.wpi.first.wpilibj.hal.CanTalonJNI;
import edu.wpi.first.wpilibj.hal.SWIGTYPE_p_double;
/**
* Basic test (borrowed straight from SampleTest) for running the CAN TalonSRX.

View File

@@ -18,8 +18,7 @@ import org.junit.Test;
import edu.wpi.first.wpilibj.fixtures.SampleFixture;
import edu.wpi.first.wpilibj.test.AbstractComsSetup;
import edu.wpi.first.wpilibj.hal.CanTalonSRX;
import edu.wpi.first.wpilibj.hal.SWIGTYPE_p_UINT8;
import edu.wpi.first.wpilibj.CANTalon;
/**
* Sample test for a sample PID controller. This demonstrates the general
@@ -63,10 +62,10 @@ public class SampleTest extends AbstractComsSetup {
*/
@Test
public void test() {
CanTalonSRX cantalon = new CanTalonSRX();
cantalon.Set(0.5);
CANTalon cantalon = new CANTalon(0);
cantalon.set(0.5);
Timer.delay(0.5);
cantalon.Set(0.0);
cantalon.set(0.0);
assertTrue(true);
}