{'fraction_non_alphanumeric': 0.03241760364746339, 'fraction_numerical': 0.006413971639426606, 'mean_word_length': 4.721043324491601, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Human to Robot Whole-Body Motion Transfer

Transferring human motion to a mobile robotic manipulator and ensuring safe physical human-robot interaction are crucial steps towards automating complex manipulation tasks in human-shared environments. In this work, we present a novel human to robot whole-body motion transfer framework. We propose a general solution to the correspondence problem, namely a mapping between the observed human posture and the robot one. For achieving real-time imitation and effective redundancy resolution, we use the whole-body control paradigm, proposing a specific task hierarchy, and present a differential drive control algorithm for the wheeled robot base. To ensure safe physical human-robot interaction, we propose a novel variable admittance controller that stably adapts the dynamics of the end-effector to switch between stiff and compliant behaviors. We validate our approach through several real-world experiments with the TIAGo robot. Results show effective real-time imitation and dynamic behavior adaptation. This constitutes an easy way for a non-expert to transfer a manipulation skill to an assistive robot.


I. INTRODUCTION
Service robots may assist people at home in the future. However, robotic systems still face several challenges in unstructured human-shared environments. One of the main challenges is to achieve human-like manipulation skills [1]. Learning from demonstrations is arising as a promising paradigm in this regard [2][3] [4]. Rather than analytically decomposing and manually programming a desired behavior, a controller can be derived from observations of human performance. However, transferring human motion, in a way that demonstrations can be easily reproduced by the robot, ensuring a compliant and safe behavior when physically interacting with a person in assistive or cooperative domains, is not straightforward. Imitation is an intuitive whole-body motion transfer approach due to the similarities in embodiment between humans and service robots (Figure 1). A fundamental problem is to create an appropriate mapping between the actions afforded to achieve corresponding states by the model and imitator agents [5]. This problem is known in literature as the correspondence problem. It implies determining what and how to imitate. Another key challenge on the whole-body motion transfer problem, in human-centered robotics applications, is to ensure that the learned skill can be reproduced in a safe and compliant manner. This requires to adequately balance two opposite control objectives: a tight tracking of the motion being imitated, and a reactive behavior to interaction forces, allowing a steady-state position error. This   Transferring human motion to robots while ensuring safe humanrobot physical interaction can be a powerful and intuitive tool for teaching assistive tasks such as helping people with reduced mobility to get dressed.
The classical approach for human motion transfer is kinesthetic teaching. The teacher holds the robot along the trajectories to be followed to accomplish a specific task, while the robot does gravity compensation [6]. The main advantage of this approach is that it avoids solving the correspondence problem. However, since the robot must be held, is not suitable for robots with a high number of degrees of freedom (DOF) such as humanoids, limiting the taught motions. By solving the human-robot correspondence, the robot can learn more human-like motion policies. This field has been very active in the recent years. In [7] the authors present an approach for imitating the human hand and feet position with a Nao robot by solving the inverse kinematics (IK) of the robot, while ensuring stability with a balancing controller. Instead of solving the IK for the robot end-effectors, in [8] the authors propose a direct joint angle retargeting, alleviating the computational complexity. The main limitation of these works is that their solutions are strongly robot-dependent. This issue is addressed in [9], where the authors enhance scalability for motion transfer by establishing a correspondence between human and robot upper-body links in task space. Although excellent results are achieved regarding the motion imitation, physical interaction, which is of critical importance for robots operating in human environments, is not considered in these works.
Variable admittance control [10] is a suitable approach for modulating the robot behavior during physical humanrobot interaction. However, research efforts have been mainly focused on cases where the robot motion is only driven by the force exerted by a human [11] [12]. This is not the case for a robot imitating the human posture, where a reference position should also be considered. An approach with a constant impedance profile has been proposed recently in [13].
In this work we propose a general framework for easily transferring human-like motion to a mobile robot manipulator. We propose a novel imitation based whole-body motion transfer interface. The main contributions are on the formulation of a general solution to the correspondence problem, and the definition of a control scheme for effective real-time whole-body imitation while ensuring compliance and stability during physical human-robot interaction. The paper is organized as follows: in Section II we discuss the main aspects of the proposed system; in Section III we present the conducted experiments to validate our approach; finally in Section IV, we summarize the main conclusions.
II. WHOLE-BODY MOTION TRANSFER FRAMEWORK Achieving accurate, real-time robotic imitation of human motion while ensuring safe physical human-robot interaction, involves several steps. The first one is to adequately capture human motion [14] [15]. Then, we should determine what and how to imitate. This implies not only to determine a correspondence between human posture and the robot configuration, but also an effective management of the DOF and account for the robot constraints [16] [17]. Finally, compliance and an accurate position control should be adequately balanced since they involve different dynamics [18]. In this section we present the proposed methods to address these challenges.

A. Motion Capture
Motion capture is a way to digitally record human movements. Data is mapped on a digital model in 3D [19]. Inertial motion capture, compared to camera-based systems, does not rely on any external infrastructure allowing it to be used anywhere [20]. We use the Xsens MVN motion capture suit. It uses 17 body-attached inertial measurement units (IMUs) to obtain a body configuration and provide a realtime estimation of the human posture. The suit is supplied with MVN Studio software that processes raw sensor data and estimates body segment position and orientation. It is capable of sending real-time motion capture data of 23 body segments using the UDP/IP communication protocol.

B. Correspondence Problem
The correspondence problem can be stated as: given an observed behaviour of the human, which from a given starting posture evolves through a sequence of subgoals in poses, the robot must find and execute a sequence of actions using its own (possibly dissimilar) embodiment, which from a corresponding starting posture, leads through corresponding subgoals to corresponding poses [5]. This accounts that the human and robot may not share the same morphology or affordances. This problem requires adequate considerations regarding the differences in the kinematic chains and joint limits. It can be divided into three subproblems: where f a b is the mapping from B to A and P, O, G and R refer to the person state, observation, goal and robot configuration spaces respectively.
Formally, the problem is finding f r p : P → R, defined as: where • is the composition operator and () −1 the inverse. Based on this definition, the solution depends on the motion capture system, as it conditions the observation space. Using a system like the one presented in Section II- where n is the number of observed person segments and SE (3) n an n-dimensional array of three-dimensional Euclidean groups. Each element of the array is a homogeneous transformation from reference i to j: where R j i ∈ SO(3) and p j i ∈ R 3 are the rotational and translational components, respectively. Then Ultimately, the problem is finding a mapping between Cartesian and robot configuration spaces. This is a problem widely studied in robotics. Currently, specially in humanoid robotics research, where robots have a high number of DOF, frameworks for defining f g way that the pose of m robot links can be constrained in Cartesian space are being developed, such as Whole-Body Control [21]. Therefore, in order to make our proposed solution as general as possible, it seems convenient to define a correspondence function such as f g o : SE (3) n → SE (3) m . This can be summarized in the following scheme: We consider that the pose is equivalent if, with respect to an arbitrary fixed reference frame, the difference in position and orientation of the person's right (or left) wrist, elbow, chest, and the projection of the pelvis onto the floor; and the equivalent links of the robot up to an scaling factor, is zero. Given T p f po , T pt p f , T pe ps and T pw ps where po, p f , pt, ps, pe and pw stand for the person arbitrary origin, virtual footprint, torso, shoulder, elbow and wrist reference frames respectively and an example of an equivalent person-robot pose i.e. corresponding state (e.g. Figure 2). We propose that the analogous robot pose is fully-determined by T r f ro , T rt r f , T re rs and T rw rs , where ro, r f , rt, rs, re, rw are the equivalent robot links. Their rotational components are defined as: where pi and ri (also p j and r j) are arbitrary equivalent person and robot links, and Rs is the rotation when both are in the equivalent example pose. The translational components are similarly defined as:  (5) where L rt r f is the robot's base to torso height when the torso is fully extended, L re rs and L rw re are the lengths of the robot's equivalent shoulder to elbow and elbow to wrist segment respectively. Therefore, a complete definiton of Mapping in Cartesian space for an equivalent pose between a human model and the TIAGo robot. The colors red, green and blue are the x, y and z axes of each reference frame, respectively. Note that for the particular case of a robot with a morphology like TIAGo rt ≡ rs.

C. Whole Body Control
Whole-Body Control (WBC) [22] has been proposed as a promising research direction when using robots with many DOF and several simultaneous objectives. The redundant DOF can be conveniently exploited to meet the multiple tasks constraints [23] [24]. Given a set of k control actions targeting an individual task x i ∈ SE(3), which defines a desired motion in Cartesian space, a generic definition of a WBC is [21]: .
where q ∈ R is the robot configuration, the Moore-Penrose pseudo-inverse of the i th task Jacobian which is defined by .
x i = J i . q. A task can represent, for example, the end-effector pose or the available joint range.
A hierarchical ordering among tasks can be defined. Let N Ai = I − J A † i J Ai be the null-space projector of the augmented Jacobian J Ai = (J 1 , . . . , J i ). Then, the joint velocity can be determined with the following relationship [25]: .
This allows the i th task to be executed with lower priority with respect to the previous i − 1 task, not interfering with the higher priority tasks. If J i is singular, the i th task cannot be satisfied. However, the subsequent tasks are not affected since the dimension of the null-space of J Ai is not decreased. For whole-body imitation, the robot needs to achieve multiple varying goals in Cartesian space simultaneously. This makes WBC a suitable control framework, since they can be defined as a set of tasks with an adequate hierarchy. The main advantage over other inverse kinematic solvers is that the WBC can find online solutions automatically preventing self-collisions and ensuring joint limits. We are using PAL robotics implementation for the upper-body, which is based on the Stack of Tasks [26]. Taking into consideration the equivalence human-robot relations presented in the previous section, we propose the following task hierarchy: 1) Joint limit avoidance 2) Self-collision avoidance 3) Torso position control 4) End-effector pose admittance control 5) Elbow pose control The first two tasks should always be active with the higher priority for safety reasons. The torso task is of higher priority because, by constraining the torso, the arm DOF are not affected, but the opposite is not true. Then, defining the endeffector task with the higher priority we ensure a correct endeffector goal tracking, which is important for manipulation tasks. The use of admittance control for this particular task in discussed in Section II-E. Then, with the elbow task we ensure the arm posture imitation. In the particular case that the robot arm has human-like structure, which is the case of the TIAGo robot, a correct imitation can be achieved with the presented hierarchy. With the WBC we focus on redundancy resolution, finding the optimal configuration to accomplish the high-level task.

