Pros int main()

I just recently started trying to use PROS for V5. For the life of me I cannot find the main function in the file system. I found the main.h header file but int main(). Is this function user accessible?

no, not at the moment. why do you need it?

1 Like

To clarify pros projects include a competition template by default. If you want a function that runs when the program starts I would suggest putting any code in opcontrol.

Mostly curiosity. In robotC I modified task main to manage things like autonomous selection but the same functionality can be achieved without doing that. I just wanted to make sure I wasn’t missing it somewhere. It’s sometimes nice to be able to see exactly what code the robot is executing.

The ROBOTC competition template didn’t have a main function either.

Probably worth looking at the documentation here

└───src                 (source files should go here)
│   │   autonomous.cpp  (source for autonomous function)
│   │   initialize.cpp  (source for initialization)
│   │   opcontrol.cpp   (source for operator control)

Sounds like you are trying to put code in initialize. Called preAuton in ROBOTC.

It did have task main in the competition includes though that managed starting the usercontrol and autonomous tasks.

I have looked through the pros documentation. I know that everything I want to do can be accomplished without modifying the main function but I was hoping that I would be able to see the code that is running in the background as well.

So historically PROS has been the only programming option to make any attempt at open source software. Check out the github organization

Anyone can help contribute. All of the code that runs on the cortex for PROS is public here

The atom plugin, Command Line Interface and documentation are all Open Source as well. The only part that isn’t Open Source currently is the PROS V5 kernel and that is planned to be made open source in the near future.

In the process of looking at the docs to help you I noticed a mistake and made a suggestion to fix it.

We’re keeping the kernel source under wraps for now while we make sure that everything is as stable as possible. The current plan is to open it up sometime this winter, and you will be able to inspect it at your leisure then.


Hahaha. I apologize.

Open source is even in the thread name.