# Robotic Motion Learning Framework to Promote Social Engagement
## 2 System Design and Algorithms
### Robotic Platform  
The robotic system chosen for this experiment was ROBOTIS-OP2 (\"OP2\"), a humanoid robot standing at 17.9 inches (45.45 cm) and weighing 25 pounds. OP2 has proportional-integral-derivative (PID) controllers at 20 different joints, can talk through Text-to-Speech or pre-recorded audio files, and is programmable directly through a Linux operating system (OS). OP2 was chosen as a suitable robotic agent for this experiment due to its small size, friendly humanoid appearance, multimodal feedback source capabilities and computer-sized processing power. Figure 2: In blue, the original 3D trajectory of a participant’s right hand as they perform a “conducting” gesture, tracked using a Microsoft Kinect. (**a**) Motion learning reproduction without segmentation and fusion. (**b**) Reproduction after trajectory segmentation and fusion, using 90 point segments with a 20 point overlap. For this experiment, the motion learning reproduction was implemented only in OP2's arms (shoulders and elbows), as seen in Figure 3. Reproduction of torso, hip, or leg movement would require additional programming for stabilization, as OP2 does not have the same bodily proportions as a human, and additionally differs in terms of weight distribution. OP2 has two motors in each shoulder. These motors can be set to replicate human shoulder pitch and roll. Manipulating these two planes allows arm yaw to be replicated as well. OP2 has one motor in each elbow, enabling it to match human elbow pitch. However, OP2 lacks the ability to perform the rotational movement of wrist yaw. This means that it cannot reproduce the human movement of rotating the palm from facedown to faceup. However, by replicating the angles of each participant's shoulder and elbows, the majority of the gesture was able to be articulated. Perhaps because they saw that OP2 had no hands, participants tended to close their fists or generally not flex their hands when demonstrating movements to the robot. The Microsoft Kinect, a depth camera, was used to track participant movement. A custom graphical user interface (GUI) was developed to utilize depth information from the Kinect to generate a skeletal framework of the participant's joints for movement reproduction by OP2. Arm joint information was collected and used by the GUI to calculate arm angles. Eight angles were tracked in total--the four left arm angles listed in Table 1, and their right-side equivalents. These angle variables became inputs into the DMP with GMR motion learning algorithm in MATLAB (Version 2015a, MathWorks, Inc., Natick, MA, USA). New, smoothed, similar angle reproductions were generated by the algorithm from the demonstration data. These values were then converted from degrees into motor actuator positions, which would allow for OP2 to be controlled. The values were outputted to a text file, remotely uploaded into OP2's directory, and called from our \"Emotion Game\" program to perform gesture reproduction on command. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Angle Name** & **Composition** & **OP2 Motor Equivalent** \\ \hline LS\({}_{0}\) & \(\angle\)(SCyz, SEyz) & M2: L\({}_{SHO}\)\({}_{PITCH}\) \\ LS & \(\angle\)(SCxy, SExy) & M4: L\({}_{SHO}\)\({}_{ROLL}\) \\ LE\({}_{0}\) & \(\angle\)(ESyz, EHyz) & M6: L\({}_{L}\)\({}_{ELBOW}\) \\ LE & \(\angle\)(ESxy, EHxy) & None \\ \hline \hline \end{tabular} Note: Composition abbreviations are identical to those listed in Figure 3. Composition subscript variables refer to the corresponding three-dimensional planes.  
\end{table} 
Table 1: Comparison of human movement to its equivalent performance through OP2. Right side motors (not listed) are equivalent to the left side motors shown. Figure 3: A diagram of OP2 on the left, in comparison to a person on the right, where C stands for center, S for shoulder, E for elbow, and H for hand. OP2 is capable of reproducing the 2 degrees of freedom (DoF) found in the human shoulder and the 1 DoF in a human elbow, but cannot reproduce hand or wrist movement.