A computer-implemented method for operating an autonomous driving vehicle (603, 803), the method comprising: in response to a request to park the ADV (603, 803, 1001) in a parking lot, obtaining (901, 1001) a set of parking-trajectories (621, 622, 623, 624, 625, 626, 821) associated with a set of predetermined locations (611, 612, 613, 614, 615, 616, 811) near one or more parking spots (602, 802) within the parking lot, wherein the set of parking-trajectories was previously and offline generated based on prior planning and control data of the parking lot, each of the parking-trajectories corresponding to one of the one or more parking spots within the parking lot; wherein for each predetermined location, a parking-trajectory starting from the predetermined location to a corresponding parking spot is generated; wherein, for each parking spot of the one or more parking spots, a subset of parking-trajectories (621, 622, 623, 624, 625, 626) starting from a subset of predetermined locations (611, 612, 613, 614, 615, 616) near the parking spot to the parking spot was generated offline; determining a current location of the ADV upon activating a parking function at the parking lot; determining whether the current location matches one of the set of predetermined locations; if the current location of the ADV does not match any of the set of predetermined locations (611, 612, 613, 614, 615, 616, 811), determining a nearest predetermined location of the set of predetermined locations (611, 612, 613, 614, 615, 616, 811) to the current location, a parking-trajectory associated with the nearest predetermined location is then selected from the set of parking-trajectories (621, 622, 623, 624, 625, 626, 821); and controlling (903, 1012) the ADV to park in a corresponding parking spot according to the selected parking-trajectory. in response to a request to park the ADV (603, 803, 1001) in a parking lot, obtaining (901, 1001) a set of parking-trajectories (621, 622, 623, 624, 625, 626, 821) associated with a set of predetermined locations (611, 612, 613, 614, 615, 616, 811) near one or more parking spots (602, 802) within the parking lot, wherein the set of parking-trajectories was previously and offline generated based on prior planning and control data of the parking lot, each of the parking-trajectories corresponding to one of the one or more parking spots within the parking lot; wherein for each predetermined location, a parking-trajectory starting from the predetermined location to a corresponding parking spot is generated; wherein, for each parking spot of the one or more parking spots, a subset of parking-trajectories (621, 622, 623, 624, 625, 626) starting from a subset of predetermined locations (611, 612, 613, 614, 615, 616) near the parking spot to the parking spot was generated offline; determining a current location of the ADV upon activating a parking function at the parking lot; determining whether the current location matches one of the set of predetermined locations; if the current location of the ADV does not match any of the set of predetermined locations (611, 612, 613, 614, 615, 616, 811), determining a nearest predetermined location of the set of predetermined locations (611, 612, 613, 614, 615, 616, 811) to the current location, a parking-trajectory associated with the nearest predetermined location is then selected from the set of parking-trajectories (621, 622, 623, 624, 625, 626, 821); and controlling (903, 1012) the ADV to park in a corresponding parking spot according to the selected parking-trajectory.