Abstract: A new technique for trajectory planning of a mobile robot in a two-dimensional space is presented in this paper. The main concept is to use a special representation of the robot trajectory, namely a parametric curve consisting in a sum of harmonics (sine and cosine functions), and to apply an optimization method to solve the trajectory planning problem for the parameters (i.e. the coefficients) appearing in the sum of harmonics. This type of curve has very nice features with respect to smoothness and continuity of derivatives, of whatever order. Moreover, its analytical expression is available in closed form and is very suitable for both symbolic and numerical computation. This enables one to easily take into account kinematic and dynamic constraints set on the robot motion. Namely, non-holonomic constraints on the robot kinematics as well as requirements on the trajectory curvature can be expressed in closed form, and act as input data for the trajectory planning algorithm. Moreover, obstacle avoidance can be performed by expressing the obstacle boundaries by means of parametric curves as well. Once the expressions of the trajectory and of the constraints have been set, the trajectory planning problem can be formulated as a standard mathematical problem of constrained optimization, which can be solved by any adequate numerical method. The results of several simulations are also reported in the paper to show the effectiveness of the proposed technique to generate trajectories which meet all requirements relative to kinematic and dynamic constraints, as well as to obstacle avoidance.