We present a heterodyne grating interferometer based on a quasi-common-optical-path (QCOP) design for a two-degrees-of-freedom (DOF) straightness measurement. Two half-wave plates are utilized to rotate the polarizations of two orthogonally polarized beams. The grating movement can be calculated by measuring the phase difference variation in each axis. The experimental results demonstrate that our method has the ability to measure two-DOF straightness and still maintain high system stability. The proposed and demonstrated method, which relies on heterodyne interferometric phase measurement combined with the QCOP configuration, has the advantages of high measurement resolution, relatively straightforward operation, and high system stability.