Trajectory-based Skill Learning using Generalized Cylinders