A novel approach to dynamic movement imitation based on quadratic programming Carlos Cardoso 1 , Lorenzo Jamone 1 , Alexandre Bernardino 1 Abstract— This paper proposes a novel approach to generate trajectories that generalize given demonstrations according to optimality criteria. By formulating the problem as a quadratic program we can efficiently incorporate constraints to adapt to new desired motion requirements while achieving the main goal of matching the acceleration profile of the demonstration. This makes our method particularly suited for the imitation and generalization of trajectories such as hitting movements, where it is crucial to maintain the dynamic traits of the demonstration while respecting strict requirements for the goals position, veloc- ity and time. Our method draws inspiration from the Dynam- ical Movement Primitives (DMPs) framework, preserving its desirable properties of flexibility and rejection of disturbances during execution. Moreover, it offers an higher degree of control on the generated solution, allowing for example i) to limit the instantaneous positions, velocities and accelerations during the whole trajectory, and ii) to add intermediate way points that were not present in the demonstration. With current state-of- the-art solvers of quadratic programs, a problem with hundreds of parameters can be solved in tens of milliseconds in a standard computer, allowing practical applications. Our methodology results in trajectories with a very good approximation of the shape traits of the demonstration, with additional flexibility in specifying constraints of the generated trajectory. I. I NTRODUCTION AND RELATED WORK Modern robots are expected to operate alongside humans, performing complex tasks in unstructured environments, showing flexibility, adaptability and generalization capabil- ities. Given the diversity of situations faced by the robot, that cannot be fully pre-determined, learning techniques are going to play a major role to equip robots with complex motor skills and behaviors [1]. One practical way to allow robots to learn motor skills is through the ”programming by demonstration” paradigm [2], [3], [4], also known as ”learning by demonstration” or ”imitation learning”. The main idea is that a motor skill (i.e. the trajectory of a movement) is demonstrated to the robot (typically through kinesthetic teaching [5], [6]), and a general representation of the movement (i.e. a movement primitive) is learned from the recorded data. Using such representation the robot can replicate the demonstrated motion under dif- ferent conditions, e.g. with a different starting or ending *This work was partially supported by the European Commission under the POETICON++ (FP7-ICT-288382) and LIMOMAN (PIEF- GA-2013-628315) projects, and by the Portuguese Science Foundation FCT projects AHA (CMUP-ERI/HCI/0046/2013), BIOMORPH (EXPL/EEI AUT/2175/2013) and LARSyS (UID/EEA/5009/2013). 1 Carlos Cardoso, Lorenzo Jamone and Alexandre Bernardino are with the Institute for Systems and Robotics, Instituto Superior ecnico, Universidade de Lisboa, Lisbon, Por- tugal carlos.cardoso@tecnico.ulisboa.pt {ljamone,alex}@isr.ist.utl.pt Fig. 1. A screenshot of the robotic arm in the Gazebo simulator, while performing a ball hitting task. position, thus showing not only the ability to learn from a human teacher, but also to generalize and adapt what has been learned to different situations. Moreover, the learned primitive can be progressively refined through practice, using for example Reinforcement Learning (RL) techniques [7]. One key issue is therefore to find a proper representation for such movement primitives. A number of solutions have been proposed during the last decade, resorting for instance to neural networks [8], probabilistic estimation [9] and many other techniques. One of the most promising approaches draws from the theory of dynamical systems, giving raise to solutions such as Stable Estimator of Dynamical Sys- tems (SEDS [10]), sequenced Linear Dynamical Systems [11], Implicit Dynamical Systems [12] and, most notably, Dynamic Movement Primitives (DMPs [13], [14]). This latter formulation in particular has proven to be a very effective tool for imitation learning, and has been therefore widely used in robotics and inspired many extensions to add velocity goals [15], [16] and allow uncertainty and way-points in the execution [17]. However, the DMPs approach still has a few drawbacks. One is that, despite allowing quick adaptation to new start/end positions, it may generate undesired motion profiles (especially in terms of accelerations) that are not under full control. Another one is that it lacks the possibility to impose constraints in the motion, such as joints position and velocity limits. In this paper we propose an alternative solution in which imitation is formulated as a global optimization problem, thus allowing a much higher degree of control on the trajectory that imitates the demonstration. More specifically, the optimization procedure aims at finding the trajectory that imitates the acceleration profile of the demonstration best, 2015 IEEE International Conference on Robotics and Automation (ICRA) Washington State Convention Center Seattle, Washington, May 26-30, 2015 978-1-4799-6923-4/15/$31.00 ©2015 IEEE 906