The aim of this paper is to build a trajectory tracking system considering the attitude of the quadrotor. Nowadays, quadcopter is often used for taking landscape pictures. The roll pitch Euler angle of the quadcopter greatly affects the resulting pictures so that it needs to be controlled. As a limitation, the roll pitch Euler angle based on inertial reference frame is not allowed to be more than fifteen degrees. Two main factors that affect the Euler angle of quadcopter are velocity and acceleration. Therefore, the velocity and acceleration of the UAV is maintained. A linear regression method is used to determine the velocity and acceleration reference that affect the resulting Euler angle. PID (Proportional, Integral, Derivative) controller is used as the controller method for the tracking control system. Finally, the trajectory tracking and attitude control is evaluated through simulation with ROS and Gazebo.