## 3 DMPs-DPF Approach for Obstacle Avoidance
### Description of the DPF Coupling Term  
Based on the relative position and speed relationships between the system and obstacle, the coupling term can feedback the repulsive force generated by the obstacle to the system in real time. If the system is close to the obstacle, the repulsive force is increased. Otherwise, the repulsive force is reduced. Based on this principle, the system can successfully avoid the obstacle. Especially, compared to \(p(o,x)\) which only considers the position relationship of the system and obstacle, the coupling term \(p(o,x,\
u)\) also considers the relative speed relationship in addition to the position relationship. This has the advantage that it can effectively avoid the drawbacks of unsmooth obstacle avoidance trajectory and speed incoherence. According to the size and shape of the obstacle, the obstacle avoidance problem can be divided into two categories. One is the obstacle with negligible size and shape, the other is the obstacle with non-negligible shape and size. The coupling terms \(p(o,x,\
u)\) in these two cases are calculated as follows. (1) An obstacle with negligible size and shape  
When the system operates in an environment with a single small obstacle, the obstacle can be treated as a point with no size and shape. In this situation, the motion analysis of the system and obstacle is drawn in Figure 4 in detail. Figure 3: Block diagram of dynamic movement primitives combined with dynamic potential field (DMPs-DPF) approach. In the above motion analysis diagram, \(O\) is the simplified obstacle center point position, \(x\) is the current position of the system, \(v\) is the current velocity of the system, \(a_{p}\) is the acceleration generated by the coupling term \(p(o,x,v)\), \(\varphi\) is the angle between the velocity vector and the relative position vector, which can be computed with the following equation  
\[\varphi=\arccos\left[\frac{\left(o-x\right)^{T}\cdot\dot{x}}{\left|o-x\right| \dot{x}\right|}\right]. \tag{11}\]  
In order to realize the most efficient obstacle avoidance effect, the acceleration term should be located in the plane determined by the obstacle \(O\), position \(x\), and velocity \(v\) at an angle of 90 deviating away from the velocity \(v\). Considering the matching characteristics of the dynamic potential field with the velocity, the magnitude of acceleration generated by \(p(o,x,v)\) should be consistent with the velocity of the system. Thus, the coupling term should include the factor constructed by the following equations  
\[Rv=\text{Rotation Matrix}(r,\pi/2)v \tag{12}\]  
\[r=(o-x)\times v, \tag{13}\]  
where \(r\) is the cross product of the relative position vector and velocity vector, \(R\) is the rotation matrix with \(r\) as the rotation axis and \(\pi\)/2 as the rotation angle. Moreover, the rotation matrix can be solved with the Rodrigue Rotation Formula. The processed Equation (12) can be represented as  
\[Rv=v\cos\frac{\pi}{2}+r_{0}\times v\sin\frac{\pi}{2}+(r_{0}\cdot v)r_{0}(1- \cos\frac{\pi}{2}), \tag{14}\]  
where \(r_{0}\) is the unit vector of \(r\), which can be calculated by \(r_{0}=r/|r|\). Except considering the impact of velocity, the coupling term \(p(o,x,v)\) also takes the angle \(\varphi\) and relative distance \(d\) into account. The factor in the coupling term can be calculated by  
\[\psi=\varphi\exp(-\beta\varphi)\exp(-kd) \tag{15}\]  
where \(\psi\) is the control factor, \(\beta\) is the angle coefficient used to adjust the influence of angle on the coupling term, and \(k\) is the distance coefficient used to adjust the influence of relative distance on the coupling term. Specifically speaking, when the system is moving slowly or the obstacle in the path is small, it is better to choose large \(\beta\) and \(k\). On the other hand, when the system is moving quickly or the obstacle is large, it is better to choose small \(\beta\) and \(k\). Following the above rules, the effects of angle and distance on the value of the coupling term can be effectively presented.