Trajectory planning by applying optimal velocity profile a lgorithm on Bernstein-Bézier motion primitives