{'fraction_non_alphanumeric': 0.04029932469428728, 'fraction_numerical': 0.011169921518525278, 'mean_word_length': 4.524500907441016, 'pattern_counts': {'":': 0, '<': 2, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Impact-Friendly Object Catching at Non-Zero Velocity based on Hybrid Optimization and Learning

This paper proposes a hybrid optimization and learning method for impact-friendly catching objects at non-zero velocity. Through a constrained Quadratic Programming problem, the method generates optimal trajectories up to the contact point between the robot and the object to minimize their relative velocity and reduce the initial impact forces. Next, the generated trajectories are updated by Kernelized Movement Primitives which are based on human catching demonstrations to ensure a smooth transition around the catching point. In addition, the learned human variable stiffness (HVS) is sent to the robot's Cartesian impedance controller to absorb the post-impact forces and stabilize the catching position. Three experiments are conducted to compare our method with and without HVS against a fixed-position impedance controller (FP-IC). The results showed that the proposed methods outperform the FP-IC, while adding HVS yields better results for absorbing the post-impact forces.


I. INTRODUCTION
Dynamic robotic manipulation tasks are challenging since they require tight coordination between object detection, motion planning, and control. Activities such as throwing [1], [2], hitting [3], [4], juggling [5], and catching [6], [7] play an important role in various applications, including logistics, aerospace, and smart factories. Catching flying objects is particularly challenging as the overall catching motion demands fast and precise planning with quick execution. In addition, the perfect trajectory tracking of a real-world manipulator is still unfeasible. Moreover, the impact forces between a robot and a flying object during the contact phase should be considered to avoid causing damages to both sides.
The catching motion can be divided into two phases: Pre-Catching (PRC) and Post-Catching (POC). PRC represents the period before the first contact between an object and the robot. After a successful PRC, the POC stage starts and is defined by the period following the initial impact until the complete movement stoppage. Even though PRC and POC are isolated for modeling purposes, the success of POC relies on the performance of PRC.
One important factor during PRC and with strong implications in POC is the relative velocity between the robot's end-effector (EE) and the object. It significantly affects the initial impact forces [8]- [10], and velocity matching (VM) is often applied to minimize the relative velocity by  planning the relative motion between an object and the robot. A good VM performance in PRC depends on perception and planning strategies combined with fast online trajectory planning/re-planning and control for manipulators. Several studies proposed solutions for VM with online re-planning for catching using model-based polynomial [11]- [13] or optimization [14], [15] strategies. Although these methods generate smooth trajectories, they do not consider VM's effect on the efforts caused by the impact.
Other solutions for VM take inspiration from humans. Humans can catch moving objects with non-zero velocity, generating fast yet smooth trajectories, even for unforeseen objects [16], [17]. Learning from (human) demonstrations (LfD) approaches are powerful techniques to teach a robot to produce fast and reactive motion. In [6], the robot motion is learned from human throwing demonstrations, but the robot stops directly when the objects are contacted with the EE, which may result in the bouncing of the object. To address this problem, in [7] the robot continues to track the predicted objects' path after contact, generating a soft catch motion.
LfD studies so far have generated promising results, yet they did not consider the task post-impact dynamics during POC due to the catching of lightweight objects. Several catching applications, however, require dealing with highimpact forces in POC. Hence, suitable algorithms must dissipate the potential energy and decelerate the flying object. This highly dynamic behavior is essential to prevent damaging the object [10] and the robot, especially in tasks with high speed and/or high mass objects [8].
Therefore, the design of robot controllers with compliant behavior is paramount to dealing with uncertainties, either at tracking or object's properties, and maintaining stability  Fig. 2: Overall process of the proposed framework. From left to right, the PRC optimization receives the initial object's pose as input and computes the PRC optimal catching trajectories via constrained QP. For the POC phase, human demonstrations are used to obtain the post-impact trajectories via KMP and to learn the variable stiffness profile used in the VIC. Lastly, the lower level Cartesian impedance controller generates the actuation torques provided to the robot. after contact. It is possible to obtain highly damped behaviors using impedance [18] or admittance [19] controllers, but the controller's parameters are often constant, and their choice is still mainly empirical. In [8], a hybrid controller was implemented with multi-mode trajectory optimization to halt a heavy object traveling on a table at a constant speed of 0.88m/s. However, due to the transition from free to coupled motion, the switching between different modes results in high nonlinearities, and initializing the whole system is nontrivial. Furthermore, this method is unsuitable for catching flying objects, given their high velocity and accelerating nature.
Similarly to VM in PRC, the control principles during the POC phase can also benefit from inspiration from humans. Tele-impedance was proposed in our previous work [20], where EMGs estimate the human upper arm stiffness in real-time by remotely controlling a slave robotic arm in a ball-catching experiment. The results show that the variable impedance control (VIC) outperforms the constant one under several metrics. LfD setups have also been used to teach impedance profiles in quasi-static tasks [21]- [23]. Specifically for catching, in [24] the authors encoded the kinematic human motion with a Gaussian mixture model (GMM) and Gaussian mixture regression (GMR) to catch a flying ball. However, no impact forces are reported to evaluate the method, and no information about human dynamics is encoded to improve the method. Transferring humans' compliant behavior to autonomous robots for catching flying objects is still an open issue.
We propose a method to generate an impact-friendly and safe dynamic flying object-catching behavior for autonomous robots. Fig. 1 shows the overall approach: a model-based quadratic programming (QP) during PRC, to leverage VM, combined with LfD that generates kinematic and dynamic trajectories during POC. Thus, the contributions are threefold: a novel framework capable of dealing with PRC and POC; a new constrained QP problem is designed to find the optimal catching point; an impact-friendly VIC is presented based on human kinematic and impedance profiles, which is triggered during the impact to absorb the post-impact forces and ensure stable contact. The proposed method is evaluated with a catching task of a free-falling object, and the results show that the proposed method can always generate safe and stable catching behavior compared to other baseline method.

II. METHODOLOGY
Our proposed method deals with the planning and control challenges in both PRC and POC, where the processing units and interconnections are illustrated in Fig. 2. To yield the desired performance for PRC (left block in Fig. 2), we develop a rigid body impact formulation with the interaction forces details during the collision, presented in Section II-A.1. To minimize the impact forces between the flying object and the robot EE, we implement a VM strategy to reduce the difference between the two velocity vectors. Indeed, a new model-based QP formulation is introduced in Section II-A.2 to optimize the catching point for maximum VM to the extent possible (e.g., depending on the robot's limits).
Next, the POC phase starts. A new planner is applied based on human demonstrations (center block in Fig. 2) to obtain a compliant movement to minimize the post-interaction forces and guarantee a damped catch effectively. We use GMM/GMR to obtain a human-like trajectory (i.e., the reference trajectory P ref n ) for robot's position and velocity, with time as the input variable and robot trajectories as the output. Then, the Kernelized Movement Primitives (KMP) (Section II-B.1) updates the PRC trajectory based on P ref n and with the one planned by the QP optimizer, connecting both through the catching point to ensure a smooth transition between the PRC and the POC phases. The overall timedependent desired catching trajectory is generated online, which includes the VM in PRC and the KMP updates in POC. Finally, the human demonstrations are used to learn the stiffness profiles encoded by the GMM/GMR (Section II-B.2), leveraging on human-compliant behavior, suitable for energy dissipation. It is worth mentioning that the stiffness profile for POC is decoupled from the trajectory, depending on the real time EE pose x, and is triggered by the initial contact force since the actual catching point might differ due to tracking inaccuracies. We use a Cartesian impedance control to adapt during the task (Section II-C and right block in Fig. 2). Details about human demonstrations can be found in Section III-A.
A. Pre-catching 1) Impact Model: The robotic manipulator rigid body model in joint space may be written as where q,q,q ∈ R n are the position, velocity, and acceleration vectors in joint space, respectively, and n is the number of degrees of freedom (DoF). M (q) ∈ R n×n is the joint space inertia matrix, C(q,q) ∈ R n×1 the Coriolis term, g(q) ∈ R n×1 the gravity term, and τ ∈ R n×1 is the actuation torques. The external torques generated by the interaction forces with the environment are given by τ ext = J T (q)F ext , being J T (q) ∈ R n×6 the Jacobian transpose matrix. The model (1) may be rewritten in Cartesian space to facilitate the controller design since the task is defined in the same space [25]: All the following definitions are in Cartesian space with respect to the EE: x,ẋ,ẍ ∈ R 6 are the robot's pose, velocity and acceleration, respectively, the gravity, and F τ = J −T (q)τ the actuation forces.
During the PRC and right before the impact, at moment t c , the robot's velocity isẋ and object's velocity isẋ obj ∈ R 6 . Right after the impact, velocities of the robot and the object update toẋ + δẋ andẋ obj + δẋ obj , respectively. The impact phase is defined by the time frame where the control actions are not taking effect. The robot's velocity and configuration will mostly generate reactive behavior. For an instantaneous collision, given that the direction of contact is defined by the normal vector η, the coupled dynamics of the robot and the object as rigid bodies are described by: with 0 < e < 1 being the coefficient of restitution. A situation where e = 1 is an elastic collision and the bodies have maximum velocity after the impact; e = 0 is a plastic collision, i.e., the relative velocity of the two bodies is zero.
The interaction forces generate finite impulsive forcesF at the contact point:F = lim δt→0 t+δt t F ext (s)ds, where δt is the duration of the impact. From the integration of (1), the analysis of impact show that the variation of velocity in the robotic manipulator due to the impact is given by δẋ = Λ −1F [26], [27]. Assuming the object as a point mass w.r.t. to the manipulator, its velocity variation due to impact is δẋ obj = 1/m obj (−F ) [28]. Finally, substituting both relations into (3), assuming a catch without bouncing (e = 0) and solving for the impact force: Equation (4) shows the dependencies to minimize the impact forces during the catching. The first term has the object's mass, which we do not control, and the robot's inertia, which could be modulated [29] but will be approached in future work. The second term shows that VM is essential to minimize the forces, especially in cases where the objects are accelerating at each time step and often will achieve velocities higher than the maximum speed of the robot's EE in a very short time. Finally, (4) works as an upper boundary for deformable objects since a compliant body would passively dissipate energy due to deformation [30].
2) Online Velocity Matching: In order to plan an online VM trajectory and minimize the impact forces, we formulate a QP problem as: are respectively the actual and previous position and velocity trajectories of the robot written in vector form as: T being x i ,ẋ i ∈ R 6 the robot's Cartesian poses and velocities respectively at the i-th time instant and T is the length of the prediction horizon, chosen based on the time necessary for the object to reach the ground.
x O ,ẋ O ,ẍ O ∈ R 6T are the trajectories for the object, α, β, γ are the weights associated to each objective function, ∆t is the control period, and x min R , x max R ,ẋ max R ,ẍ max R ∈ R 6T are boundaries for minimum and maximum position, velocity, and acceleration, respectively.
A soft hierarchical order is defined in the cost function. In particular, the primary objective is to catch the object successfully (thus β > α), while the secondary objective is to achieve VM. The last term is responsible for maximizing the catching point to minimize the distance traveled from the object, improving VM. These gains are tuned based on the desired amount of VM required (see section III-B). By identifying online the initial position of the object and generating its free-falling trajectory, the QP problem in (5) can find the optimal position and velocity trajectories  Fig. 2), whereμ n andΣ n represent the mean and covariance, respectively. Then, the derivation of KMP starts from a parametric trajectory where Φ(s) = I O ⊗ φ(s) ∈ R BO×O , φ(s) denotes Bdimensional basis functions and I O is the O dimensional identity matrix. The weight vector is w ∼ N (µ w , Σ w ), where µ w and Σ w are unknown. To obtain these variables, KMP uses (7) to minimize the KL-divergence between the probabilistic trajectory generated by (6) where P para n = N (Φ T (s n )µ w , Φ T (s n )Σ w Φ(s n )). By decomposing the above objective function, for any input s * , the corresponding output mean and covariance are computed as: where λ 1 > 0 and λ 2 > 0 are regularization factors, The catching point (t c , x c ,ẋ c ) generated by the QP (section II-A.2) is inserted to the P ref n as initial point. Then, the KMP updates the desired trajectory for POC by (8) and (9).
2) Human Arm Stiffness Estimation: The formulation proposed in [32] estimates human arm stiffness during POC. Fig. 3 presents the two-segmented human arm skeleton in 3D space, where the hand-forearm and upper arm segments compose a triangle at any non-singular configuration. The vector from the center of the shoulder joint to the position of the hand ( l ∈ R 3 ) represents the major principal direction of the human arm endpoint stiffness ellipsoid. r ∈ R 3 represents the vector from the center of the shoulder to the center of the elbow. Then, the minor principal axis direction ( n ∈ R 3 ) is defined to be perpendicular to the arm triangle plane. The remaining principal axis of the stiffness ellipsoid ( m ∈ R 3 ), which lies on the arm triangle plane, is calculated based on the orthogonality of the three principal axes. Hence, the orthonormal matrix V ∈ R 3×3 can be constructed as: The length ratio of the median principal axis to the major principal axis of the stiffness ellipsoid is inversely proportional to the distance d 1 ∈ R + from the hand position to the center of the shoulder. Meanwhile, the ratio of the length of the minor principal axis to the major principal axis is assumed to be proportional to the distance d 2 ∈ R + from the center of the elbow to the major principal axis. Here, λ2 λ1 = α1 d1 and λ3 λ1 = α 2 · d 2 , where λ 1 ∈ R + , λ 2 ∈ R + and λ 3 ∈ R + represent the eigenvalues corresponding to the major, median and minor principal axes, respectively. α 1 ∈ R and α 2 ∈ R are scalar variables, and d 1 = l , d 2 = r · m m . In this model, synergistic muscle co-contractions are assumed to contribute to the endpoint stiffness ellipsoid's volume, expressed by the active component A cc ∈ R. And A cc (p) = c 1 · p + c 2 is a linear relation with the muscle activation level p ∈ R. The diagonal matrix D ∈ R 3×3 is formed by the length of the principal axes, i.e., the eigenvalues, where λ 1 is set to A cc , and D s ∈ R 3×3 represents the shape of the stiffness ellipsoid. Finally, the estimated endpoint stiffness matrixK c ∈ R 3×3 is formulated bŷ We use the average value of the four parameters identified by [32]: c 1 = 2033.325, c 2 = 140.606, α 1 = 0.255, α 2 = 2.815. The Cholesky decomposition is used to decompose theK c , encoded by the GMM/GMR later, as described in [33], which will output the robot's desired stiffness K d .

