An Extended DMPs framework for Decoupled Quaternions Learning and generalization

Dynamic Movement Primitives (DMPs) as a robust and eﬃcient framework has been studied widely for robot learning from demonstration. Classical DMPs framework mainly focuses on the movement learning in Cartesian or joint space, and can’t properly represent end-eﬀector orientation. In this paper, we present an Extended DMPs framework (EDMPs) both in Cartesian space and Riemannian manifolds for Quaternion-based orientations learning and generalization. Gaussian Mixture Model and Gaussian Mixture Regression are adopted as the initialization phase of EDMPs to handle multi-demonstrations and obtain their mean and covariance. Additionally, some evaluation indicators including reachability and similarity are deﬁned to characterize the learning and generalization abilities of EDMPs. Finally, the quaternion-based orientations are successfully transferred from human to the robot, and a real-world experiment is conducted to verify the eﬀectiveness of the proposed method. The experimental results reveal that the presented approach can learn and generalize multi-space parameters under multi-demonstrations.


Introduction
Learning from Demonstration (LfD) has played a key role for robots to learn movement and manipulation skills from humans due to its high efficiency [1]. Conventional LfD methods, e.g., teach-pendant, joysticks, keyboard, etc. are used for fast programming that more focus on the endpoint movement trajectory planning and control. Such interfaces are only for some simple tasks, and it is powerless for complex anthropomorphic operations. In recent years, many novel LfD approaches have been developed for complicated tasks, of which DMPs [2], SEDS [3], GMM [4], ProMP [5], KMP [6] and HMM [7] are outstanding representatives.
As a widespread LfD approach, DMPs is firstly proposed and developed by Ijspeert, et al [2] [8] [9] [10], to describe a trajectory by a series of action units. Such movement primitives are formalized as a stable attractor system to generate the trajectory either in joint or task space [11]. The classical DMPs framework composed of a canonical system module, a transformation system module, and an LWR module, is developed for encoding movement, learning characteristics, and generalizing to other similar targets.
In recent years, many approaches based on the classical DMPs are presented to extend its functionality, such as obstacle avoidance [12] [13] [14], stiffness learning [15] [16], collaborative skills generalization [10] [17], etc. As one of the most commonly used skill learning frameworks, classical DMPs model exhibits many excellent performances, e.g., robust to perturbations, converges to the attractor, time independent, etc. Therefore, the approach is extensively applied to learn and generalize some human skills, for instance playing table tennis [18], playing drums [19], playing billiards [20], handwriting [21], etc. Although the classical DMPs is widely used, it still has some drawbacks [22]. In this paper, we are committed to endow the classical DMPs with the capability to handle multi-demonstrations and Riemannian space parameters such as orientations.
In LfD community, GMM-GMR provide a suitable option for multi-demonstrations to obtain more demonstrated imformation, such as the probability distribution of multi-trajectories [4] [7] [23] [24] [25]. GMM-GMR encodes the human skills as a clustering problem by estimating the joint distribution over the state variables and performing regression with conditional distribution. As a robust learning algorithm, GMM-GMR is widely used for learning and reproducing human skills in kinematics and dynamics. When dealing with multi-demonstrated trajectories, the data is usually projected onto a latent space, and then encoded and generalized by GMM and GMR successively [4]. Comparing with the DMPs approach, GMM-GMR provides a suitable option for multi-demonstrations, which can obtain mean and probability distribution simultaneously. These parameters are beneficial to summarize the demonstrated law, and even provide some guidance for variable impedance control [26]. Although GMM-GMR has several merits, this approach lacks generalization capacity when the new target exceeds its distribution range. On that account, TP-GMM [27] is developed to adapt the context by extracting the relevance between different tasks. In [28], GMM-GMR is introduced into classical DMPs framework as the nonlinear terms updating module to endow them the ability of handling multi-trajectories, but this approach applied in joint space, only suitable for Cartesian space parameters, and ignored the probability distribution of multi-demonstrations. Similarly to [28], we incorporate GMM-GMR into DMPs, but we more focus on the task space and Riemannian space parameters like orientations, and effectively utilized the covariance characteristics.
Positions and orientations are important for robots to accurately learn movement skills. Many existing works have addressed the position's learning based on the classical DMPs framework in Cartesian space. Since the orientations are the parameters on manifolds, the classical DMPs framework unable precisely handle such variables. Therefore, in recent years, many researches [29] [30] [31] [32] have introduced Riemannian manifolds to represent orientations. Such approaches provide the possibility to properly represent end-effector orientations. In [29], several concepts of Riemannian manifolds such as geodesics and logarithm/exponential maps are specifically discussed in robotics, and four kinds of manifolds are listed including the sphere manifold S d , special orthogonal group SO(d), special Euclidean group SE(3), and the manifold of SPD matrices S d ++ . In [30], a modified DMPs framework is proposed to learn orientations in Cartesian space based on the quaternions S 3 and rotation matrices SO(3) with the logarithmic map. Similarly, another way for learning orientations based on quaternion is developed in [31]. In [32], the manifold of SPD matrices S 3 ++ based trajectory is learned with the geometry of the SPD matrices space. Inspired by these publications, we provide a new approach for Quaternion-based orientations based on the concepts of geodesics and exponential function on the Riemannian manifold. Different from the above mentioned publications, our approach focuses on the 2-dimensional space sphere manifold S 2 , and decompose the quaternion S 3 into a Cartesian term R and a Riemannian term S 2 . i.e., the rotation angle and axis q = q + λv. Thus, our framework can handle the Cartesian term q and the Riemannian term v in multi-space DMPs, respectively. In brief, our approach focuses on the unit directional vectors S 2 from the decomposition of quaternions S 3 , and is also suitable for contact planning that only focuses on the principle contact forces and their directions [29].
Generally speaking, notwithstanding the GMM-GMR on Riemannian manifolds have been reported for characterizing skills in recent years, these approaches have not eliminated the limited generalization ability of probabilistic models. Comparatively, the dynamic system has better generalization capability, but most of the existing methods can only handle the parameters in Cartesian space, and lack the capability for multi-demonstrations. Moreover, throughout the above reviews, the researches lack of quantitative indicators to evaluate the learning and generalization results.
On this basis, the contributions of this paper can be summarized as follows: 1) We propose a novel approach to learn and generalize quaternion-based orientations from human to robots by extending the classical DMPs to the Riemannian manifold. 2) We combined with the GMM-GMR and EDMPs framework according to their mutual complementarity. The fused framework can not only handle multidemonstrations to obtain more demonstrated imformation, but also has a good generalization ability. 3) We propose several evaluation indicators including reachability and similarity for the learning results of LfD under the determined RBFs and time constants of the algorithms. The remaining of this paper is organized as follows. section II presents the methodology of Data preprocessing, EDMPs framework, GMM-GMR algorithm and evaluation indicators. In section III, a real-world experiment has been performed to evaluate its effectiveness. Discussion are carried out in section IV. Section V provides the conclusion of this paper.  Aim at the orientation's learning from human to robots, and help them acquire multi-space skills conveniently and autonomously. As shown in Fig. 1, The architecture mainly consists of four layers, i.e., human demonstrations (Green), data preprocessing (Blue), skills learning (Yellow) and robot control (Red). In this section, we will provide a specific description of data preprocessing and EDMPs framework in Section A and B . And then, the methodology of GMM-GMR for multi-space parameters under multi-demonstrations will be introduced in Section C . Additionally, we will design several evaluation indicators in Section D to evaluate our learning and generalization results. For a better understanding, we have summarized the key notations and the used abbreviations in Table 1.

