compute_orientation function

Estimate the accelerometer orientation