The GPS carrier phase measurements are used to determine the attitude of a vehicle. A technique based on the attitude cost function is proposed for attitude determination assuming that the cycle integer ambiguities are known. The method that minimizes the cost function is discussed. To verify the method proposed, the experiments have been conducted, and the testing results are given in this paper.