Data processing
2.1.1 Orthogonal processing As described in Fig. 1, several trajectories of the reference points are recorded from human demonstrations with the VICON motion capture system, thus, we can calculate the positions {{p}} ∈ R 3 and orientations {{o x }} , {{o y }} , {{o z }} ∈ S 2 with these reference points. Thus, the pose matrix can be constructed with multi- To guarantee the orthogonality of the columns in pose matrices, we should firstly adopted the Gram-Schmidt orthogonalization approach to fine-tune the demonstrated multi-dimensional orientations. (1) where o, ξ represents the inner product between o and ξ, i.e., o, ξ = o T ξ. Thus, we can obtain a set of orthogonal basis ξ x , ξ y , ξ z , and its standard form

Continuous quaternion solution and decomposition
In screw theory, every transformation of robot end-effector with respect to the base coordinate system can be expressed by a screw displacement, which is a translation along a v ∈ S 2 axis and a rotation with θ ∈ R angle about the axis. Quaternionbased representation of robot end-effector poses have been widely used with its high-efficiency and non-singularity. Due to a specific pose can be represented in two different ways of quaternions, i.e., (θ, v) and (−θ, −v), we introduce a constraint rule for adjacent quaternions to ensure the quaternion-based trajectores continuous.
where the sign of q i is determined by q i−1 . On this basis, we decompose quaternion into a Cartesian term q = sin θ 2 and a Riemannian term v = [x, y, z]. And then, the multi-space parameters θ and v can be learned with the presented EDMPs framework respectively.

