Common compass sensors used in outdoor environments are highly disturbed by unpredictable magnetic fields. This paper proposes to get inspiration from the insect navigational strategies to design a celestial compass based on the linear polarization of ultraviolet (UV) skylight. This bio-inspired compass uses only two pixels to determine the solar meridian direction angle. It consists of two UV-light photo-sensors topped with linear polarizers arranged orthogonally to each other as it was observed in insects' Dorsal Rim Area. The compass is embedded on our ant-inspired hexapod walking robot called Hexabot. The performances of the celestial compass under various weather and UV conditions have been investigated. Once embedded onto the robot, the sensor was first used to compensate for yaw random disturbances. We then used the compass to maintain Hexabot's heading direction constant in a straightforward walking task over a flat terrain while being perturbated in yaw by its walking behaviour. Experiments under various meteorological conditions provided steady state heading direction errors from 0.3 • (clear sky) to 1.9 • (overcast sky). These results suggest interesting precision and reliability to make this new optical compass suitable for autonomous field robotics navigation tasks.