Quadrotor applications have become increasingly complicated as they require faster and more accurate movements to improve efficiency in obstacle avoidance and reduce flight time. This paper proposes a nonlinear model predictive control (NMPC) for tracking the trajectory of the quadrotor with obstacle avoidance; This command was chosen for its features in handling inputs and states constraints. Besides, given the nonlinearities and computational cost usually associated with the Euler angles and rotation matrix, the article proposes a quaternion-based approach to represent the vehicle's attitude; Finally, a numerical simulation was performed to evaluate the controller's performance with time-variant uncertainty.