Combining dynamic movement primitives and potential fields for online obstacle avoidance Dae-Hyung Park, Heiko Hoffmann, and Stefan Schaal University of Southern California, Los Angeles, USA Robots in a human environment need to be compliant. This compliance requires that a pre-planed movement can be adapted to an obstacle that may move or appear sud- denly. Here, we present a general framework for online adaptation to obstacles. Using the dynamic-movement- primitive formulation, we represent a pre-trained move- ment in end-effector space with a differential equation. This equation allows adding a perturbing force without sacrificing stability. As perturbation, we use a repel- lent force around a point-like obstacle. We demonstrate our framework in simulations and with the Sarcos Master robot arm Humans can adapt a movement plan online to ad- just for obstacles in the intended path. This flexibility is also required in robots operating in a human environ- ment, where humans may move unpredictably forbidding a robot to strictly follow a pre-planned path. At the same time, we like to program a robotic movement in a simple way, i.e., through demonstration. We combine movement reproduction from demonstra- tion with the flexibility to react to perturbances using the dynamic movement primitive (DMP) framework [1]. A DMP can represent any recorded movement with a set of differential equations [2]. Representing a movement with a differential equation has the advantage that a pertur- bance can be automatically corrected for by the dynamics of the system. Moreover, the DMPs are formulated in a way that convergence to a goal position is guaranteed. For online obstacle avoidance, potential fields are a common approach. A potential field is defined around an obstacle, and the gradient of this field results in a repellent force on the robot. This approach has been particularly popular for motion planning in mobile robotics [3], but has been also used for robotic manipulators; e.g., Brock and Khatib [4] used the potential-field method for real-time re-planning. In the following, we show the combination of DMP with potential fields, present our potential-field equation, and show results in simulation and in the Sarcos robot. Dynamic movement primitives Dynamic movement primitives can be used to generate discrete and rhythmic movements [2, 1]. Here, we focus on discrete movements. A movement is generated by in- tegrating the following set of differential equations (which we will refer to as ‘transformation system’): τ ˙ v = K(g - x) - Dv - K(g - x 0 )θ + Kf (θ) (1) τ ˙ x = v, (2) where x and v are position and velocity of the system; x 0 and g are the start and goal position; τ is a temporal scaling factor; K and D are constants; D is chosen such that the system is critically damped, and f is a non-linear function which can be adapted to allow the generation of arbitrary complex movements [2]. Equation (1) is slightly different from perviously published versions. It fixes a problem when start and end points are equal. This equa- tion is motivated from human behavioral data and force fields observed on the frog’s leg after stimulating the spinal cord [5]. The equation of motion does not depend explicitly on time, but instead on a phase variable θ, which goes from 1 towards 0 during a movement and is obtained by the equation τ ˙ θ = -αθ . (3) where α is a pre-defined constant. To learn a movement from demonstration, first, a movement x(t) is recorded and its derivatives v(t) and ˙ v(t) are computed for each time step t. Second, (3) is in- tegrated and θ(t) evaluated. Using the resulting arrays, f (θ(t)) is computed based on (1), and its parameters are determined. For combining a DMP with a potential field for obsta- cle avoidance, we add to (1) a repulsive accleration, the negative gradient of a potential U around an obstacle, τ ˙ v = K(g - x) - Dv - K(g - x 0 )θ + Kf (θ) - ∂U ∂x . (4) Using the transformation system, we generate movements in operational space. Thus, the variable x describes the end-effector position, and the obstacle’s position is en- coded in the same space. Potential field for obstacle avoidance We designed the potential field to achieve a human-like ob- stacle avoidance. In experiments, we found better results with a velocity-dependent field. The field is computed rel- ative to the position and velocity of the obstacle. Let x r and v r be the relative position and velocity vectors of the end-effector. Our potential U is defined as U (x r , v r )= λ(- cos γ ) β ||vr || ||xr || : π 2 ≤ γ ≤ 3π 2 0 : else (5) where λ is a constant for the strength of the entire field, β another constant, and γ the angle between x r and v r . Simulation We tested the movement generation with potential fields in a simulation of a moving point (Fig. 1 and 2). The transformation system describes the movement in the xy- plane. Complex trajectories could be adapted for obstacle