C. Cartesian Impedance Controller
A Cartesian Impedance Controller is used to deal with the free and constrained motions [23]. Since only stiffness is estimated from the demonstrations, as discussed in II-B.2, we use a double diagonal method to obtain the desired damping value D d as a function of K d . The VIC at each time step generates a new stiffness and, consequently, a new damping value as diag(D d (t)) = 2ζ diag(K d (t)) where diag(·) is the matrix diagonal components at time t, and the damping factor ζ = 0.707 [34]. Note that a high constant stiffness is used until the learned human variable stiffness (HVS) is triggered by the initial impact force.

A. Human Catching Demonstrations Collection
An experimental investigation was performed on a healthy human subject to collect and analyze the human-compliant behavior in POC (see Fig. 1 bottom left side).
1) Setup: The subject was required to wear a Lycra suit covered with markers, tracked online by the OptiTrack to collect the human upper-body motion data. An EMG system was employed to measure muscle activity. The data acquisition and synchronization of all the sensors are managed using Robot Operating System (ROS) environment at 50 Hz.
2) Protocol: The subject was required to perform 9 catching tasks according to the following protocol: at the beginning of each trial, the subject was told to maintain his feet steady, with the arms placed forward at ninety degrees to the hips, waiting for the box. An experiment assistant, located in front of the subject, released a 5 kg box at a fixed height of 1 m from the subject's arms. The weight of the box remained unknown to the subject to obtain the most natural behavior [35].
Finally, 4 demonstrations were selected, and the mean value of both arms was used to construct the stiffness (see Section II-B.2). Only the biceps brachii was analyzed since it is the most activated muscle in the catching task.

