nov 21 - motors, encoders and the attitude and heading reference system
Ok, I pulled together the motorshield, the motors, the encoders and got it to work with the libraries provided by pololu rather quickly.
To measure the speed the encoder generates the position and then every tenth of a second i checked how much progress we made and from this i caluclate the speed in an interrupt (using TimerThree libary as the TimerOne interferes with the PWM needed for the motors).
Then I added the PID control - I used the official pid library and after some trials i got a decent set of parameters - i will need to adjust once the wheels and the weight of the vehilce is on as this will chaneg the whole framework. Now I can ride at constant speed controlled by the encoders and also accelerate and decelarte to desried speeds without to much rocking.
Big challenge was how to connect the bno055 sensor for heading and attitude to my boards. It failed via i2c from bno055 to the 32u4 based board i have been using - all sorts of tricks did not help (pull-up resistors). I can still try to go down from default 400khz to 50khz to see if this helps.
It also failed via i2c from a nodemcu to the bno055. Actually it did work out of the box with the serial.print example. But then piping it through rosserial did not work for some reason. I adjusted baud rate but this did not help.
Next attempt could be via i2c to the pi but i have lots of reports where pi and i2c to bno055 are troublesome and i might want to wake up the whole system on movement intrrupt from the bno055 and this will not be possible via the pi.
I guess I will have to iterate a little on this or simply add an arduino nano or pro or mini to the mix to make it work.