Package com.playingwithfusion.jni
Class CANVenomJNI
java.lang.Object
com.playingwithfusion.jni.CANVenomJNI
Wrapper class for CANVenom
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddMotionProfilePoint(long handle, double time, double speed, double position) static voidclearLatchedFaults(long handle) static voidclearMotionProfilePoints(long handle) static voidcompleteMotionProfilePath(long handle, double time, double position) static longcreate(int motorID) static voiddestroy(long handle) static voiddisable(long handle) static voidenable(long handle) static voidenableLimitSwitches(long handle, boolean fwdLimitSwitchEnabled, boolean revLimitSwitchEnabled) static voidexecutePath(long handle) static voidForce load the library.static doubleget(long handle) static intgetActiveControlMode(long handle) static intgetActiveFaults(long handle) static doublegetAuxVoltage(long handle) static doublegetB(long handle) static intgetBrakeCoastMode(long handle) static doublegetBusVoltage(long handle) static intgetControlMode(long handle) static intgetCurrentMotionProfilePoint(long handle) static doublegetDutyCycle(long handle) static longgetFirmwareVersion(long handle) static booleangetFwdLimitSwitchActive(long handle) static booleangetInverted(long handle) static doublegetKD(long handle) static doublegetKF(long handle) static doublegetKI(long handle) static doublegetKP(long handle) static intgetLatchedFaults(long handle) static doublegetMaxAcceleration(long handle) static doublegetMaxJerk(long handle) static doublegetMaxPILimit(long handle) static doublegetMaxSpeed(long handle) static doublegetMinPILimit(long handle) static booleangetMotionProfileIsValid(long handle) static doublegetMotionProfilePositionTarget(long handle) static doublegetMotionProfileSpeedTarget(long handle) static intgetMotionProfileState(long handle) static intgetNumAvaliableMotionProfilePoints(long handle) static doublegetOutputCurrent(long handle) static doublegetOutputVoltage(long handle) static doublegetPIDTarget(long handle) static doublegetPosition(long handle) static booleangetRevLimitSwitchActive(long handle) static longgetSerialNumber(long handle) static doublegetSpeed(long handle) static doublegetTemperature(long handle) static voididentifyMotor(long handle) static voidpidWrite(long handle, double command) static voidresetPosition(long handle) static voidset(long handle, double command) static voidsetB(long handle, double b) static voidsetBrakeCoastMode(long handle, int brakeCoastMode) static voidsetCommand(long handle, int mode, double command, double kF, double b) static voidsetCommandAndMode(long handle, int mode, double command) static voidsetControlMode(long handle, int controlMode) static voidsetInverted(long handle, boolean isInverted) static voidsetKD(long handle, double kD) static voidsetKF(long handle, double kF) static voidsetKI(long handle, double kI) static voidsetKP(long handle, double kP) static voidsetMaxAcceleration(long handle, double limit) static voidsetMaxJerk(long handle, double limit) static voidsetMaxPILimit(long handle, double limit) static voidsetMaxSpeed(long handle, double limit) static voidsetMinPILimit(long handle, double limit) static voidsetPID(long handle, double kP, double kI, double kD, double kF, double b) static voidsetPosition(long handle, double newPosition) static voidstopMotor(long handle)
-
Constructor Details
-
CANVenomJNI
public CANVenomJNI()
-
-
Method Details
-
forceLoad
Force load the library.- Throws:
IOException- Unable to load libPlayingWithFusionDriver.so
-
create
public static long create(int motorID) -
destroy
public static void destroy(long handle) -
identifyMotor
public static void identifyMotor(long handle) -
resetPosition
public static void resetPosition(long handle) -
setPosition
public static void setPosition(long handle, double newPosition) -
stopMotor
public static void stopMotor(long handle) -
getFirmwareVersion
public static long getFirmwareVersion(long handle) -
getSerialNumber
public static long getSerialNumber(long handle) -
set
public static void set(long handle, double command) -
pidWrite
public static void pidWrite(long handle, double command) -
setInverted
public static void setInverted(long handle, boolean isInverted) -
get
public static double get(long handle) -
getInverted
public static boolean getInverted(long handle) -
disable
public static void disable(long handle) -
enable
public static void enable(long handle) -
getFwdLimitSwitchActive
public static boolean getFwdLimitSwitchActive(long handle) -
getRevLimitSwitchActive
public static boolean getRevLimitSwitchActive(long handle) -
enableLimitSwitches
public static void enableLimitSwitches(long handle, boolean fwdLimitSwitchEnabled, boolean revLimitSwitchEnabled) -
getNumAvaliableMotionProfilePoints
public static int getNumAvaliableMotionProfilePoints(long handle) -
getCurrentMotionProfilePoint
public static int getCurrentMotionProfilePoint(long handle) -
getMotionProfilePositionTarget
public static double getMotionProfilePositionTarget(long handle) -
getMotionProfileSpeedTarget
public static double getMotionProfileSpeedTarget(long handle) -
getMotionProfileIsValid
public static boolean getMotionProfileIsValid(long handle) -
getMotionProfileState
public static int getMotionProfileState(long handle) -
clearMotionProfilePoints
public static void clearMotionProfilePoints(long handle) -
addMotionProfilePoint
public static void addMotionProfilePoint(long handle, double time, double speed, double position) -
completeMotionProfilePath
public static void completeMotionProfilePath(long handle, double time, double position) -
executePath
public static void executePath(long handle) -
getBusVoltage
public static double getBusVoltage(long handle) -
getOutputVoltage
public static double getOutputVoltage(long handle) -
getDutyCycle
public static double getDutyCycle(long handle) -
getOutputCurrent
public static double getOutputCurrent(long handle) -
getTemperature
public static double getTemperature(long handle) -
getAuxVoltage
public static double getAuxVoltage(long handle) -
getSpeed
public static double getSpeed(long handle) -
getPosition
public static double getPosition(long handle) -
getPIDTarget
public static double getPIDTarget(long handle) -
getKF
public static double getKF(long handle) -
getB
public static double getB(long handle) -
getKP
public static double getKP(long handle) -
getKI
public static double getKI(long handle) -
getKD
public static double getKD(long handle) -
getMinPILimit
public static double getMinPILimit(long handle) -
getMaxPILimit
public static double getMaxPILimit(long handle) -
getMaxSpeed
public static double getMaxSpeed(long handle) -
getMaxAcceleration
public static double getMaxAcceleration(long handle) -
getMaxJerk
public static double getMaxJerk(long handle) -
getControlMode
public static int getControlMode(long handle) -
getActiveControlMode
public static int getActiveControlMode(long handle) -
getBrakeCoastMode
public static int getBrakeCoastMode(long handle) -
getActiveFaults
public static int getActiveFaults(long handle) -
getLatchedFaults
public static int getLatchedFaults(long handle) -
clearLatchedFaults
public static void clearLatchedFaults(long handle) -
setCommandAndMode
public static void setCommandAndMode(long handle, int mode, double command) -
setCommand
public static void setCommand(long handle, int mode, double command, double kF, double b) -
setPID
public static void setPID(long handle, double kP, double kI, double kD, double kF, double b) -
setKF
public static void setKF(long handle, double kF) -
setB
public static void setB(long handle, double b) -
setKP
public static void setKP(long handle, double kP) -
setKI
public static void setKI(long handle, double kI) -
setKD
public static void setKD(long handle, double kD) -
setMinPILimit
public static void setMinPILimit(long handle, double limit) -
setMaxPILimit
public static void setMaxPILimit(long handle, double limit) -
setMaxSpeed
public static void setMaxSpeed(long handle, double limit) -
setMaxAcceleration
public static void setMaxAcceleration(long handle, double limit) -
setMaxJerk
public static void setMaxJerk(long handle, double limit) -
setControlMode
public static void setControlMode(long handle, int controlMode) -
setBrakeCoastMode
public static void setBrakeCoastMode(long handle, int brakeCoastMode)
-