> I have no idea how to import <hal/HAL.h>
DIrectly importing HAL.h should not be necessary in a FRC Robot Applicaiton. And (see below) a WPI Library-based Robot Application should not directly initialize the HAL.
When I run RobotBuilder, the code it generates does not look like the code you have displayed.
RobotBuilder should generate a main robot class that inherits from frc::TimedRobot, like this:
class Robot : public frc::TimedRobot {
Noe that the RobotBuilder-generated main robot class ~does~ have a main() in it, but it looks very different from what you are showing. Here it is:
#ifndef RUNNING_FRC_TESTS
int main(int argc, char** argv) {
return frc::StartRobot<Robot>();
}
#endif
Please note that during frc::StartRobot(), the HAL initialization occurs. This is why it is not necessary to initialize the HAL directly (e.g, by invoking HAL_Initialize()).
Can you please help us understand what you are attempting to do? The structure of the code you have attached is not typical.
Thanks,
- scott
Why is necessary? Your code has a call to HAL_Initialize(), this code should not be added here. The reason why is that the HAL is initialized by the Robot Framework.