PROS memory permission error 00000000

I am trying to use okapi but when I run my code on the brain there is a pop up that says, “memory permission error 00000000”. The error occurs when I try to use tank drive in okapi. This error does not occur when I comment out the line -

What causes this error and how can I fix it.

edit: it also occurs anytime I try to control the drive using okapi, except when doing autonomous.

That’s strange. Memory permission error (aka segfault) can be caused by a few things.

  1. Division by 0
  2. Accessing an array element out of bounds
  3. Using an invalid pointer
  4. Passing a wrong type to a function
  5. Any other run-time error the compiler does not catch

I might have an idea what is causing your error. If you look at the okapi documentation for tank
You can see that it accepts values in the range [-1, 1]. Likewise, if you look at the documentation for the okapi Controller getAnalog you can see it also outputs in the range of [-1, 1]. The reason okapi chose to use that range is because it represents a percentage instead of an arbitrary number.
However, in your code above, you are not using an okapi Controller, you are using a pros Controller. Looking at that documentation, you can see it outputs values from the range of [-127, 127], which is not compatible with okapi. The solution might be to switch to using an okapi Controller like this:


I am not convinced that is what is causing the segfault, but give it a try.
If that does not solve the issue, can you show us where you define and create your chassis and controller?


I tried that, but it did not correct the issue. I have switched to not using okapi because I was frustrated with it.

4 posts were split to a new topic: V5 Memory Permission Error