This repository contains the implementation of Dynamic Movement Primitives (DMPs), together with different approaches to obstacle avoidance, in Python 3.5.
In particular, this repository contains all the synthetic tests done for the following two publications:
M. Ginesi, D. Meli, A. Calanca, D. Dall'Alba, N. Sansonetto and P. Fiorini, Dynamic Movement Primitives: Volumetric Obstacle Avoidance, 2019 19th International Conference on Advanced Robotics (ICAR), Belo Horizonte, Brazil, 2019, pp. 234-239.
Ginesi, M., Meli, D., Roberti, A. et al., Dynamic Movement Primitives: Volumetric Obstacle Avoidance Using Dynamic Potential Functions J Intell Robot Syst 101, 79 (2021). https://doi.org/10.1007/s10846-021-01344-y
File biblio.bib contains the bibentries of the works.
The package can be installed by running
pip install .
or
pip3 install .
The repository contains two folders: codes and demos.
The codes folder contains all the scripts performing the basic functions needed to implement DMPs (together with obstacle avoidance).
The demos folder contains all the scripts performing the tests proposed in our works. The folder contains two sub-folders, one for our work with static potentials, and one of the dynamic potentials. See the comments at the beginning of the code to associate the test to the figure in the papers
Dynamic Movement Primitives are a framework for trajectory learning. It is based on a second order differential equation of spring-mass-damper type: $$ \begin{cases} \tau \dot{\mathbf{v}} = \mathbf{K} (\mathbf{g} - \mathbf{x}) - \mathbf{D} \mathbf{v} - \mathbf{K} (\mathbf{g} - \mathbf{x}_0) s + \mathbf{K} \mathbf{f}(s) \ \tau \dot{\mathbf{x}} = \mathbf{v} \end{cases}, $$
where
During the learning phase, a desired curve
Once the weights
To avoid obstacles, a copupling term
The static potential is created as
$$ U_S(\mathbf{x}) = \frac{A \exp (-\eta C(\mathbf{x})) }{ C(\mathbf{x}) }, $$
with
The dynamic potential is defined as
$$
U(\mathbf{x}) (\mathbf{x}, \mathbf{v}) =
\begin{cases}
\lambda ( -\cos \theta ) ^ \beta \dfrac{\Vert \mathbf{v} \Vert}{C^\eta (\mathbf{x})}
& \text{if } \theta \in \left( \frac{\pi}{2}, \pi \right] \
0
& \text{if } \theta \in \left[0, \frac{\pi}{2} \right]
\end{cases},
$$
where
[1] https://github.com/minillinim/ellipsoid
[2] Hoffmann, H., Pastor, P., Park, D. H., and Schaal, S.. Biologically-inspired dynamical systems for movement generation: automatic real-time goal adaptation and obstacle avoidance. In Robotics and Automation, 2009. ICRA'09. IEEE International Conference on (pp. 2587-2592). IEEE.