B. Experimental Setup
A similar experimental methodology is used to guarantee a successful skill transfer from the human data. The experimental setup consists of a 7-DoFs Franka Emika Panda robotic arm with a 3D-printed bowl-shaped EE, connected via a force-torque sensor ATI Mini45, with a combined mass of 0.471 kg (Fig. 4A). The Panda has a payload of 3 kg suggested by the manufacturer, often designed to guarantee positioning accuracy. However, during fast movements, the allowed effective payload may be smaller due to the additional inertial loads. Therefore, even if the object-tool assembly is below the maximum allowed load, the object's high velocity and acceleration might still lead to failure by triggering the safety system. The EE's maximum velocity is 1.7 m/s, which was never achieved in the constrained workspace used in these experiments. Since the maximum velocity and acceleration are essential for VM planning, the maximum velocity and acceleration adopted are ||ẋ max R || = 1.0 m/s and ||ẍ max R || = 6 m/s 2 , respectively. Since the free-falling object is assumed to execute a 1-DoF trajectory, an assembly was designed to assure a consistent initial position of the object. A triggering mechanism (Fig.  4A) was attached to guarantee synchronization between object and robot movements, which consists of a potentiometer that is mechanically activated by the object movement. The catching object is a ball with a mass 0.494 kg and a nondeformed radius of 47.5 mm. The ball falls from the same height in each experiment to facilitate methods comparison, with a relative height along the z-axis of 27 cm 1 . All the stiffness matrices used are K d = diag(750, 750, 750) N/m, and are the initial and final values for the VIC. The QP solution was computed using ALGLIB QP-BLEIC solver on Ubuntu 20.04, with α = 0.15, β = 1, γ = 1. All experiments were performed on a computer with Intel Core i7-11700 2.5 GHz × 16-cores CPU and 32 GB RAM. The initial height of the ball is used as an input for the solver, although its position may be measured using a vision-based sensor.

