# Robotic Motion Learning Framework to Promote Social Engagement
## 2 System Design and Algorithms  
### Robotic Learning from Gestures  
The robot was programmed to imitate human gestures by implementing a motion learning algorithm called \"Dynamic movement primitive with Gaussian mixture regression\" (DMP with GMR). A dynamic movement primitive (DMP) is a generalized gesture with specific position goals and end points joined in a sequence to create a scalable movement based on an original demonstration. Robots utilize DMPs to reproduce core movements in variable settings--for example, when the distance or pathway between the start and end goal changes. This is also referred to as \"motion learning\". \[\left[ \begin{array}{c}\dot{z}\\ \dot{y}\\ \dot{x}\end{array} \right]=\left[ \begin{array}{c}\alpha(\beta(y^{\delta}-y)-z )+x\times f(x))/\tau\\ z/\tau\\ -\alpha_{x}x/\tau\end{array} \right]\text{with initial state}\left[ \begin{array}{c}0\\ y_{0}\\ 1\end{array} \right]\text{ and attractor state}\left[ \begin{array}{c}0\\ y^{\delta}\\ 0\end{array} \right], \tag{1}\]  
Equation (1) is the basis from which all motion learning controls are developed [10]. It is a proportional-derivative (PD) control signal, separated into three first order equations, modified to produce a custom trajectory. \(\alpha(\beta(y^{\delta}-y)-z)\) is a spring damper system, where y refers to the system state, \(y^{\delta}\) refers to the goal state, and \(z\) refers to the velocity of the system. The constant variables \(\alpha\) and \(\beta\) are gains, and \(\tau\) represents temporal scaling. A \(\tau\) value between 0 and 1 slows the reproduction rate, whereas a \(\tau\) value greater than 1 increases the speed. The forcing function \(f(x)\) allows the algorithm to create a specific trajectory, rather than taking the shortest path from the start to end goals. This is multiplied by \(x\), the diminishing gate, which restrains the boundaries of the trajectory in order to reach the proper end goal [11]. Equation (1) determines a DMP in one dimension. To generate multi-dimensional movement reproductions, the equation's forcing function is made phase dependent instead of time dependent and is run multiple times with concurrent phases. Multiple variations of motion learning algorithms were compared to determine which would be appropriate for humanoid robotic movements. Most differences in motion learning algorithms lie in how the forcing function is calculated. Forcing functions redirect the trajectory into specific movement reproductions through activation states, also referred to as activation weights. For standard DMP techniques, such as DMP with weighted least squares (WLS), the duration, position, and intensity of the activation weights are preset equidistant throughout the execution of the movement reproduction. For DMP with Gaussian mixture regression (GMR), rather than an equal distribution, the activation states are placed at key points that define the trajectory, which the algorithm identifies during learning [11]. The results of our comparison of WLS and GMR learning algorithms can be seen in Figure 1.  
The forcing function in DMP with GMR causes the algorithm to have more precise movement reproductions than traditional methods. The forcing function is calculated using a series of statistical models. First, a Gaussian Mixture Model (GMM) plots the raw biological motion mathematically, as \"data points generated from a mixture of a finite number of Gaussian distributions with unknown parameters\" [12]. Next, an expectation maximization (EM) procedure extracts important features of the GMM, including mixing coefficients, centers, and covariances of the system, to estimate the boundaries of the reproduction trajectory [13]. This builds the trajectory. Finally, a Gaussian Mixture Regression (GMR) is implemented. This determines the velocity and acceleration with which the trajectory is traversed.