Pseudospectral Method-based Safe Motion Planning for Quadrotors in a Cluttered Environment