To improve the consistency between the simulation data generated by the trajectory generator and the actual ship motion state,a ship trajectory generator is designed for the real ship motion characteristics..Using the GPR-DBSCAN algorithm,the measured data is identified and divided into different motion states.Then,combined with ship kinematics and dynamics equations,mathematical models of ship motion for different motion states are established,and attitude velocity and position(AVP)and inertial measurement unit(IMU)data generation algorithms are provided.Finally,nonlinear regression is used to identify unknown parameters in the model and complete the construction of the ship trajectory generator.Simulation and experimental data verification show that the constructed ship trajectory generator has improved position,speed,and heading accuracy by 46.73%,6.91%,and 40.71%,respectively,compared to the trajectory generator in the PSINS toolbox,which is more suitable for the motion characteristics of real ships.