While experimenting with ROMI and the trajectory-following code on Github using Ramsete, I had an issue with the gyroscope calibration which cause the ROMI to do erratic behaviour after a couple of seconds, like spinning on itself or driving full speed in the wrong direction. I suspected first that I simply needed to recalibrate the gyro using the tool at http://10.0.0.2, but the gyro calibration, although coming out successful, did not solve the problem.
I then started checking the raw gyro angle values, using the robot simulator (top-left corner, under RomiGyro). When the robot was at rest, the X value was increasing steadily (drifting), at a rate of 1 degree per second. My gyro offsets from the calibration were X = -0.56, Y = -6.23 and Z = -3.938. Multiple re-calibration yielded similar offsets, all within 5% of those values.
I finally solved the problem by re-flashing the rPi SD card. The gyro offset values at first were all resetted to zero, but then, when I calibrated the gyro for the first time, I got X = 3.535, Y = -6.28 and Z = -3.883. Notice that the X offset changed drastically, by almost 4. The Y and Z offset were similar. Using these offsets, the trajectory following algorithm with Ramsete worked well, and the gyro drift in the X axis was much slower, similar to Y and Z.
I am curious if anyone had the same issue as me, and I was also wandering:
1 - Why the Romi gyro calibration yielded several times false results, and why I had to re-flash the SD card for things to go back to normal?
2 – Why a large gyro drift in the X axis makes the trajectory-following algorithm fail? One would assume that only the Z axis gyro reading and encoder values would be needed for computation.
It would be appreciated if someone who has answers to these questions could reply, and possibly fix the calibration issue in the next software release.