Automatic parking trajectory planning based on random sampling and nonlinear optimization