D. Differential Drive Base Control
Differential drive base is a mechanism used in many mobile robots, such as TIAGo or Roomba [27]. It usually consists on two drive wheels mounted on a common axis [28]. Linear and angular velocity are the control commands [29]. Let (x, y, θ ) T be the coordinates that define the base pose. Let v and ω be the instantaneous linear and angular velocity commands respectively. The kinematic model is: with the non-holonomic constraint . y cos θ − .
x sin θ = 0, which does not allow movements in the wheels' axis direction.
Using the notation presented in Section II-B, the robot footprint pose should coincide with the person's, plus an arbitrary constant offset for a successful imitation. It is an inverse kinematics problem i.e., find the velocity commands that allow the robot to reach a given pose. Common path planning frameworks address this problem [30]. However, most of them are not suitable for cases where the goal is constantly changing at a rate of a human walking, which makes the robot remain in a planning state. Additionally, they do not consider backwards motion, which might be needed. We propose a computationally simple implementation, summarized in Algorithm 1 to address these issues. When initialized, it assumes the person and the robot footprint frames are coincident in an arbitrary fixed reference frame. Then the relative transform between the person and the robot footprint is determined at each time step. When the robot is further than a certain margin to the reference, angular velocity commands orientate the robot towards the goal position. If the robot position is close enough, angular velocity commands align the robot with the goal orientation.

