With the rapid development of a new generation of information and communication technologies such as artificial intelligence, big data, and the Internet of Things, the automotive industry is rapidly evolving in the direction of electrification, intelligence, and interconnection, and the research and application of autonomous driving technology has become a focus of much attention. Trajectory planning technology, as a core element of self-driving cars, directly affects the safety and comfort of the vehicle and other major technical performance indicators. Aiming at traditional trajectory planning algorithms' low efficiency and static obstacle avoidance, this paper proposes a trajectory planning method for self-driving vehicles based on NSGA-II. The method employs an efficient spatial sampling-based approach to generate a set of feasible paths connecting the initial state and the sampled terminal state, while the trajectory at the lane change is optimized using a fifth-degree polynomial to obtain a smooth lane change trajectory. The trajectories generated by traditional methods may face control instability in the control phase, and this method enhances the real-time performance by accurately calculating the control quantities with better consideration of vehicle tracking control. Based on the timeliness, comfort, and safety as the optimization objectives, a multi-objective optimization model is constructed and solved using the NSGA-II algorithm to obtain a satisfactory vehicle path. Finally, the effectiveness of the trajectory planning method proposed in this paper is verified by simulation and analysis experiments, and the next research direction is prospected.