Quaternion dimension reduction before GMM-GMR
In initial stage, to facilitate get the mean and covariance from multi-demonstrations, the dimension of quaternion-based orientations should be reduced firstly before GMM-GMR initialization. As depicted in Eq. 5, quaternions can be written in exponential form: Thus, the dimensions of quaternion can be reduced through logarithmic map.
Based on the above conversion, we can handle the quaternion-based orientations with GMM and GMR in Cartesian space, and finally obtain the mean and covariance in all decoupling dimensions. Hereinafter, we will use DR-quaternion to represent the quaternion after Dimensionality Reduction.

Methodology of EDMPs
For notational simplicity, in the rest of this paper, we denote the rotation angle and the rotation axis of quaternion as angle-quaternion θ and axis-quaternion v.
EDMPs framework is combined with a transformation system module, an LWR updating module, and a canonical system module, wherein the transformation system module is composed of multi-spaces, i.e., the transformation system in Cartesian space and Riemannian manifolds. Angle-quaternions and positions learning uses the classical transformation system in Cartesian space, and axis-quaternions learning is realized on the Riemannian manifold. LWR is applied for updating nonlinear terms, the canonical system is used to avoid the explicit time dependency. The diagram of the EDMPs is depicted in Fig. 1.
As described in Fig. 1, under the proposed EDMPs framework, at the learning stage, phase variables {s}, positions and angle-quaternions (p, θ) , ṗ,θ , p,θ and axis-quaternions {v,v,v} are processed with the transformation system in Cartesian space and Riemannian manifolds, respectively. The target nonlinear terms of f p ∈ R 3 , f θ ∈ R and f v ∈ R are calculated with the input parameters, and then encoded with the linear combination of several RBFs. The weights of RBFs in the nonlinear terms are finally updated with the LWR approach. At the generalization stage, new target position and angle-quaternionp g ,θ g and new axis-quaternionv g are provided as the unique attractors of the second order differential equation in Cartesian space and Riemannian manifolds, respectively. The generalized trajectories can be calculated with the multi-space transformation system of EDMPs framework.

