Apparatus for controlling the attitude of a moving machine