What do the Swigtype classes do in the WPI, I have looked at the documentation

http://first.wpi.edu/FRC/roborio/release/docs/java/classes.html is where I looked for the documentation, googling wpilibj swigtype had one result.Anyone know what they do?

Did you try just searching “Swigtype”?

While I am not 100% sure, I believe Swigtype is referring to this:


Is there anything specific you are trying to do with them?

No I didn’t google that, and no I’m not trying to do anything with them, just saw the classes in the api and didn’t know what they did, and couldn’t find out anything about them.Thank you for this illuminating post.

In order to use certain HAL classes (written in C++) in the Java portion of WPILib, we create JNI bindings for those classes/functions. In the case of the new Talon SRX, we used swig to generate the JNI bindings for the CanTalonSRX class and then wrapped that with the CANTalon class. Those odd SWIGTYPE* classes are how swig handles c pointers in the JNI bindings. Teams should not need to use any of the swig-related classes; the CANTalon wrapper should implement all the necessary features.