C. Metrics
To analyze the performance of the proposed methods precisely, we use the quantitative metrics proposed in [20] and shown in table I. The 'lift off index' (LOI) represents the integral of the difference between the vertical component of the wrist force F z and its steady-state value (corresponding to the weight of the ball F w ) during ∆t, i.e., from impact until steady state. A higher LOI indicates multiple bouncing and/or long under-damped ball trajectories. The 'damping ratio index' (DRI) is the logarithmic decrement between the first and second impact force peaks f zp,1 , f zp,2 , respectively, with δ = log( fz p,1 fz p,2 ), which indicates the capability to absorb impact force and energy and damp it quickly. Finally, the 'bouncing time index' (BTI) is the period when the contact between the ball and the robot is lost. Dissipated energy (E) and maximum force (F max ) are also taken into account.

D. Experimental Results and Discussions
We evaluated three different cases: (i) a fixed-position impedance controller (FP-IC) with constant impedance, used as baseline; (ii) a VM algorithm with impedance controller (VM-IC) that uses QP+KMP as planners but without changing the impedance; (iii) the last one use the same planning strategy as (ii), i.e., QP+KMP for VM, and adds the VIC for the post-impact stage (VM-VIC). A snapshot sequence with VM is shown in Fig. 4. The PRC and POC stages are shown by the frames A-B-C and D-E-F-G, respectively. The FP-IC baseline keeps the pose shown in frame A as the desired position for the catching. Fig. 5 shows all experiments' interaction forces, positions, velocities, and stiffnesses through time. VM-IC and VM-VIC are averages of three repetitions, while FP-IC is the result of only one experiment. FP-IC was not extensively tested since it triggered the robot's safety system, as discussed in the following section.
Force and impedance analysis: the FP-IC was not able to conclude the task. The Panda's safety system was triggered, the brakes were activated, and signal acquisition stopped. Fig. 5 shows a red cross at the moment the robot stops. The results for the FP-IC in table II only show the maximum force since it occurs when the robot is still functioning.
VM-IC and VM-VIC completed the task and had similar behavior during impact due to the same PRC's VM profile. Impact occurred between 80 ms and 120 ms (blue region in Fig. 5). The maximum force occurs during this time frame, where FP-IC reached 30.2 N , approximately 26% more when compared to VM-IC (24.0 N ), and 28% compared to VM-VIC (23.6 N ). This confirms the importance of VM in impact-friendly controllers for catching tasks since the initial impact is faster than the controller and mechanical system response time.
The VM-IC has a lesser damping capability when compared to the VM-VIC, and after t > 120 ms, it is possible to notice the differences. First, after the impact, the VM-VIC never loses contact with the object, i.e., Fz > 0 at all time steps within t > 120 ms (BTI = 0), while VM-IC reaches forces below zero for 50 ms (BTI > 0). Bouncing may lead to several problems when catching objects with interaction  (Fig. 4) is the initial impact, which starts at around 80 ms and ends at 120 ms (blue background). The dashed vertical line in (b) represents the predicted impact position and velocity. All legends with bar overline stand for average. controllers, and a more thorough discussion may be found in [20]. Second, since BTI happens in a very narrow time window, we reinforce the lesser damping capability statement by checking the LOI: VM-IC has 2.5N s against VM-VIC's 2.3N s, indicating a more underdamped behavior for VM-IC. Third, VM-IC has a smaller DRI than VM-VIC: the first force peak is during the impact, where VM plays a more predominant role; in contrast, the second peak happens during manipulation, confirming the importance of adaptive control after impact. Finally, the extracted energy using VM-VIC (E = −1.97 J) is higher than VM-IC (E = −1.92 J).
Regarding impedance adaptation, the profile in Fig. 5a  (bottom) shows the stiffness learned with LfD taking effect. It is triggered when a force threshold of 3 N is achieved.
Position and velocity analysis: the dashed vertical line in Fig. 5b is the predicted catching point, where position and velocity desired profiles after impact are learned from humans (the desired velocity is constrained to the robot's limit). Since the ball and the robot are triggered simultaneously, and the object is already inside the robot's workspace, the inherent delay in position and velocity tracking from their desired values brings the impact earlier than predicted. In tasks where the object comes from outside the robot's workspace, the trajectory may be triggered earlier, achieving an improved VM. However, this may be dangerous for the equipment with objects with a reasonably high mass. Besides, we used KMP to update the POC trajectory to obtain a smooth transition between PRC and POC. However, the KMP does not consider the velocity and acceleration constraints, which may result in an inaccessible trajectory for the robot. Although the trajectory tracking accuracy in POC is tolerable, a new planning algorithm will be investigated, considering these constraints in future works.

IV. CONCLUSIONS
This paper aimed to address the issue of catching flying objects by minimizing impact-related force exchanges. We have formulated a complete framework for generating preand post-impact robot trajectories and stiffness profiles. In particular, the trajectories up to the optimal catching point are generated via QP optimization for maximum VM, whereas the variable stiffness and post-impact trajectories are learned from human demonstrations. As shown, with the baseline constant impedance controller, it was impossible to complete the experiments, given the excessive impact forces resulting in the motors' emergency lock. The proposed method, however, reduces the instantaneous impact forces exchanged, and thanks to the VIC, a human-like motion is achieved in the POC phase, improving energy absorption and performance metrics. Future works will encompass a more complex configuration-dependent controller to fully exploit the robot's redundancy and improve velocity tracking.