This paper presents a technique based on the probabilistic road map algorithm for trajectory planning in autonomous driving. The objective is to provide an algorithm allowing to compute the trajectory of the vehicle by reducing the distance traveled and minimizing the lateral deviation and relative yaw angle of the vehicle with respect to the reference trajectory, while maximizing its longitudinal speed. The vehicle is considered as a 3 Degree-of-Freedom bicycle model and a Model Predictive Control algorithm is implemented to control the lateral and longitudinal dynamics. Both the control and trajectory generation algorithms take the road lane boundaries as the only input from the surrounding environment exploiting a simulated camera. The performance of the technique is compared with the case in which the reference trajectory is the central line between the lane boundaries. The proposed algorithm is validated in a simulated driving scenario.