In this paper, we designed an attitude controller for a quadcopter based on sliding mode control. Autonomous flight experiments on a straight line path were conducted in the outdoors. The control performance of the conventional PID control method and the sliding mode control method designed in this paper was compared at a wind speed of 3 m/s. In the case of PID control, the maximum errors of the lateral direction, roll angle, pitch angle, and yaw angle were 34.6 cm, 2.59 deg, 5.61 deg, and 15.02 deg, respectively, on the other hand, in the case of sliding mode control, they were 20.5 cm, 1.49 deg, 1.43 deg, and 5.62 deg, respectively. Therefore, under a wind speed of 3.0 m/s, the results of position and attitude angle errors indicate that sliding mode control is effective in improving the robustness of the system.