Optimization on parameterized motor skills