Comments (10)
Hi, can you explain the reasoning for using this equation for the time-to-phase mapping?
According to Ijspeert et al. (2013), the differential equation
You should be able to verify this by computing the derivative of the equation given by the function above.
edit: For reference, this is the derivation of the direct solution:
The Python function defines
Then we can compute the derivative
Let's call
When
according to Wolfram Alpha. :)
Hence, combined with the equation before, we can write
which is the definition of the phase variable.
from movement_primitives.
Also, can you explain the reasoning for the canonical system alpha's calculation? I did not manage to find any literature that explain this
Using the formula from the first code snippet, you can compute the alpha that reaches a specific phase value after the execution time. This is what the function does.
edit: For reference, this is the derivation of the formula.
The direct mapping from time to phase is (just like before)
Let's say we want to reach some constant
The solution is
The code is a bit different because it uses n_phases
from movement_primitives.
Hi, can you explain the reasoning for using this equation for the time-to-phase mapping?
According to Ijspeert et al. (2013), the differential equation τx˙=−αxx describes the evolution of the phase variable x (I use the name z in the code). Starting from the initial phase value x0=1, the phase value converges monotonically to zero. Instead of using the iterative procedure to calculate the current value of x, it is computed directly with the equation in this code.
You should be able to verify this by computing the derivative of the equation given by the function above.
Using Ijspeert's assumption, shouldn't the solution be an exponential function?
from movement_primitives.
Also, can you explain the reasoning for the canonical system alpha's calculation? I did not manage to find any literature that explain this
Using the formula from the first code snippet, you can compute the alpha that reaches a specific phase value after the execution time. This is what the function does.
Would it be possible to compute the alpha using an exponential time-phase mapping?
from movement_primitives.
Would it be possible to compute the alpha using an exponential time-phase mapping?
That's what is done here. I don't think I understood the question.
from movement_primitives.
Using Ijspeert's assumption, shouldn't the solution be an exponential function?
I missed this reply. That seems to be indeed a way simpler form to express the same thing. However, I used the other version for such a long time that I am a bit worried about breaking anything, when changing the code. I would have to do an analysis of the numerical stability.
edit: For reference,
(I have no proof though.)
from movement_primitives.
There are some edge cases, in which the exponential mapping does not behave so nicely:
import numpy as np
from movement_primitives.dmp._canonical_system import canonical_system_alpha, phase
import matplotlib.pyplot as plt
execution_time = 1e3
int_dt = 1e2
alpha_z = canonical_system_alpha(goal_z=1e-10, goal_t=execution_time, start_t=0.0, int_dt=int_dt)
print(alpha_z)
t = np.linspace(0.0, execution_time, 10000)
z = phase(t, alpha_z, goal_t=execution_time, start_t=0.0, int_dt=int_dt)
z2 = np.exp(-alpha_z * t / execution_time)
print(z[-1])
print(z2[-1])
plt.plot(t, z, label="old")
plt.plot(t, z2, ls="--", label=r"$\exp \frac{-\alpha_z t}{\tau}$")
plt.xlabel(r"t ($\tau=" + str(execution_time) + r"$)")
plt.ylabel("$z$")
plt.legend(loc="best")
plt.show()
The exponential mapping approaches the desired target value very slowly and doesn't reach it for some reason.
from movement_primitives.
I thought about it again. When I use
from movement_primitives.
Hi thanks for addressing this issue. May I know how we can pull this update?
from movement_primitives.
After cloning the git repository, checkout the branch refactor/time_to_phase_mapping
. Let me know if you have any issue with this implementation.
It will soon be merged to main.
from movement_primitives.
Related Issues (20)
- Integrate ProDMPs
- Doubt about variable 'execution_time' HOT 3
- Which variation of DMPs is implemented? HOT 1
- Phase and forcing_term are not updated inside dmp_open_loop() HOT 6
- Release 0.6.0
- Doubt about implementation of DMP HOT 9
- Implement forcing term in Cython
- Obstacle avoidance
- Release 0.7.0
- Implement pose coupling in Cython
- coupling terms not matching the equation in article HOT 1
- Not able to run the tests HOT 3
- JOSS suggestion: Update Copyright year in LICENSE HOT 1
- JOSS suggestion: Statement of need HOT 1
- JOSS suggestion: Summary HOT 1
- JOSS suggestion: Add statement of need to documentation HOT 1
- Smooth scaling not matching equation in literature HOT 6
- Release 0.8.0
- Question for sequential activation of DMPs for multiple subtasks HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from movement_primitives.