svanacker / cen-electronic

Cybernétique en Nord - Electronic sources
MIT License
5 stars 7 forks source link

Alpha/Theta => Left/Right transformation is not good #91

Closed svanacker closed 9 years ago

svanacker commented 9 years ago

In pid.c, we use the incorrect formula:

left = (theta + alpha) /2 right = (theta - alpha) /2

but the following is correct :

left = (theta + alpha) right = (theta - alpha)

because theta = (left + right) / 2 alpha = (left - right) / 2

=> theta + alpha = (left + right) / 2 + (left - right) / 2 = 2 left / 2 = left => theta + alpha = (left + right) / 2 - (left - right) / 2 = 2 right / 2 = right