Class MotControllerJNI

java.lang.Object
com.ctre.phoenix.CTREJNIWrapper
com.ctre.phoenix.motorcontrol.can.MotControllerJNI

public class MotControllerJNI
extends CTREJNIWrapper
  • Constructor Details

  • Method Details

    • Create

      public static long Create​(int baseArbId)
    • Create2

      public static long Create2​(int deviceID, String model, String canbus)
    • JNI_destroy_MotController

      public static int JNI_destroy_MotController​(long handle)
    • GetDeviceNumber

      public static int GetDeviceNumber​(long handle)
      Returns the Device ID
      Parameters:
      handle - handle of device.
      Returns:
      Device number.
    • GetBaseID

      public static int GetBaseID​(long handle)
    • SetDemand

      public static void SetDemand​(long handle, int mode, int demand0, int demand1)
      Sets the demand (output) of the motor controller.
      Parameters:
      handle - handle of device.
      mode - Control Mode of the Motor Controller
      demand0 - Primary Demand value
      demand1 - Secondary Demand value
    • Set_4

      public static void Set_4​(long handle, int mode, double demand0, double demand1, int demand1Type)
      Sets the demand (output) of the motor controller.
    • SetNeutralMode

      public static void SetNeutralMode​(long handle, int neutralMode)
      Sets the mode of operation during neutral throttle output.
      Parameters:
      handle - handle of device.
      neutralMode - The desired mode of operation when the Controller output throttle is neutral (ie brake/coast)
    • SetSensorPhase

      public static void SetSensorPhase​(long handle, boolean PhaseSensor)
      Sets the phase of the sensor. Use when controller forward/reverse output doesn't correlate to appropriate forward/reverse reading of sensor.
      Parameters:
      handle - handle of device.
      PhaseSensor - Indicates whether to invert the phase of the sensor.
    • SetInverted

      public static void SetInverted​(long handle, boolean invert)
      Inverts the output of the motor controller. LEDs, sensor phase, and limit switches will also be inverted to match the new forward/reverse directions.
      Parameters:
      handle - handle of device.
      invert - Invert state to set.
    • SetInverted_2

      public static void SetInverted_2​(long handle, int invert)
      Inverts the output of the motor controller. LEDs, sensor phase, and limit switches will also be inverted to match the new forward/reverse directions.
      Parameters:
      handle - handle of device.
      invert - Invert state to set.
    • ConfigFactoryDefault

      public static int ConfigFactoryDefault​(long handle, int timeoutMs)
      Revert all configurations to factory default values. Use this before your individual config* calls to avoid having to config every single param. Alternatively you can use the configAllSettings routine.
      Parameters:
      handle - handle of device.
      timeoutMs - Timeout value in ms. Function will generate error if config is not successful within timeout.
      Returns:
      Error Code generated by function. 0 indicates no error.
    • ConfigOpenLoopRamp

      public static int ConfigOpenLoopRamp​(long handle, double secondsFromNeutralToFull, int timeoutMs)
      Configures the open-loop ramp rate of throttle output.
      Parameters:
      handle - handle of device.
      secondsFromNeutralToFull - Minimum desired time to go from neutral to full throttle. A value of '0' will disable the ramp.
      timeoutMs - Timeout value in ms. Function will generate error if config is not successful within timeout.
      Returns:
      Error Code generated by function. 0 indicates no error.
    • ConfigClosedLoopRamp

      public static int ConfigClosedLoopRamp​(long handle, double secondsFromNeutralToFull, int timeoutMs)
      Configures the closed-loop ramp rate of throttle output.
      Parameters:
      handle - handle of device.
      secondsFromNeutralToFull - Minimum desired time to go from neutral to full throttle. A value of '0' will disable the ramp.
      timeoutMs - Timeout value in ms. @see #ConfigOpenLoopRamp
      Returns:
      Error Code generated by function. 0 indicates no error.
    • ConfigPeakOutputForward

      public static int ConfigPeakOutputForward​(long handle, double percentOut, int timeoutMs)
      Configures the forward peak output percentage.
      Parameters:
      handle - handle of device.
      percentOut - Desired peak output percentage.
      timeoutMs - Timeout value in ms. @see #ConfigOpenLoopRamp
      Returns:
      Error Code generated by function. 0 indicates no error.
    • ConfigPeakOutputReverse

      public static int ConfigPeakOutputReverse​(long handle, double percentOut, int timeoutMs)
      Configures the reverse peak output percentage.
      Parameters:
      handle - handle of device.
      percentOut - Desired peak output percentage.
      timeoutMs - Timeout value in ms. @see #ConfigOpenLoopRamp
      Returns:
      Error Code generated by function. 0 indicates no error.
    • ConfigNominalOutputForward

      public static int ConfigNominalOutputForward​(long handle, double percentOut, int timeoutMs)
      Configures the forward nominal output percentage.
      Parameters:
      handle - handle of device.
      percentOut - Nominal (minimum) percent output.
      timeoutMs - Timeout value in ms. @see #ConfigOpenLoopRamp
      Returns:
      Error Code generated by function. 0 indicates no error.
    • ConfigNominalOutputReverse

      public static int ConfigNominalOutputReverse​(long handle, double percentOut, int timeoutMs)
      Configures the reverse nominal output percentage.
      Parameters:
      handle - handle of device.
      percentOut - Nominal (minimum) percent output.
      timeoutMs - Timeout value in ms. @see #ConfigOpenLoopRamp
      Returns:
      Error Code generated by function. 0 indicates no error.
    • ConfigNeutralDeadband

      public static int ConfigNeutralDeadband​(long handle, double percentDeadband, int timeoutMs)
      Configures the output deadband percentage.
      Parameters:
      handle - handle of device.
      percentDeadband - Desired deadband percentage. Minimum is 0.1%, Maximum is 25%.
      timeoutMs - Timeout value in ms. @see #ConfigOpenLoopRamp
      Returns:
      Error Code generated by function. 0 indicates no error.
    • ConfigVoltageCompSaturation

      public static int ConfigVoltageCompSaturation​(long handle, double voltage, int timeoutMs)
      Configures the Voltage Compensation saturation voltage.
      Parameters:
      handle - handle of device.
      voltage - TO-DO: Comment me!
      timeoutMs - Timeout value in ms. @see #ConfigOpenLoopRamp
      Returns:
      Error Code generated by function. 0 indicates no error.
    • ConfigVoltageMeasurementFilter

      public static int ConfigVoltageMeasurementFilter​(long handle, int filterWindowSamples, int timeoutMs)
      Configures the voltage measurement filter.
      Parameters:
      handle - handle of device.
      filterWindowSamples - Number of samples in the rolling average of voltage measurement.
      timeoutMs - Timeout value in ms. @see #ConfigOpenLoopRamp
      Returns:
      Error Code generated by function. 0 indicates no error.
    • EnableVoltageCompensation

      public static void EnableVoltageCompensation​(long handle, boolean enable)
      Enables voltage compensation. If enabled, voltage compensation works in all control modes. Be sure to configure the saturation voltage before enabling this.
      Parameters:
      handle - handle of device.
      enable - Enable state of voltage compensation.
    • GetInverted

      public static boolean GetInverted​(long handle)
      Gets the invert state of the motor controller.
      Parameters:
      handle - handle of device.
      Returns:
      The invert state.
    • GetBusVoltage

      public static double GetBusVoltage​(long handle)
      Gets the bus voltage seen by the motor controller.
      Parameters:
      handle - handle of device.
      Returns:
      The bus voltage value (in volts).
    • GetMotorOutputPercent

      public static double GetMotorOutputPercent​(long handle)
      Gets the output percentage of the motor controller.
      Parameters:
      handle - handle of device.
      Returns:
      Output of the motor controller (in percent).
    • GetOutputCurrent

      @Deprecated public static double GetOutputCurrent​(long handle)
      Deprecated.
      Use getStatorCurrent/getSupplyCurrent instead.
      Gets the output current of the motor controller. In the case of TalonSRX class, this routine returns supply current for legacy reasons. In order to get the "true" output current, call GetStatorCurrent(). In the case of TalonFX class, this routine returns the true output stator current.
      Parameters:
      handle - handle of device
      Returns:
      The output current (in amps).
    • GetSupplyCurrent

      public static double GetSupplyCurrent​(long handle)
      Gets the stator/output current of the motor controller.
      Parameters:
      handle - handle of device
      Returns:
      The stator/output current (in amps).
    • GetStatorCurrent

      public static double GetStatorCurrent​(long handle)
      Gets the stator/output current of the motor controller.
      Parameters:
      handle - handle of device
      Returns:
      The stator/output current (in amps).
    • GetTemperature

      public static double GetTemperature​(long handle)
      Gets the temperature of the motor controller.
      Parameters:
      handle - handle of device.
      Returns:
      The temperature of the motor controller (in 'C)
    • ConfigRemoteFeedbackFilter

      public static int ConfigRemoteFeedbackFilter​(long handle, int deviceID, int remoteSensorSource, int remoteOrdinal, int timeoutMs)
      Configures the remote feedback filter.
      Parameters:
      handle - handle of device.
      deviceID - ID of remote device.
      remoteSensorSource - Type of remote sensor.
      remoteOrdinal - Ordinal of remote source [0-1].
      timeoutMs - Timeout value in ms. @see #ConfigOpenLoopRamp
      Returns:
      Error Code generated by function. 0 indicates no error.
    • ConfigSelectedFeedbackSensor

      public static int ConfigSelectedFeedbackSensor​(long handle, int feedbackDevice, int pidIdx, int timeoutMs)
      Select the feedback device for the motor controller.
      Parameters:
      handle - handle of device.
      feedbackDevice - Feedback Device to select.
      pidIdx - Which closed loop to manipulate. 0 for primary, 1 for auxiliary
      timeoutMs - Timeout value in ms. @see #ConfigOpenLoopRamp
      Returns:
      Error Code generated by function. 0 indicates no error.
    • ConfigSensorTerm

      public static int ConfigSensorTerm​(long handle, int sensorTerm, int feedbackDevice, int timeoutMs)
    • GetSelectedSensorPosition

      public static int GetSelectedSensorPosition​(long handle, int pidIdx)
      Get the selected sensor position.
      Parameters:
      handle - handle of device.
      pidIdx - Which closed loop to manipulate. 0 for primary, 1 for auxiliary
      Returns:
      Position of selected sensor (in Raw Sensor Units).
    • GetSelectedSensorVelocity

      public static int GetSelectedSensorVelocity​(long handle, int pidIdx)
      Get the selected sensor velocity.
      Parameters:
      handle - handle of device.
      pidIdx - Which closed loop to manipulate. 0 for primary, 1 for auxiliary
      Returns:
      Velocity of selected sensor (in Raw Sensor Units per 100 ms).
    • SetSelectedSensorPosition

      public static int SetSelectedSensorPosition​(long handle, int sensorPos, int pidIdx, int timeoutMs)
      Sets the sensor position to the given value.
      Parameters:
      handle - handle of device.
      sensorPos - Position to set for the selected sensor (in Raw Sensor Units).
      pidIdx - Which closed loop to manipulate. 0 for primary, 1 for auxiliary
      timeoutMs - Timeout value in ms. @see #ConfigOpenLoopRamp
      Returns:
      Error Code generated by function. 0 indicates no error.
    • SetControlFramePeriod

      public static int SetControlFramePeriod​(long handle, int frame, int periodMs)
      Sets the period of the given control frame.
      Parameters:
      handle - handle of device.
      frame - Frame whose period is to be changed.
      periodMs - Period in ms for the given frame.
      Returns:
      Error Code generated by function. 0 indicates no error.
    • SetStatusFramePeriod

      public static int SetStatusFramePeriod​(long handle, int frame, int periodMs, int timeoutMs)
      Sets the period of the given status frame.
      Parameters:
      handle - handle of device.
      frame - Frame whose period is to be changed.
      periodMs - Period in ms for the given frame.
      timeoutMs - Timeout value in ms. @see #ConfigOpenLoopRamp
      Returns:
      Error Code generated by function. 0 indicates no error.
    • GetStatusFramePeriod

      public static int GetStatusFramePeriod​(long handle, int frame, int timeoutMs)
      Gets the period of the given status frame.
      Parameters:
      handle - handle of device.
      frame - Frame to get the period of.
      timeoutMs - Timeout value in ms. @see #ConfigOpenLoopRamp
      Returns:
      The period of the given status frame.
    • ConfigVelocityMeasurementPeriod

      public static int ConfigVelocityMeasurementPeriod​(long handle, int period, int timeoutMs)
      Sets the period over which velocity measurements are taken.
      Parameters:
      handle - handle of device.
      period - Desired period for the velocity measurement. @see com.ctre.phoenix.sensors.SensorVelocityMeasPeriod
      timeoutMs - Timeout value in ms. @see #ConfigOpenLoopRamp
      Returns:
      Error Code generated by function. 0 indicates no error.
    • ConfigVelocityMeasurementWindow

      public static int ConfigVelocityMeasurementWindow​(long handle, int windowSize, int timeoutMs)
      Sets the number of velocity samples used in the rolling average velocity measurement.
      Parameters:
      handle - handle of device.
      windowSize - Number of samples in the rolling average of velocity measurement.
      timeoutMs - Timeout value in ms. @see #ConfigOpenLoopRamp
      Returns:
      Error Code generated by function. 0 indicates no error.
    • ConfigForwardLimitSwitchSource

      public static int ConfigForwardLimitSwitchSource​(long handle, int type, int normalOpenOrClose, int deviceID, int timeoutMs)
      Configures the forward limit switch for a remote source.
      Parameters:
      handle - handle of device.
      type - Remote limit switch source. @see com.ctre.phoenix.motorcontrol.LimitSwitchSource
      normalOpenOrClose - Setting for normally open or normally closed.
      deviceID - Device ID of remote source.
      timeoutMs - Timeout value in ms. @see #ConfigOpenLoopRamp
      Returns:
      Error Code generated by function. 0 indicates no error.
    • ConfigReverseLimitSwitchSource

      public static int ConfigReverseLimitSwitchSource​(long handle, int type, int normalOpenOrClose, int deviceID, int timeoutMs)
      Configures the reverse limit switch for a remote source.
      Parameters:
      handle - handle of device.
      type - Remote limit switch source. @see com.ctre.phoenix.motorcontrol.LimitSwitchSource
      normalOpenOrClose - Setting for normally open or normally closed.
      deviceID - Device ID of remote source.
      timeoutMs - Timeout value in ms. @see #ConfigOpenLoopRamp
      Returns:
      Error Code generated by function. 0 indicates no error.
    • OverrideLimitSwitchesEnable

      public static void OverrideLimitSwitchesEnable​(long handle, boolean enable)
      Sets the enable state for limit switches.
      Parameters:
      handle - handle of device.
      enable - Enable state for limit switches.
    • ConfigForwardSoftLimitThreshold

      public static int ConfigForwardSoftLimitThreshold​(long handle, int forwardSensorLimit, int timeoutMs)
      Configures the forward soft limit.
      Parameters:
      handle - handle of device.
      forwardSensorLimit - Forward Sensor Position Limit (in Raw Sensor Units).
      timeoutMs - Timeout value in ms. @see #ConfigOpenLoopRamp
      Returns:
      Error Code generated by function. 0 indicates no error.
    • ConfigReverseSoftLimitThreshold

      public static int ConfigReverseSoftLimitThreshold​(long handle, int reverseSensorLimit, int timeoutMs)
      Configures the reverse soft limit.
      Parameters:
      handle - handle of device.
      reverseSensorLimit - Reverse Sensor Position Limit (in Raw Sensor Units).
      timeoutMs - Timeout value in ms. @see #ConfigOpenLoopRamp
      Returns:
      Error Code generated by function. 0 indicates no error.
    • ConfigForwardSoftLimitEnable

      public static int ConfigForwardSoftLimitEnable​(long handle, boolean enable, int timeoutMs)
    • ConfigReverseSoftLimitEnable

      public static int ConfigReverseSoftLimitEnable​(long handle, boolean enable, int timeoutMs)
    • OverrideSoftLimitsEnable

      public static void OverrideSoftLimitsEnable​(long handle, boolean enable)
      Sets the enable state for soft limit switches.
      Parameters:
      handle - handle of device.
      enable - Enable state for soft limit switches.
    • Config_kP

      public static int Config_kP​(long handle, int slotIdx, double value, int timeoutMs)
      Sets the 'P' constant in the given parameter slot. This is multiplied by closed loop error in sensor units. Note the closed loop output interprets a final value of 1023 as full output. So use a gain of '0.25' to get full output if err is 4096u (Mag Encoder 1 rotation)
      Parameters:
      handle - handle of device.
      slotIdx - Parameter slot for the constant.
      value - Value of the P constant.
      timeoutMs - Timeout value in ms. @see #ConfigOpenLoopRamp
      Returns:
      Error Code generated by function. 0 indicates no error.
    • Config_kI

      public static int Config_kI​(long handle, int slotIdx, double value, int timeoutMs)
      Sets the 'I' constant in the given parameter slot. This is multiplied by accumulated closed loop error in sensor units every PID Loop. Note the closed loop output interprets a final value of 1023 as full output. So use a gain of '0.00025' to get full output if err is 4096u for 1000 loops (accumulater holds 4,096,000), [which is equivalent to one CTRE mag encoder rotation for 1000 milliseconds].
      Parameters:
      handle - handle of device.
      slotIdx - Parameter slot for the constant.
      value - Value of the I constant.
      timeoutMs - Timeout value in ms. @see #ConfigOpenLoopRamp
      Returns:
      Error Code generated by function. 0 indicates no error.
    • Config_kD

      public static int Config_kD​(long handle, int slotIdx, double value, int timeoutMs)
      Sets the 'D' constant in the given parameter slot. This is multiplied by derivative error (sensor units per PID loop, typically 1ms). Note the closed loop output interprets a final value of 1023 as full output. So use a gain of '250' to get full output if derr is 4096u (Mag Encoder 1 rotation) per 1000 loops (typ 1 sec)
      Parameters:
      handle - handle of device.
      slotIdx - Parameter slot for the constant.
      value - Value of the D constant.
      timeoutMs - Timeout value in ms. @see #ConfigOpenLoopRamp
      Returns:
      Error Code generated by function. 0 indicates no error.
    • Config_kF

      public static int Config_kF​(long handle, int slotIdx, double value, int timeoutMs)
      Sets the 'F' constant in the given parameter slot. See documentation for calculation details. If using velocity, motion magic, or motion profile, use (1023 * duty-cycle / sensor-velocity-sensor-units-per-100ms).
      Parameters:
      handle - handle of device.
      slotIdx - Parameter slot for the constant.
      value - Value of the F constant.
      timeoutMs - Timeout value in ms. @see #ConfigOpenLoopRamp
      Returns:
      Error Code generated by function. 0 indicates no error.
    • Config_IntegralZone

      public static int Config_IntegralZone​(long handle, int slotIdx, double izone, int timeoutMs)
      Sets the Integral Zone constant in the given parameter slot.
      Parameters:
      handle - handle of device.
      slotIdx - Parameter slot for the constant.
      izone - Value of the Integral Zone constant.
      timeoutMs - Timeout value in ms. @see #ConfigOpenLoopRamp
      Returns:
      Error Code generated by function. 0 indicates no error.
    • ConfigAllowableClosedloopError

      public static int ConfigAllowableClosedloopError​(long handle, int slotIdx, int allowableClosedLoopError, int timeoutMs)
      Sets the allowable closed-loop error in the given parameter slot.
      Parameters:
      handle - handle of device.
      slotIdx - Parameter slot for the constant.
      allowableClosedLoopError - Value of the allowable closed-loop error in sensor units (or sensor units per 100ms for velocity).
      timeoutMs - Timeout value in ms. @see #ConfigOpenLoopRamp
      Returns:
      Error Code generated by function. 0 indicates no error.
    • ConfigMaxIntegralAccumulator

      public static int ConfigMaxIntegralAccumulator​(long handle, int slotIdx, double iaccum, int timeoutMs)
      Sets the maximum integral accumulator in the given parameter slot.
      Parameters:
      handle - handle of device.
      slotIdx - Parameter slot for the constant.
      iaccum - Value of the maximum integral accumulator.
      timeoutMs - Timeout value in ms. @see #ConfigOpenLoopRamp
      Returns:
      Error Code generated by function. 0 indicates no error.
    • SetIntegralAccumulator

      public static int SetIntegralAccumulator​(long handle, double iaccum, int pidIdx, int timeoutMs)
      Sets the integral accumulator.
      Parameters:
      handle - handle of device.
      iaccum - Value to set for the integral accumulator.
      timeoutMs - Timeout value in ms. @see #ConfigOpenLoopRamp
      pidIdx - Which closed loop to manipulate. 0 for primary, 1 for auxiliary secondary loop.
      Returns:
      Error Code generated by function. 0 indicates no error.
    • GetClosedLoopError

      public static int GetClosedLoopError​(long handle, int pidIdx)
      Gets the closed-loop error. The units depend on which control mode is in use. If closed-loop is seeking a target sensor position, closed-loop error is the difference between target and current sensor value (in sensor units. Example 4096 units per rotation for CTRE Mag Encoder). If closed-loop is seeking a target sensor velocity, closed-loop error is the difference between target and current sensor value (in sensor units per 100ms). If using motion profiling or Motion Magic, closed loop error is calculated against the current target, and not the "final" target at the end of the profile/movement. See Phoenix-Documentation information on units.
      Parameters:
      handle - handle of device.
      pidIdx - Which closed loop to manipulate. 0 for primary, 1 for auxiliary secondary loop.
      Returns:
      Closed-loop error value.
    • GetIntegralAccumulator

      public static double GetIntegralAccumulator​(long handle, int pidIdx)
      Gets the iaccum value.
      Parameters:
      handle - handle of device.
      pidIdx - Which closed loop to manipulate. 0 for primary, 1 for auxiliary secondary loop.
      Returns:
      Integral accumulator value.
    • GetErrorDerivative

      public static double GetErrorDerivative​(long handle, int pidIdx)
      Gets the derivative of the closed-loop error.
      Parameters:
      handle - handle of device.
      pidIdx - Which closed loop to manipulate. 0 for primary, 1 for auxiliary secondary loop.
      Returns:
      Error derivative value.
    • SelectProfileSlot

      public static void SelectProfileSlot​(long handle, int slotIdx, int pidIdx)
      Selects which profile slot to use for closed-loop control.
      Parameters:
      handle - handle of device.
      slotIdx - Profile slot to select.
      pidIdx - Which closed loop to manipulate. 0 for primary, 1 for auxiliary secondary loop.
    • GetActiveTrajectoryPosition

      public static int GetActiveTrajectoryPosition​(long handle)
    • GetActiveTrajectoryVelocity

      public static int GetActiveTrajectoryVelocity​(long handle)
    • GetActiveTrajectoryHeading

      public static double GetActiveTrajectoryHeading​(long handle)
    • GetActiveTrajectoryPosition3

      public static int GetActiveTrajectoryPosition3​(long handle, int pidIdx)
    • GetActiveTrajectoryVelocity3

      public static int GetActiveTrajectoryVelocity3​(long handle, int pidIdx)
    • GetActiveTrajectoryArbFeedFwd3

      public static double GetActiveTrajectoryArbFeedFwd3​(long handle, int pidIdx)
    • ConfigMotionCruiseVelocity

      public static int ConfigMotionCruiseVelocity​(long handle, int sensorUnitsPer100ms, int timeoutMs)
      Sets the Motion Magic Cruise Velocity.
      Parameters:
      handle - handle of device.
      sensorUnitsPer100ms - Motion Magic Cruise Velocity (in Raw Sensor Units per 100 ms).
      timeoutMs - Timeout value in ms. @see #ConfigOpenLoopRamp
      Returns:
      Error Code generated by function. 0 indicates no error.
    • ConfigMotionAcceleration

      public static int ConfigMotionAcceleration​(long handle, int sensorUnitsPer100msPerSec, int timeoutMs)
      Sets the Motion Magic Acceleration.
      Parameters:
      handle - handle of device.
      sensorUnitsPer100msPerSec - Motion Magic Acceleration (in Raw Sensor Units per 100 ms per second).
      timeoutMs - Timeout value in ms. @see #ConfigOpenLoopRamp
      Returns:
      Error Code generated by function. 0 indicates no error.
    • ConfigMotionSCurveStrength

      public static int ConfigMotionSCurveStrength​(long m_handle, int curveStrength, int timeoutMs)
    • ClearMotionProfileTrajectories

      public static int ClearMotionProfileTrajectories​(long handle)
    • GetMotionProfileTopLevelBufferCount

      public static int GetMotionProfileTopLevelBufferCount​(long handle)
    • PushMotionProfileTrajectory

      public static int PushMotionProfileTrajectory​(long handle, double position, double velocity, double headingDeg, int profileSlotSelect, boolean isLastPoint, boolean zeroPos)
    • PushMotionProfileTrajectory2

      public static int PushMotionProfileTrajectory2​(long handle, double position, double velocity, double headingDeg, int profileSlotSelect0, int profileSlotSelect1, boolean isLastPoint, boolean zeroPos, int durationMs)
    • PushMotionProfileTrajectory3

      public static int PushMotionProfileTrajectory3​(long handle, double position, double velocity, double arbFeedFwd, double auxiliaryPos, double auxiliaryVel, double auxiliaryArbFeedFwd, int profileSlotSelect0, int profileSlotSelect1, boolean isLastPoint, boolean zeroPos0, int timeDur, boolean useAuxPID)
    • StartMotionProfile

      public static int StartMotionProfile​(long handle, long streamHandle, int minBufferedPts, int controlMode)
    • IsMotionProfileTopLevelBufferFull

      public static boolean IsMotionProfileTopLevelBufferFull​(long handle)
    • IsMotionProfileFinished

      public static boolean IsMotionProfileFinished​(long handle)
    • ProcessMotionProfileBuffer

      public static int ProcessMotionProfileBuffer​(long handle)
    • GetMotionProfileStatus

      public static int GetMotionProfileStatus​(long handle, int[] toFill_9)
    • GetMotionProfileStatus2

      public static int GetMotionProfileStatus2​(long handle, int[] toFill_11)
    • ClearMotionProfileHasUnderrun

      public static int ClearMotionProfileHasUnderrun​(long handle, int timeoutMs)
    • ChangeMotionControlFramePeriod

      public static int ChangeMotionControlFramePeriod​(long handle, int periodMs)
    • ConfigMotionProfileTrajectoryPeriod

      public static int ConfigMotionProfileTrajectoryPeriod​(long handle, int periodMs, int timeoutMs)
    • ConfigMotionProfileTrajectoryInterpolationEnable

      public static int ConfigMotionProfileTrajectoryInterpolationEnable​(long handle, boolean enable, int timeoutMs)
    • ConfigFeedbackNotContinuous

      public static int ConfigFeedbackNotContinuous​(long handle, boolean feedbackNotContinuous, int timeoutMs)
    • ConfigRemoteSensorClosedLoopDisableNeutralOnLOS

      public static int ConfigRemoteSensorClosedLoopDisableNeutralOnLOS​(long handle, boolean remoteSensorClosedLoopDisableNeutralOnLOS, int timeoutMs)
    • ConfigClearPositionOnLimitF

      public static int ConfigClearPositionOnLimitF​(long handle, boolean clearPositionOnLimitF, int timeoutMs)
    • ConfigClearPositionOnLimitR

      public static int ConfigClearPositionOnLimitR​(long handle, boolean clearPositionOnLimitR, int timeoutMs)
    • ConfigClearPositionOnQuadIdx

      public static int ConfigClearPositionOnQuadIdx​(long handle, boolean clearPositionOnQuadIdx, int timeoutMs)
    • ConfigLimitSwitchDisableNeutralOnLOS

      public static int ConfigLimitSwitchDisableNeutralOnLOS​(long handle, boolean limitSwitchDisableNeutralOnLOS, int timeoutMs)
    • ConfigSoftLimitDisableNeutralOnLOS

      public static int ConfigSoftLimitDisableNeutralOnLOS​(long handle, boolean softLimitDisableNeutralOnLOS, int timeoutMs)
    • ConfigPulseWidthPeriod_EdgesPerRot

      public static int ConfigPulseWidthPeriod_EdgesPerRot​(long handle, int pulseWidthPeriod_EdgesPerRot, int timeoutMs)
    • ConfigPulseWidthPeriod_FilterWindowSz

      public static int ConfigPulseWidthPeriod_FilterWindowSz​(long handle, int pulseWidthPeriod_FilterWindowSz, int timeoutMs)
    • GetLastError

      public static int GetLastError​(long handle)
      Gets the last error generated by this object.
      Parameters:
      handle - handle of device.
      Returns:
      Last Error Code generated by a function.
    • GetFirmwareVersion

      public static int GetFirmwareVersion​(long handle)
      Gets the firmware version of the device.
      Parameters:
      handle - handle of device.
      Returns:
      Firmware version of device.
    • HasResetOccurred

      public static boolean HasResetOccurred​(long handle)
      Returns true if the device has reset.
      Parameters:
      handle - handle of device.
      Returns:
      Has a Device Reset Occurred?
    • ConfigSetCustomParam

      public static int ConfigSetCustomParam​(long handle, int newValue, int paramIndex, int timeoutMs)
      Sets the value of a custom parameter.
      Parameters:
      handle - handle of device.
      newValue - Value for custom parameter.
      paramIndex - Index of custom parameter.
      timeoutMs - Timeout value in ms. @see #ConfigOpenLoopRamp
      Returns:
      Error Code generated by function. 0 indicates no error.
    • ConfigGetCustomParam

      public static int ConfigGetCustomParam​(long handle, int paramIndex, int timoutMs)
      Gets the value of a custom parameter.
      Parameters:
      handle - handle of device.
      paramIndex - Index of custom parameter.
      timoutMs - Timeout value in ms. @see #ConfigOpenLoopRamp
      Returns:
      Value of the custom param.
    • ConfigSetParameter

      public static int ConfigSetParameter​(long handle, int param, double value, int subValue, int ordinal, int timeoutMs)
      Sets a parameter.
      Parameters:
      handle - handle of device.
      param - Parameter enumeration.
      value - Value of parameter.
      subValue - Subvalue for parameter. Maximum value of 255.
      ordinal - Ordinal of parameter.
      timeoutMs - Timeout value in ms. @see #ConfigOpenLoopRamp
      Returns:
      Error Code generated by function. 0 indicates no error.
    • ConfigGetParameter

      public static double ConfigGetParameter​(long handle, int param, int ordinal, int timeoutMs)
      Gets a parameter.
      Parameters:
      handle - handle of device.
      param - Parameter enumeration.
      ordinal - Ordinal of parameter.
      timeoutMs - Timeout value in ms. @see #ConfigOpenLoopRamp
      Returns:
      Value of parameter.
    • ConfigPeakCurrentLimit

      public static int ConfigPeakCurrentLimit​(long handle, int amps, int timeoutMs)
      Configures the peak current limit of the motor controller.
      Parameters:
      handle - handle of device.
      amps - Peak current limit (in amps).
      timeoutMs - Timeout value in ms. @see #ConfigOpenLoopRamp
      Returns:
      Error Code generated by function. 0 indicates no error.
    • ConfigPeakCurrentDuration

      public static int ConfigPeakCurrentDuration​(long handle, int milliseconds, int timeoutMs)
      Configures the maximum time allowed at peak current limit of the motor controller.
      Parameters:
      handle - handle of device.
      milliseconds - Maximum time allowed at peak current limit (in milliseconds).
      timeoutMs - Timeout value in ms. @see #ConfigOpenLoopRamp
      Returns:
      Error Code generated by function. 0 indicates no error.
    • ConfigContinuousCurrentLimit

      public static int ConfigContinuousCurrentLimit​(long handle, int amps, int timeoutMs)
      Configures the continuous current limit.
      Parameters:
      handle - handle of device.
      amps - Continuous Current Limit.
      timeoutMs - Timeout value in ms. @see #ConfigOpenLoopRamp
      Returns:
      Error Code generated by function. 0 indicates no error.
    • EnableCurrentLimit

      public static int EnableCurrentLimit​(long handle, boolean enable)
      Enables the current limit feature.
      Parameters:
      handle - handle of device.
      enable - Enable state of current limit.
    • GetAnalogIn

      public static int GetAnalogIn​(long handle)
    • SetAnalogPosition

      public static int SetAnalogPosition​(long handle, int newPosition, int timeoutMs)
    • GetAnalogInRaw

      public static int GetAnalogInRaw​(long handle)
    • GetAnalogInVel

      public static int GetAnalogInVel​(long handle)
    • GetQuadraturePosition

      public static int GetQuadraturePosition​(long handle)
    • SetQuadraturePosition

      public static int SetQuadraturePosition​(long handle, int newPosition, int timeoutMs)
    • GetQuadratureVelocity

      public static int GetQuadratureVelocity​(long handle)
    • GetPulseWidthPosition

      public static int GetPulseWidthPosition​(long handle)
    • SetPulseWidthPosition

      public static int SetPulseWidthPosition​(long handle, int newPosition, int timeoutMs)
    • GetPulseWidthVelocity

      public static int GetPulseWidthVelocity​(long handle)
    • GetPulseWidthRiseToFallUs

      public static int GetPulseWidthRiseToFallUs​(long handle)
    • GetPulseWidthRiseToRiseUs

      public static int GetPulseWidthRiseToRiseUs​(long handle)
    • GetPinStateQuadA

      public static int GetPinStateQuadA​(long handle)
    • GetPinStateQuadB

      public static int GetPinStateQuadB​(long handle)
    • GetPinStateQuadIdx

      public static int GetPinStateQuadIdx​(long handle)
    • IsFwdLimitSwitchClosed

      public static int IsFwdLimitSwitchClosed​(long handle)
    • IsRevLimitSwitchClosed

      public static int IsRevLimitSwitchClosed​(long handle)
    • GetFaults

      public static int GetFaults​(long handle)
    • GetStickyFaults

      public static int GetStickyFaults​(long handle)
    • ClearStickyFaults

      public static int ClearStickyFaults​(long handle, int timeoutMs)
    • SelectDemandType

      public static int SelectDemandType​(long handle, int enable)
    • SetMPEOutput

      public static int SetMPEOutput​(long handle, int mpeOutput)
    • EnableHeadingHold

      public static int EnableHeadingHold​(long handle, int enable)
    • GetClosedLoopTarget

      public static int GetClosedLoopTarget​(long handle, int pidIdx)
    • ConfigSelectedFeedbackCoefficient

      public static int ConfigSelectedFeedbackCoefficient​(long handle, double coefficient, int pidIdx, int timeoutMs)
    • ConfigClosedLoopPeakOutput

      public static int ConfigClosedLoopPeakOutput​(long handle, int slotIdx, double percentOut, int timeoutMs)
    • ConfigClosedLoopPeriod

      public static int ConfigClosedLoopPeriod​(long handle, int slotIdx, int loopTimeMs, int timeoutMs)
    • ConfigMotorCommutation

      public static int ConfigMotorCommutation​(long handle, int motorCommutation, int timeoutMs)
    • ConfigGetMotorCommutation

      public static int ConfigGetMotorCommutation​(long handle, int timeoutMs)
    • ConfigSupplyCurrentLimit

      public static int ConfigSupplyCurrentLimit​(long handle, double[] params, int timeoutMs)
    • ConfigStatorCurrentLimit

      public static int ConfigStatorCurrentLimit​(long handle, double[] params, int timeoutMs)
    • ConfigSupplyCurrentLimitEnable

      public static int ConfigSupplyCurrentLimitEnable​(long handle, boolean enable, int timeoutMs)
    • ConfigStatorCurrentLimitEnable

      public static int ConfigStatorCurrentLimitEnable​(long handle, boolean enable, int timeoutMs)
    • ConfigBrakeCurrentLimitEnable

      public static int ConfigBrakeCurrentLimitEnable​(long handle, boolean enable, int timeoutMs)
    • ConfigGetSupplyCurrentLimit

      public static int ConfigGetSupplyCurrentLimit​(long handle, double[] toFill, int timeoutMs)
    • ConfigGetStatorCurrentLimit

      public static int ConfigGetStatorCurrentLimit​(long handle, double[] toFill, int timeoutMs)
    • SetIntegratedSensorPosition

      public static int SetIntegratedSensorPosition​(long handle, double newPos, int timeoutMs)
    • SetIntegratedSensorPositionToAbsolute

      public static int SetIntegratedSensorPositionToAbsolute​(long handle, int timeoutMs)
    • GetIntegratedSensorPosition

      public static double GetIntegratedSensorPosition​(long handle)
    • GetIntegratedSensorAbsolutePosition

      public static double GetIntegratedSensorAbsolutePosition​(long handle)
    • GetIntegratedSensorVelocity

      public static double GetIntegratedSensorVelocity​(long handle)
    • ConfigIntegratedSensorAbsoluteRange

      public static int ConfigIntegratedSensorAbsoluteRange​(long handle, int absoluteSensorRange, int timeoutMs)
    • ConfigIntegratedSensorOffset

      public static int ConfigIntegratedSensorOffset​(long handle, double offsetDegrees, int timeoutMs)
    • ConfigIntegratedSensorInitializationStrategy

      public static int ConfigIntegratedSensorInitializationStrategy​(long handle, int initStrategy, int timeoutMs)