I’ve been using Vex V5 pro for a while, as I like how fast and powerful C++ is. I am considering switching to PROS before worlds, as it offers more functionality for quite a few of the sensors. I was wondering if my current code would be compatible with PROS, or if I’d have to program it again.
er, no. what functionality are you looking for ?
(so VEXcode V5 Pro is on a slightly older version of the sdk than is current, if there’s something specific that we added, it’s probably in the SDK that the VEX VS Code extension uses which is more recent than V5 Pro)
It would not be compatible. However, if you switched to the vscode extension it is compatible.
PROS uses a different syntax compared to Vex V5 Pro, so you will have to rewrite a lot of your code. However, it’s still c++ so some will stay.
You can tare the inertial sensor, or manually set the value, for one.
Ok, thank you. I am planning to try the vscode extension soon, but I think it’s worth to rewrite my code.
Isn’t that what resetHeading does?
https://api.vexcode.cloud/v5/class/classvex_1_1inertial?member=classvex_1_1inertial_1a9b6024567a577369b52a186bf05bc6e5
Isn’t that what setHeading does?
https://api.vexcode.cloud/v5/class/classvex_1_1inertial?member=classvex_1_1inertial_1a96b9e7dd05b1d1c0ab4154da7607aa6b
yep, you can set/reset both heading and rotation.
Oh. I have looked at the API, as I needed those functions, and I didn’t find them. Thank you.
So just as a general answer, your vexcode codebase won’t be compatible with a PROS codebase. The two environments are pretty similar in terms of functionality (with vexcode slightly ahead when it comes to device control), but they aren’t compatible. Assuming you’re familiar with C++ and have learned the PROS API, it’s pretty easy to port projects between the two.
People generally prefer to use PROS for a few reasons:
- It’s open source, including all of the tooling which gives people finer control over their toolchain, and easy access to report bugs/feature requests on github.
- PROS supported VSCode before VEXcode did, which is a more familiar and extensive development enviornment for a lot of people.
- It uses a newer C++ version (C++23 vs C++11 on vexcode), which has some advantages for more advanced users.
- (this is the main one) Most user-created libraries are made for PROS. Specifically okapilib and ez-template. This doesn’t really mean that libraries can’t be made for vexcode (see: JAR-template), it’s just a natural outcome of the previous 3 reasons.
But if you’re looking into switching to PROS just for gained functionality, you’ll probably be disappointed. Both PROS and vexcode consume the same underlying APIs and neither is really capable doing things the other isn’t. In fact, VEXcode is often the first to get the new functionality when it comes out.