Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generalization of dmp learning for multiple trajectory #76

Open
akhilkanduri opened this issue Sep 16, 2022 · 3 comments
Open

Generalization of dmp learning for multiple trajectory #76

akhilkanduri opened this issue Sep 16, 2022 · 3 comments

Comments

@akhilkanduri
Copy link

akhilkanduri commented Sep 16, 2022

Hi great package and thank you,

I want to know if there is also a feature to train with multiple trajectories and generalize the task,
example: if i change goal position then the similar trajectory must be applied for that condition.

Is it possible with this package?

@stulp
Copy link
Owner

stulp commented Sep 16, 2022

Thanks for the feedback!

This functionality is known as "Contextual DMPs", a term introduced by Jan Peter's group uses. Other groups call it "parameterized skills" (Konidaris) or DMPs with "style parameters" (Matsubara). I used to use "parameterized skills" also (https://ieeexplore.ieee.org/abstract/document/7030008), but prefer the term "Contextual DMPs" now.
https://github.com/stulp/dmpbbo/blob/v1.0.0/docs/dmp.bib

Contextual DMPs were available in C++ in v1.0 of dmpbbo:
https://github.com/stulp/dmpbbo/blob/v1.0.0/src/dmp/DmpContextual.hpp
This is the demo you are looking for, i.e. adapting the goal to a task parameter:
https://github.com/stulp/dmpbbo/blob/v1.0.0/demos_cpp/dmp/demoDmpContextualGoal.cpp

This code still needs to be ported to the new and more flexible Python/C++ approach in v2.0 (I do not recommend using v1.* anymore). As this is a pet project and time is a limited resource, I only do such porting when someone asks for it (as you have done now :-)

It shouldn't be too much work in principle, but let me ask some questions before starting:

  • Are you interested in a Python version only? (should be easy) Or also the corresponding C++ implementation for real-time execution? (would take longer)
  • Within what time frame would this functionality be useful for you? A week? A month?
  • Would you be interested in contributing? I.e. with code? Or a code review?

If you're motivated to do a code review, I'd be motivated to code it within a week or two. (no promises though...)

(it has been on the stack for a while #69)

@akhilkanduri
Copy link
Author

Hey. Thanks for quick correspondence.

Re: Are you interested in a Python version only?
Yes I am solely using python versions.

I am currently using it in my project and I am trying to implement it in a week. By tweaking the code for demo, I am able to change initial condition for y state and reach trained trajectory goal. But if i change the attractor state there is a problem in integration. I have tried to implement something like this https://h2t.anthropomatik.kit.edu/pdf/Zhou2017.pdf and also
https://www.cmpe.boun.edu.tr/~emre/papers/Ugur-2020-ROB.pdf but i am stuck. I would be grateful for any help
I am definitely interested in a contributing.

I hope you find some time for this.

@stulp
Copy link
Owner

stulp commented Sep 17, 2022

I'll will not be able to implement this it in a week, but I can give you some pointers.

What do you mean "there is a problem in integration"? Do you mean scaling issues because of choosing an inappropriate frame of reference, as illustrated in Figure 14 in https://homes.cs.washington.edu/~todorov/courses/amath579/reading/DynamicPrimitives.pdf

In the Zhou2017 paper they use LWR. In general I prefer RBFN: simpler, and better properties for subsequent optimization, should it be needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants