Dynamic via-points and improved spatial generalization for online trajectory generation with DMP