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 class
HAL.SimPeriodicAfterCallback
static class
HAL.SimPeriodicBeforeCallback
-
Field Summary
Fields Modifier and Type Field Description static int
kMaxJoystickAxes
static int
kMaxJoystickPOVs
-
Method Summary
Modifier and Type Method Description static void
exitMain()
static AllianceStationID
getAllianceStation()
static boolean
getBrownedOut()
static void
getControlWord(ControlWord controlWord)
static short
getJoystickAxes(byte joystickNum, float[] axesArray)
static int
getJoystickAxisType(byte joystickNum, byte axis)
static int
getJoystickButtons(byte joystickNum, ByteBuffer count)
static int
getJoystickIsXbox(byte joystickNum)
static String
getJoystickName(byte joystickNum)
static short
getJoystickPOVs(byte joystickNum, short[] povsArray)
static int
getJoystickType(byte joystickNum)
static int
getMatchInfo(MatchInfoData info)
static double
getMatchTime()
static int
getPort(byte channel)
static int
getPortWithModule(byte module, byte channel)
static boolean
getSystemActive()
static boolean
hasMain()
static boolean
initialize(int timeout, int mode)
static boolean
isNewControlData()
static int
nativeGetControlWord()
static void
observeUserProgramAutonomous()
static void
observeUserProgramDisabled()
static void
observeUserProgramStarting()
static void
observeUserProgramTeleop()
static void
observeUserProgramTest()
static HAL.SimPeriodicAfterCallback
registerSimPeriodicAfterCallback(Runnable r)
Registers a callback to be run by IterativeRobotBase after the user's simulationPeriodic code.static HAL.SimPeriodicBeforeCallback
registerSimPeriodicBeforeCallback(Runnable r)
Registers a callback to be run by IterativeRobotBase prior to the user's simulationPeriodic code.static void
releaseDSMutex()
static void
report(int resource, int instanceNumber)
static void
report(int resource, int instanceNumber, int context)
static int
report(int resource, int instanceNumber, int context, String feature)
Report the usage of a resource of interest.static void
runMain()
static int
sendConsoleLine(String line)
static int
sendError(boolean isError, int errorCode, boolean isLVCode, String details, String location, String callStack, boolean printMsg)
static int
setJoystickOutputs(byte joystickNum, int outputs, short leftRumble, short rightRumble)
static void
shutdown()
static void
simPeriodicAfter()
Runs SimPeriodicAfter callbacks.static void
simPeriodicBefore()
Runs SimPeriodicBefore callbacks.static void
waitForDSData()
static boolean
waitForDSDataTimeout(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
-