Pseudospectral method-based safe motion planning for quadrotors in a cluttered environment