Error using smartDrive on vex code v5 pro

On specifically newer versions vexCode v5 Pro Smart drives throw a memory error. However older versions do not. Why would this be? Is there any way to fix it?

Can you be a bit more specific about what you mean. Memory error on the V5 brain screen ? or a compile error ? can we see example code causing the issue ?

3 Likes

Any code with a defined smartDrive object throws the error, it is a run time memory error. The brain prints a the same memory location every time, and it happens only on version 2.0.5, on 2.0.4 smart drives still function like normal. If you comment out the smartDrive definition it won’t throw the memory error anymore, hence why I believe it is something wrong with the definition of the smartDrive method .Here is an image of the error:

For reference, I have only tested this on M1 Mac devices, so it might be something that is wrong with the Mac release specifically.

is vexos fully updated on that brain ? (latest is 1.1.2)
can you zip up and send me the project, I’ll take a look.

2 Likes

The brain is on the latest firmware. in what way would you like me to send you the code?

either attach the zipped folder to this topic, or send me a link to a github repo, or if you want to keep private, email me at james_pearman at innovationfirst dot com

2 Likes

ok, the issue is the order in which smartdrive and inertial sensor are defined.
The IMU needs to be constructed before the smartdrive, there was a change to the SDK at one point that made this necessary. define them in this order.

// defines the interial object, 
inertial IMU = inertial(PORT2);

//smart drive combines all the motors to one easy to control object
smartdrive SmrtDrive (chassisRight, chassisLeft, IMU, 12.56, 10.75, 10.25, distanceUnits::in, .6);

also, nothing to do with this issue, and won’t affect you with VEXcode V5 Pro 2.0.5 but may in the future, some of the motor APIs were deprecated (actually removed from the SDK) last year, see this FYI.

5 Likes