How to calculate roll, pitch and yaw?

What was the error?