E. Variable Admittance Control
Admittance control [31] is a method where, by measuring the interaction forces, the set-point to a low-level motion controller is changed through a virtual spring-mass-damper model dynamics to achieve some preferred interaction responsive behavior [32]. In simple cases, the parameters of such a system can be identified in advance and kept fixed. However, when interaction forces are subject to uncertainties, the desired response can be adaptively regulated [33]. Variable admittance control allows to change the dynamics in a continuous manner during the task. When imitating the human posture in real-time, an accurate pose control is desirable, so a stiff behavior is preferable. On the other hand, when physically interacting with a human, a compliant (i.e. low stiffness) behavior is of vital importance to ensure safety [34] [35]. The virtual end-effector dynamics: . .
where inertia M (t) ∈ R 6×6 , damping D (t) ∈ R 6×6 and stiffness K (t) ∈ R 6×6 determine the virtual dynamics of the robot, e (t) = x (t) − x re f (t) ∈ R 6×1 , when subjected to an external force F ext (t) ∈ R 6×1 . x re f (t) and x (t) are, in our particular case, the reference position provided by the human and the position passed to the WBC, respectively. If M (t), D (t) and K (t) are constant, the system will be asymptotically stable for any symmetric positive definite choice of the matrices. However, in this work we assume that M remains constant while D (t) and K (t) vary in time. It can be proved (see [36]) that for a constant, symmetric, positive definite M, and D (t), K (t) continuously differentiable, the system is globally asymptotically stable if there exists a γ > 0 such that, ∀t ≥ 0: .
Without loss of generality, we can assume that M, D (t) and K (t) are diagonal matrices, since they can always be expressed in a suitable reference frame. Therefore, the system can be uncoupled in six independent scalar systems. To condense, we focus on the translational DOF. However, for the rotational components, the deduction is analogous: As design criteria, we will ensure a constant damping ratio ζ > 0. Thus, the damping is chosen as d (t) = 2ζ m k (t).
By substituting on the second stability condition, it yields the following upper bound for the stiffness derivative: .
In order to switch the robot role between follower, i.e. compliant to the external force (k min ), and leader (k max ) [37][38], we propose a continuously differentiable scalar role factor α (t) ∈ [0, 1] and the following varying stiffness profile: Role adaptation can be derived from the interaction force feedback. Experience of varying stiffness control suggests that continuous and smooth variations show no destabilization tendencies. We propose the following role factor profile: where a and b are design parameters and ψ (t) ∈ [0, 1] is a proposed interaction factor that varies according to the interaction force feedback. Note that higher values of a give a faster transition between roles while b determines the value of ψ (t) at which the transition starts. We propose the following interaction factor dynamics: .
≤ F thres and ψ = 0 0 else (14) where F thres is the force threshold to consider physical human-robot interaction, and c − < 0 and c + > 0 are design parameters. Note that the values of c + and c − modulate the transition speed when switching from leader to follower and from follower to leader roles respectively. As a design guideline, for safety reasons it is important to achieve a fast stiff to compliant transition, but that is not the case for the opposite. Thus, high c + values are desirable but c − values should be kept relatively smaller in absolute value. From the first stability condition, since the damping profile is bounded, taking the least conservative constraints, we obtain γ = 2ζ √ k min . Given that all the varying parameters are bounded, we can determine an upper bound of the stiffness profile derivative, and a lower bound for the second stability condition. Thus, a sufficient stability condition is: Tuning the parameters empirically, we have assigned ζ = 1.1, m = 1 kg, k min = 10 Nm −1 , k max = 500 Nm −1 (Nm rad −1 for the rotational components), a = 20, b = −5.5, c − = −0.2 and c + = 1.5 for all the DOF. By direct substitution, the sufficient stability condition holds. For filtering the noise in the interaction force feedback signal coming from the 6-axis force sensor we implemented a moving average filter [39] of 25 samples (40 Hz sampling rate). An overview of the variable admittance controller can be seen in Figure 3.

