In this paper, the real-time trajectory planning problem is considered for a differential vehicles in a dynamically changing operational environment. Some obstacles in the environment are not known apriori, they are either static or moving, and classified to two types: “hard” obstacles that must be avoided, and “soft” obstacles that can be run over/through. The proposed method presents trajectories, satisfying boundary conditions and vehicle’s kinematic model, in terms of polynomials with one design parameter. With a cost function of L2 norm, an optimal feasible trajectory is analytically solved for “hard” obstacles. By relaxing the optimal solution, “soft” obstacles are prioritized to be bypassed or overcome. The proposed method offers an automatic and systematic way of handling obstacles.The simulation is used to illustrate the proposed algorithm.