Trying to learn PROS and C++

Hello, I’m a senior looking to level up my programming game. I have used Robotmesh and Vexcode in the past, however I want to use a PID this year and PROS is the best for that. I was just wondering if there is any good resources/ videos /tips people have for starting to code from scratch in C++ and PROS itself (because both of the other languages are more for beginners). Any help would be greatly appreciated, because right now I am lost and don’t know where to really start learning.

This document goes super in-depth about coding a PID and all the logic behind it: https://georgegillard.com/resources/documents
In any case, just doing projects to learn syntax and functions is the way I learned C++ and PROS.

2 Likes

I’m going to be brutaly honest…
Based upon what’s available, your Go-To at the moment would be using LemLib.

However, you will realize that even with LemLib, even odometry configuration seems confusing and the path planning seems un-necessarily complex and could have been simplified a lot better using a list of lists/vectors.

Potentially in the future, I am working on making a lib of my own, planned to be available for VEXCode and PROS upon release that pretty much fixes a lot of the issues of lackluster libraries:

The library is not only intuitive for newcomers who use VEXCode or PROS, but also shows that VEXCode and PROS are ultimately similar in nature and are almost interchangable.

The only reason why I used VEXCode primarily is because PROS documentation is unnecessarily complex, however VEXCode doesn’t really have documentation. But one thing VEXCode has that made me choose it primarily was because VEXCode has @jpearman, a genuine godsend on this forum. And no amount of complex and scattered documentation PROS provides can even compare to the sage advice of jpearman. And honestly, I didn’t use PROS because any question on any server is just “RTM” to literally a very non-intuivive and unnecessarily complex documentation page.

I also found that PROS documentation has zero visual differentiation between a header and code.

This is what tripped me up when I was younger and made me walk away because I was extremely confused when I saw.

std::int32_t pros::Controller::get_analog ( pros::controller_analog_e_t channel )

Basically, what I’m saying is that PROS can be easy to understand but the documentation decides not to be. To put it bluntly, everyone can learn PROS if PROS actually focuses on making clear differentiations between headers and code, instead of merely fitting the two together as “C++” royally confusing newcomers. Sure, it is technically correct to be C++, however some codes are examples and others are meant to inform. And PROS doesn’t even try to explain the difference and assumes that anyone reading the documentation knows the difference between the two. Which, most people who are just enterting robotics simply don’t.

If you look at Okapilib, you will realize how dated its documentation is, alongside how un-intuitive it is for newcomers.

https://okapilib.github.io/OkapiLib/md_docs_tutorials_walkthrough_clawbot.html


When I was younger, I thought that this wasn’t actually code but was some explanation on how a constructor works due to the overuse of pointers and pointer functions (and I didn’t know they were pointers at the time due to a lack of C++ knowledge).

That is why LemLib is so popular, because people recognize how dated PROS and Okapilib’s documentation is. And, genuinely, even LemLib itself can still be scary for newcomers. So if you give me a little time, I plan to release my own lib with VEXCode and PROS support, and hopefully writing tutorials for even VEXCode and PROS usage to a degree simplified for newcomers. And my library can act as an introduction for those who are switching from VEXCode to PROS and vice versa.

4 Likes

Thank you so much! This is going to help me alot this upcoming year. I just have one more question, what is the between the regular vexcode and vexcode pro.

1 Like

Honestly primarily formatting.

for example in PROS:

void autonomous() {
  motor.move_voltage(12000);
  pros::delay(1000); // Move at max voltage for 1 second
  motor.move_voltage(0);
}

This is equivalent to VEXCode’s:

void autonomous(void)
{
  motor.spin(12.0, voltageUnits::volt);
  wait(1000, msec);
  motor.spin(0.0, voltageUnits::volt);
}

I use voltageunits because the motor spins faster with voltage and therefore is more powerful than traditional spin commands. You just need to get used to the fact that voltage is between [-12, 12].

1 Like

I believe they were asking for the difference between VEXCode and VEXCode Pro, nothing to do with PROS. Seems like you convinced them to run away from PROS for now.

I, I don’t really get what you are saying here. I agree with using voltage units, but your logic behind it doesn’t really make sense to me. Somewhere along the gymnastics of making the v5 motor run the rpm will be converted to some voltage value. The difference between the two is that voltage units will not use the motor’s built in PID controllers. At no load on the motor, you could see that 12V spins faster than a 200 rpm command (as the PID controller will try to keep the motor spinning at 200rpm, not max power). However, at load, I don’t think you will ever see this, as the PID controller will just set the voltage to maximum if it is not spinning fast enough…

The reason I use voltage instead of RPM when writing a PID controller is so that I don’t have 2 PID controllers overlapping, that is unnecessary and will probably cause issues.

Different apps so UI can be quite different in certain aspects. Main difference is that VEXcode Pro is C++, whereas VEXcode is Blocks/Python/C++. If you are wanting to code in C++, I would recommend VEXcode Pro.

However, you should be using VSCode as your editor regardless of what you choose between VEXCode and PROS. VEXCode Pro has been replaced by the VEX VSCode extension, and the old PROS editor was also replaced by our VSCode extension.

Hope this helps.

4 Likes

The difference is that they are 2 separate IDEs. The syntax and functions are the same with the main differences being vexcode Pro supports dark mode, support for multiple files and probably some other small differences. If you think the naming convention is confusing, blame vex.

@Connor , Vexcode Pro is not the same as PROS. Additionally, using voltage will not get you significantly more speed.

1 Like

PROS and Vexcode have to interact with the brain via the SDK, so their functionality can’t really be vastly different.

Its also worth noting that the documentation you’re referring to for PROS is the documentation for PROS 3, and not 4. The latest docs can be found here, and that Okapilib is no longer maintained or included in PROS mainline.

If you have issues with LemLib’s intuitiveness or documentation, feel free to submit an issue here, we’d love to hear your feedback, and are always looking for ways to make things easier for the user.

1 Like

12 posts were split to a new topic: [Split Thread] Differences between PROS and VEXCode and Respective Documentation