III. EXPERIMENTAL RESULTS
We carried out three different real-world experiments to validate the proposed approach, using the TIAGo robot, with 10 DOF excluding the head, and the Xsens motion capture system. The objective of the first experiment was to show the upper-body motion similarity when using the proposed solution for the correspondence problem and the WBC with the presented task hierarchy. In the second experiment we tested the mobile base imitation using the proposed algorithm for differential drive control. For the third experiment we evaluated the performance of the role adaptation mechanism and that the stability condition derived analytically is sufficient to ensure a stable behavior. Additionally, several demonstrations are included as a supplementary video.

A. Upper-body Motion Transfer
The robot performed real-time imitation while the human operator described a spiral trajectory with the hand. To evaluate the motion similarity, we compared the trajectory described by the robot's end-effector and the evolution of the angle formed by the robot elbow-wrist and elbowshoulder segments with the reference trajectories. Results are shown in Figure 4. The obtained mean absolute error for the end-effector position is of 11 cm and of 0.05 rad for the elbow opening angle. As it can be seen, the robot is able to describe a spiral with the end-effector accurately while imitating the arm posture with its 7 DOF, proving a successful redundancy resolution. It can also be seen, from inspecting the results, that although a real-time imitation is achieved, the commanded motion is of an average speed of 11 cm/s. During the experiments, we observed that due to the robot's joint speed limits and own inertia, the operator movements should be limited to low speed motions.

