mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-25 01:41:43 +00:00
I tried to sync `mostrobotpy` with `allwpilib` and was getting a compilation error I had not seen before when it tried to do the stub generation (which `allwpilib` does not do). Luckily, I was able to debug it here by writing some unit tests (i.e., having Gemini convert the C++ tests into python) that failed in a similar way. The main problem was needing to write a custom constructor for the class and adding a `force_type_casters`. I used `ChassisSpeed` as my main example, but I did not copy all of the other custom code like overriding the index operator, `__repr__` operator, feet helpers, etc. I can gladly add those in. In the future, we should start enforce a policy that if you add a C++ or Java unit test, you also have to add a python test. That developer might have gotten more stuck on the minutia of how to fix it, but this problem would have at least been caught earlier before it landed.