Transformation system module
In this section, we take the angle-quaternions θ ∈ R as the research object to describe the transformation system in Cartesian space. The transformation system on the Riemannian manifold is exploited for the axis-quaternions v ∈ S 2 .
As depicted in Fig. 1, The transformation system in Cartesian space is composed with a simple dynamic and a nonlinear function, wherein the simple dynamics is developed to build the relationship among the position, velocity and acceleration of angle-quaternions θ,θ,θ by a second order differential equation. The nonlinear function as a forcing term is formalized with several nonlinear radial basis functions to fit any curve. The mathematical model of transformation system is defined as follows [9].
θ, z andż denote the position, velocity and acceleration of angle-quaternions, respectively. τ is used to adjust the duration of the task. α θ and β θ are time constants for guaranteeing that the angle-quaternion θ will finally convergence to the target θ g . In this paper, we set the α θ = 4β θ for both position, angle-quaternion and axis-quaternion learning that the Eq. 8 and Eq. 9 becomes critically damped, and the values are determined by the specific task.
The extended unit of the transformation system is developed on the Riemannian manifold for axis-quaternions learning and generalization. The distance between two axis-quaternions is represented by geodesics on the Riemannian manifold, and the modified mathematical model is described in Eq. 9.
where λ i ,λ i ∈ R denote the velocity and acceleration term between v i and v i+1 on the Riemannian manifold, wherein the d (v i+1 , v i ) = arccos v T i+1 v i ∈ R is the geodesics between v i and v i+1 , and dt represents their interval time. v i represents the axis-quaternion in the i-th state of trajectories, respectively. τ , α v and β v are constants. Taking into consideration of other situations where the initial and target axis-quaternions are changed, the rotation matrix Rô o ∈ R 3×3 should be introduced to update the mapping direction γ = log vi v i+1 ∈ R 3×1 between neighboring axisquaternions. As shown in Eq. (3) where Rô o is determined by the initial and target axis-quaternions of the demonstrated and the generalized trajectory.
where o ∈ R 3×1 andô ∈ R 3×1 represent the vector from the initial axis-quaternion to the target axis-quaternion of the demonstrated and the generalized trajectory, respectively.
The rotation angle θô o ∈ R and the rotation axis ω ∈ R 3×1 of o andô can be calculated as follows.
On this basis, Rô o can be deduced with the Rodrigues' formula.
where I ∈ R 3×3 is the identity matrix,ŵ ∈ R 3×3 is the anti-symmetric matrix. And then, the v i+1 can be calculated by v i with the exponential function [33].
On this basis, the nonlinear sequence {f θ } and {f v } can be calculated with the Eq. 8 and Eq. 9 successively.

LWR updating module
In this paper, we use a linear combination of several nonlinear RBFs to successively fit the proposed nonlinear terms. LWR approach is introduced to update their weighted distributions in the linear combinations.
.., N , and h N = h N −1 . Each RBFs Ψ i (s) is weighted by ω i , which can be updated by the LWR approach.

Canonical system module
To avoid the explicit time dependency during learning and generalization, the phase variables s are introduced as the state parameters in the first order linear dynamic system, i.e., the canonical system.
where s ∈ 0, 1 , s (0) = 1 ,ṡ denotes the derivative of s, τ and α s are constants. When s converges to zero, the nonlinear term f (s) = 0, θ and v are finally converged to the target θ g and v g . The whole system is depended on the phase variables s, but not the time. Thus, the EDMPs framework can be generalized to other situations without change the trajectories.

