I am wondering, is there source code available for the Spark Max C++ API? My team ran into a bug where the motor controller built-in encoder reports 0 for one tick, seemingly randomly, and then returns back to the expected value the next tick. This breaks the PID Controller class, since that uses the value the built-in encoder reports. We were able to make a work-around function which reports the proper encoder value. In order to fix the PID Controller, we wanted to make a new class which inherits the PID Controller class and override the method which gets the encoder value with our fixed encoder value. Unfortunately, the source code for the Spark Max API is seemingly unavailable, as the C++ library is only distributed in compiled binaries. Is there any way to obtain the C++ API source code for the Spark Max?
This was fixed in that latest update of the C++ API. If you installed the API in “online” mode then you can just check for updates using VSCode and it will pull. If you installed it “offline” then you have to manually download the API again and install as listed on their site.
You can fix this error with the updated API by using SetCANTimeout(); We set it to 1000 ms and it works for us.,