Learning Motor Primitives for Robotics