GMM-GMR algorithm for multi-space parameters
GMM-GMR is presented at the initialization stage to handle multi-trajectories from human demonstrations. As depicted in Fig. 1, {{p}} and {{(θ, v)}} are obtained from multi-demonstrations of human tutor, wherein p ∈ R 3 , θ ∈ R and v ∈ S 2 . In the initialization stage, multi-demonstrated positions {{p}}, DR-quaternions (θx, θy, θz) ∈ R 3×1 , and phase variables {s ∈ R} are imported into GMM unit in Cartesian space to learn the distribution of multi-trajectories, and the GMR unit is applied to generate a single trajectory and the corresponding probability distribution. After that, the output QR-quaternions {(θx, θy, θz)} is refactored back to the quaternion representation{(θ, v)}, and the obtained single generated trajectory including positions and orientations can be learned by EDMPs. Moreover, inspired by the publication [26], the variable impedance control can be realized with the probability distribution of multi-trajectories. The specific process is depicted as follows.
The demonstrated data are collected as follows In this paper, we have totally K demonstrations, and each demonstration has M discrete points. ξ I is the phase variables {s} in EDMPs, and ξ O is composed with positions {p} and DR-quaternions {(θx, θy, θz)}.
As depicted in Eq. 18, we have totally K + M discrete data, and each data follows the probability distribution P ( * (s)). Hereinafter, we take the positions p (s) as example.
where d denotes the dimension of output parameters ξ O . The posterior probability π, mean µ and covariance matrix Σ of N 2 Gaussian distribution functions can be determined by the EM algorithm.
To avoid local optimal values, k-means algorithm is firstly introduced to initial the clustering centers. And then, the EM algorithm is applied to update the parameters. The whole process can be divided into E-step and M-step, the former is used to optimize the expectation function, i.e., the sum of posterior probabilities E = M +K j=1 P (u, Σ|ξ s ), in this phase, the parameters {π, u, Σ} are seen as invariants. Oppositely, the purpose of M-step is to update the parameters {π, u, Σ}, and the expectation function E is invariant. The detailed explanation of EM algorithm, and the parameters' updating process, please refer to [34].
Based on the updated parameters π,û,Σ of GMM, for positions, the GMR is applied to calculate the expectation E(P (p|s)) and the covariance cov(P (p|s)) of the conditional probability P (p|s). In brief, the conditional probability P (ξ O |ξ I ) with several Gaussian distribution functions can be calculated based on the updated mean and covariance matrix [25], i.e.,û k = û On this basis, the reconstructed data and the constraints are deduced as followŝ After initialization stage with GMM-GMR, a single trajectory with covariance can be obtained, wherein the former can be used to train EDMPs learning framework and the latter can be applied to estimate the stiffness matrices K i ∈ R 6×6 of impedance control loop.

Evaluation indicators of learning results
In this section, to properly exhibit the reproducibility or generalization capability of our approach under the determined RBFs and constants of α and β in Eq. 8 and Eq. 9, we define some evaluation indicators including reachability and similarity for the learning results. In Cartesian space, the reachability is determined with APE between the target and actual position/angle-quaternion in the end state, and RPE is calculated with the APE relative to the maximum Euclidean norm of two positions/angle-quaternions in the trajectory. The similarity is determined by PCCc between the scaled demonstrated trajectories and the actual generalized trajectory, wherein the scaling factor η = θ g −θ 0 / |θ g − θ 0 | is calculated according to the difference of the demonstrated target and the new targets. On the Riemannian manifold, the reachability is determined with AAE between the target and actual axis-quaternions in the end state. The similarity is determined with PCCr between the rotated demonstrated and the actual generalized axis-quaternions. The evaluation indicators of RPE, PCCc and PCCr are dimensionless.
The acceptable reachability and similarity can be determined according to the actual application scenarios. In this paper, we define the satisfactory generalized results when RPE is small than 0.005, APE range is between -5°-5°, and PCCc / PCCr are greater than 0.8, i.e., the generalized trajectories will converge to the target poses with high accuracy and strong correlation comparing the demonstrated trajectory that generated under GMR.

Experiment
In this section, The Franka Panda robot is used as the experimental platform. A pick-up task with different poses is designed and illustrated to verify the learning and generalization ability of the proposed method both in Cartesian space and Riemannian manifolds.

