Quote:
|
This makes no sense to me. Where is the main() function that would presumably instantiate the robot class? Also, what is this START_ROBOT_CLASS doing exactly?
|
I can try to explain this, to the best of my knowledge. Here's how it works as far as I can tell:
The program's entry point is
FRC_UserProgram_StartupLibraryInit. This is what the LabVIEW Run-Time calls when it loads the user program.
The
START_ROBOT_CLASS macro sets up a "user class factory", which is a function that returns a pointer new instance of your robot class. Additionally, it creates the entry point function,
FRC_UserProgram_StartupLibraryInit.
This entry point calls
RobotBase::startRobotTask() with a pointer to the "factory" function. From here, a new task is spawned to run the user program. This task creates an instance of your Robot class and calls its
StartCompetition() function. I'm not sure I quite understand the reason behind spawning off this new task, but I believe it somehow makes it easier to debug.
Quote:
|
The next major macro confusion is with the "wpi_assert"s and "wpi_fatal"s that are sprinkled across the code.
|
The code for these functions is in Utility.cpp. It seems like they handle some output to stdout, breaking, and stack tracing. I'm pretty curious about these too. I haven't really played around with it yet so I'll leave it up to someone more knowledgeable than myself to explain.