These are the first few lines of the initializeHardwareConfiguration() method in the RobotBase class of a version of the Java FRC libraries:
int rv = HAL.initialize(0); assert rv == 1; // Set some implementations so that the static methods work properly Timer.SetImplementation(new HardwareTimer()); HLUsageReporting.SetImplementation(new HardwareHLUsageReporting()); RobotState.SetImplementation(DriverStation.getInstance());
The lower lines should provide some context; I really like seeing the internals of what a robot program actually does.
I was under the impression that assert was only to be used in development, to check that an operation was done correctly. Does anyone know what HAL.initialize() returns or what the argument means? The HAL class doesn’t shed light on it because it’s a native method which accepts an int that is just called mode. My guess is rv is short for return value.