Multi-space skills processing and learning
Multi-demonstrations of the pick-up task are conducted in Fig. 2. The VICON motion capture system composed with 10 cameras and 4 optical markers is used to record the trajectories of demonstrations. Three of these optical markers were respectively placed at the center of palm, radial styloid, and ulnar styloid, to ensure that the plane formed by these points is approximate parallel to the palm of human tutor, and further determine the z -axis of end effector during movement. The last optical marker is selected between radial styloid and ulnar styloid, to facilitate the determination of y-axis. The x -axis is determined with the right-hand rule. The trajectories of these points are processed to represent the positions and orientations of palm. After multi-demonstrations and data preprocessing, GMM is used to encode their distributed characteristics and GMR is introduced to generate a single trajectory and the corresponding probability distribution according to the input phase variables. To properly characterize the distributions of multi-trajectories, and generate a suitable trajectory for EDMPs framework, we selected 5 Gaussian distribution functions for multi-space parameters' learning in our experiment, i.e., N 2 = 5. The learning results are depicted in Fig. 3. On this basis, the positions and quaternions of generated trajectory are imported to the EDMPs framework, to learn their characteristics both in Cartesian space and Riemannian manifolds. In this scenario, we selected three targets on different positions with different poses to test the generalization ability of the presented approach in multi-spaces. Moreover, to obtain a relative higher learning accuracy, we set the α p = 4β p = 25 for positions and α p = 4β p = 5 for quaternion-based orientations, and selected 25 RBFs i.e., N 1 = 25 to fit corresponding nonlinear terms. Therefore, the reproduced and generalized trajectories including positions and quaternion-based orientations for different targets are successfully obtained, as shown in Fig. 4.   Fig. 4 (b) represents the generalization of decoupling quaternion-based orientations on the Riemannian manifold including angle-quaternion and axis-quaternion, respectively. To characterize the learning and generalizing capability of the EDMPs framework in multi-spaces, the reachability and similarity of the reproduced and generalized trajectories are calculated, as shown in Table 3 and Table 2.  In Table 3 and Table 2, The average APE, RPE and PCCc of generalized positions on each axis x -, y-, and z -axis is 1.3155mm, 1.8865mm, 0.7528mm, 0.0032, 0.1393, 0.0034, and 0.9976, 0.9289, 0.999 respectively. The average APE, RPE and PCCc of generalized Angle-quaternion is 0.0402mm, 0.0035, and 0.9979 respectively. The average AAE and PCCr of the generalized Axis-quaternion is 0.1570°and 0.9944. The experiment results reveal that the presented approach performs outstanding learning and generalization capabilities both in Cartesian space and Riemannian manifolds. Based on the definition of the satisfactory region in section II-C , we calculate the satisfactory generalization region of axis-quaternions to further verify the generalization capability of our approach on the Riemannian manifold, as shown in Fig. 5. As shown in Fig. 5, satisfactory generalized region with -5°-5°AAE and 0.8-1 PCCr is determined. The region can cover nearly 1/3 of the spherical coordinate. All reachable targets are located on the same hemisphere with the demonstrated target. If the generalized target is too close to the starting point, the nonlinear terms learned in Eq. 9 may produce unexpected influence on the generalized trajectories, and the reachability and similarity will be unsatisfactory. Moreover, if the relative directions of the generalized targets and the starting point are opposite to the demonstration, or the generalized targets are located on the other hemisphere of the spherical coordinate, the generalized trajectories will show a negative correlation with the demonstrated trajectory, and the reachability is also unsatisfactory.

Experimental verification on real robot
To apply our approach in real scenario, and further verify its effectiveness, we designed a pick-up task based on the above learning and generalization results with panda robot. Firstly, the variable stiffness including translational and rotational stiffness profiles are obtained through GMM-GMR initialization, and the probability distribution based variable impedance control is realized, as show in Fig. 6. The whole control system is based on ROS network. Fig. 7 shows several typical results of this task, and the robot successfully completed the relative tasks with similar trajectory profiles comparing with the demonstration. As shown in Fig. 6, the action is started at initial phase variable s(start) = 1 and finished at s(end) = 0. According to the probability distribution of multitrajectories, the diagonal element of translational and rotational stiffness matrices can be obtained based on the Eq. 27. For the translational stiffness, the stiffness along x -and y-axes maintained a low stiffness in the initial stage and gradually incleased with the execution of task. The stiffness along z − axis experienced first decrease and then increase to a high level for the targets. A similar trend can be seen in the different dimensions of rotational stiffness. From this result, it can be concluded that in this task, to complete the pick-up task, the priority of each axis is x and y greater than z . As depicted in Fig. 7, four bottles were placed on the desk, one of them with blue cap is the demonstrated target, the others with yellow caps are the generalized targets which placed randomly. The robot was firstly regulated to the initial pose, as show in Fig. 7 (a), which is similar with the demonstrated initial pose in Fig.  2 (a). The initial homogeneous matrix of the human tutor is transformed to the real initial pose of the robot in Fig. 7 (a) through a transformation matrix, and the demonstrated trajectory is also changed accordingly. Fig. 7 (b) and (c) represent the reproduced trajectory for the demonstrated target. On this basis, we manually adjusted the joint angle of the robot to reach the corresponding generalized targets with reasonable grasping poses. The obtained end poses were imported to the EDMPs framework, and three similar trajectories to the demonstrated curve can be deduced successively. Fig. 7