B. Base Motion Transfer
The operator described a path with a series of turns while the robot moved in parallel. The obtained results are shown in Figure 5. The mean absolute error in position is of 19 cm and of 0.31 rad in orientation. It can be observed that the robot motion is very similar to the reference trajectory. We are able to imitate the operator pose during the walking motion through velocity commands with the proposed algorithm. It should be remarked that the non-holonomic constraint does not apply to human walking motion. Therefore, in order to achieve a successful imitation the operator trajectory should not include side steps. However, when the non-holonomic constraint is not satisfied in the operator movement, for a sufficient large time, the base position and orientation always converge to the reference if it remains static.

C. Role Adaptation
A reference trajectory was commanded to the robot, while executing the motion, the end-effector is grasped by a person, displacing it from its goal trajectory. Then, it is released. The experiment results are shown in Figure 6. The results show how, when the grasping occurs, the interaction factor starts to increase, while the stiffness rapidly decreases to switch the robot behavior from stiff to compliant. This allows  to easily move the end-effector away from its commanded trajectory. When it is released, the interaction factor starts to decrease while the stiffness starts to restore its initial value and the robot end-effector position converges to the original trajectory. Note that when the stiffness is at its minimum value the difference between the stability bound and the stiffness profile derivative reaches its minimum value. Nevertheless, stability is fulfilled during the whole realization. No oscillations or unstable behavior were observed.

IV. CONCLUSION
In this paper we have presented a human to robot wholebody motion transfer framework. Imitation, on the one hand, offers many advantages, not only because it is intuitive, but also because it allows to transfer human-like motion to the robot. On the other hand, it involves solving the correspondence problem. We present a novel general solution, that first, defines the equivalence between an arbitrary human body posture and the corresponding robot posture as a goal pose for a series of links in Cartesian space. Then, we propose a whole-body control scheme to find the robot configuration that attains simultaneous goals. By defining an adequate task hierarchy, we achieve an effective upper-body redundancy resolution. Furthermore, we have presented an algorithm that allows the robot differential drive base to imitate the human translation (through walking) motion. Finally, when a robot is operating in human-shared environments it is important to ensure safe human-robot interaction. However, achieving a compliant behavior and accurate position control are opposite objectives. We propose a novel variable admittance controller that allows continuous adaptation of the end-effector dynamics when physically interacting with a human by means of scalar role and interaction factors. For the proposed controller, we have derived analytically a stateindependent and sufficient condition for ensuring stability.
Experimental results show that an effective whole-body imitation is achieved in real-time. Moreover, the robot successfully adapts its role when physical interaction with a person occurs. Experimentation has shown that the main limiting factors preventing faster imitation are the robot's joint speed limits and inertia. Imitating translation, for differential-drive bases is limited because of the non-holonomic constraint.
This work has contributed a building block to a robotic system able to learn skills through demonstrations. The proposed approach to transfer human body motion to a mobile manipulator provides an easy way for a non-expert to teach a rough manipulation skill to a service or assistive robot. Afterwards, the robot would autonomously practice and improve the skill (e.g., its accuracy) through reinforcement learning [40]. Future research towards learning dexterous manipulation skills will address the challenge of generalizing and adapting the learned motion when dealing with uncertainty. The combination of imitation learning and variable admittance control is a promising first step towards robots performing complex manipulation tasks in humanshared environments.