Package edu.wpi.first.hal
Class HAL
java.lang.Object
edu.wpi.first.hal.JNIWrapper
edu.wpi.first.hal.HAL
public final class HAL extends JNIWrapper
JNI Wrapper for HAL
.
.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHAL.SimPeriodicAfterCallbackstatic classHAL.SimPeriodicBeforeCallback -
Field Summary
Fields Modifier and Type Field Description static intkMaxJoystickAxesstatic intkMaxJoystickPOVs -
Method Summary
Modifier and Type Method Description static voidexitMain()static AllianceStationIDgetAllianceStation()static booleangetBrownedOut()static voidgetControlWord(ControlWord controlWord)static shortgetJoystickAxes(byte joystickNum, float[] axesArray)static intgetJoystickAxisType(byte joystickNum, byte axis)static intgetJoystickButtons(byte joystickNum, ByteBuffer count)static intgetJoystickIsXbox(byte joystickNum)static StringgetJoystickName(byte joystickNum)static shortgetJoystickPOVs(byte joystickNum, short[] povsArray)static intgetJoystickType(byte joystickNum)static intgetMatchInfo(MatchInfoData info)static doublegetMatchTime()static intgetPort(byte channel)static intgetPortWithModule(byte module, byte channel)static booleangetSystemActive()static booleanhasMain()static booleaninitialize(int timeout, int mode)static booleanisNewControlData()static intnativeGetControlWord()static voidobserveUserProgramAutonomous()static voidobserveUserProgramDisabled()static voidobserveUserProgramStarting()static voidobserveUserProgramTeleop()static voidobserveUserProgramTest()static HAL.SimPeriodicAfterCallbackregisterSimPeriodicAfterCallback(Runnable r)Registers a callback to be run by IterativeRobotBase after the user's simulationPeriodic code.static HAL.SimPeriodicBeforeCallbackregisterSimPeriodicBeforeCallback(Runnable r)Registers a callback to be run by IterativeRobotBase prior to the user's simulationPeriodic code.static voidreleaseDSMutex()static voidreport(int resource, int instanceNumber)static voidreport(int resource, int instanceNumber, int context)static intreport(int resource, int instanceNumber, int context, String feature)Report the usage of a resource of interest.static voidrunMain()static intsendConsoleLine(String line)static intsendError(boolean isError, int errorCode, boolean isLVCode, String details, String location, String callStack, boolean printMsg)static intsetJoystickOutputs(byte joystickNum, int outputs, short leftRumble, short rightRumble)static voidshutdown()static voidsimPeriodicAfter()Runs SimPeriodicAfter callbacks.static voidsimPeriodicBefore()Runs SimPeriodicBefore callbacks.static voidwaitForDSData()static booleanwaitForDSDataTimeout(double timeout)
-
Field Details
-
kMaxJoystickAxes
- See Also:
- Constant Field Values
-
kMaxJoystickPOVs
- See Also:
- Constant Field Values
-
-
Method Details
-
waitForDSData
-
initialize
-
shutdown
-
hasMain
-
runMain
-
exitMain
-
registerSimPeriodicBeforeCallback
Registers a callback to be run by IterativeRobotBase prior to the user's simulationPeriodic code.- Parameters:
r- runnable- Returns:
- Callback object (must be retained for callback to stay active).
-
simPeriodicBefore
Runs SimPeriodicBefore callbacks. IterativeRobotBase calls this prior to the user's simulationPeriodic code. -
registerSimPeriodicAfterCallback
Registers a callback to be run by IterativeRobotBase after the user's simulationPeriodic code.- Parameters:
r- runnable- Returns:
- Callback object (must be retained for callback to stay active).
-
simPeriodicAfter
Runs SimPeriodicAfter callbacks. IterativeRobotBase calls this after the user's simulationPeriodic code. -
observeUserProgramStarting
-
observeUserProgramDisabled
-
observeUserProgramAutonomous
-
observeUserProgramTeleop
-
observeUserProgramTest
-
report
-
report
-
report
Report the usage of a resource of interest.Original signature:
uint32_t report(tResourceType, uint8_t, uint8_t, const char*)- Parameters:
resource- one of the values in the tResourceType above (max value 51).instanceNumber- an index that identifies the resource instance.context- an optional additional context number for some cases (such as module number). Set to 0 to omit.feature- a string to be included describing features in use on a specific resource. Setting the same resource more than once allows you to change the feature string.- Returns:
- TODO
-
nativeGetControlWord
-
getControlWord
-
getAllianceStation
-
isNewControlData
-
releaseDSMutex
-
waitForDSDataTimeout
-
getJoystickAxes
-
getJoystickPOVs
-
getJoystickButtons
-
setJoystickOutputs
public static int setJoystickOutputs(byte joystickNum, int outputs, short leftRumble, short rightRumble) -
getJoystickIsXbox
-
getJoystickType
-
getJoystickName
-
getJoystickAxisType
-
getMatchTime
-
getSystemActive
-
getBrownedOut
-
getMatchInfo
-
sendError
-
sendConsoleLine
-
getPortWithModule
-
getPort
-