Discussion
It is worth noting that the learning results of the exsisting DMPs based frameworks heavily depend on the selected number and distribution of RBFs and the time constants of transformation system. These parameters are determined empirically with the specific tasks. It is also the limitation of our proposed EDMPs. Moreover, to the best of our acknowledge, there is still no literature on how to evaluate the algorithm under the selected RBFs and time constants. In this paper, we proposed several evaluation indicators to characterize the performance of EDMPs, and determined the satisfactory generalized region in our application scenario. As shown in Fig. 5. if the generalized targets and the demonstrated one are similar or located on the satisfactory generalized region, the EDMPs framework will perform superior characteristics. But when the difference is too large, especially if the target is located on the other hemisphere of the Riemannian manifold, the results will be unsatisfactory. This limitation may be overcome by building a knowledge database for the robot, the database including different skills for various tasks and covering the whole sphere on the Riemannian manifold.
The proposed EDMPs framework can be applied for more complex tasks, such as the human-robot cooperation scenarios, peg-in-hole tasks, etc., where should consider positions and orientations simultaneously. The main difference between our contribution and the predecessors [35] is that our approach can handle different kinds of manifold parameters, including the sphere manifold S d , special orthogonal group SO(d), special Euclidean group SE(3), and the manifold of SPD matrix S d ++ , by using quaternion to represent them, and decoupling the quaternions into Euclidean space and Riemannian space terms θ ∈ R, v ∈ S 2 . In general, our proposed EDMPs frameworks provide a new way to learn and generalize multi-space skills with the decoupled quaternions by extending the classical DMPs to the Riemannian manifolds.

Conclusion
(1) A EDMPs framework both in Cartesian space and Riemannian manifolds has been presented for transferring kinematic skills including positions and orientations from human to robots. The quaternion based orientations could be successfully learned and generalized under the Riemannian space transformation system of the EDMPs framework.
(2) GMM-GMR algorithms are combined into the presented EDMPs framework that allows us to obtain not only a single regression trajectory, but the corresponding probability distribution. Wherein the former could be learned with EDMPs, and the latter could be applied as reference for designing variable impedance controller.
(3) The reachability and similarity are defined as the evaluation indicators to characterize the learning and generalization capability of the EDMPs framework under the determined RBFs and the constants of α and β in Eq. 8 and Eq. 9. On this basis, A real-world experiment is implemented with Panda robot, the maximum APE, RPE, and minimum PCCc in Cartesian space is 1.8956 mm, 0.1399, and 0.9026 respectively, and the maximum AAE and minimum PCCr on the Riemannian manifold is 0.2076°and 0.9882, respectively, and the satisfactory generalization region is finally determined. The experimental results reveal that EDMPs exhibits a relatively good learning ability for multi-space parameters, and further verify its feasibility in real scenario.
The present study takes some references for transferring multi-space skills from human to robot. In the future, we will extend our framework to other industrial applications and various robotic tasks, where need to consider position, orientation, force and stiffness both in Cartesian space and Riemannian manifolds simultaneously, such as peg-in-hole, scraping, weld, human-robot cooperation, etc.   Human demonstrations for the pick-up task    Experimental results of the pick-up task with different poses