Argh ... Discovered bug in C++ GoPiGo3 with 16 tick motors

When the serial_numbers.pkl file was introduced for 16 tick motors, I added the serial lookup to the C++ GoPiGo3 API (GoPiGo3.cpp and header file), and I tested that the TICKS_PER_REVOLUTION indeed got set to 16 for GoPiGo3 boards that were known to have shipped with the 16 tick motors (Dave was one).

I also created a “C++ Drive your GoPiGo3 with keyboard” example at that time.

My Pull Request for the changes was accepted Dec 2022.

With the new GoPiGo3 Install that changes the location of the gpg3_config.json and serial_numbers pkl file, I have been modifying the C++ GoPiGo3 API to find the files in the new $HOME location (were in /home/pi/Dexter).

I thought I was done with the update, until I noticed that ENCODER_TICKS_PER_DEGREE for Dave (16 tick motors) is 5.333 but the variable is of type integer. OOPS…

I decided to compare the Python Motor_Follow.py example and the C++ motors.cpp example, and discovered the encoder values in the C++ example are wrong going forward and totally off going backwards.