Hello, I have a class for my robot and want to use it in my controller callback. How can I do that? I mean is it possible to pass other variables or objects into controller callback? I saw in another question that somebody suggested using mjdata.userdata but I don't know how to pass an object with it.
In general, passing C++ objects from/to shared libraries cannot be done directly. Instead you can convert a C++ object pointer to void*, copy it in mjData.userdata (keep in mind a pointer takes 8 bytes) and then in your callback convert void* back to a C++ object pointer.