mginesi / dmp_pp

Implementation of DMP in Python 3.5
53 stars 12 forks source link

About the "old" formulation #1

Closed wangyan-hlab closed 1 year ago

wangyan-hlab commented 3 years ago

Hi Ginesi,

THANK YOU for your work on DMP++.

I have a small question about the "old" formulation of DMP in your code.

It seems that you code the DMP formulation in dmp_cartesian.py as self.ddx = (self.K * (self.x_goal - self.x) - self.D * self.dx - self.K * (self.x_goal - self.x_0) * self.cs.s + self.K * f) / tau, and the only difference between the new and old formulations in old_vs_new.py is the parameter of rescale.

But if so, I think the old formulation is different from that in Ijspeert's paper, which should be self.ddx = (self.K * (self.x_goal - self.x) - self.D * self.dx + (self.x_goal - self.x_0) * f) / tau in my opinion.

Would you please explain it for me? Thank you very much.

mginesi commented 3 years ago

Hi, Yes, you are right. Scaling with the "diagonal" option multiplies the vector f by the quantity (g - x_0) component by component (since the rescale matrix is diagonal). In this way, the formulation with the "diagonal" rescale differs from the formulation by Ijspeert because the latter has the term K ( g - x0 ) s. However, the properties are the same