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

Add constraints to control and/or state #11

Open
monabf opened this issue May 24, 2019 · 2 comments
Open

Add constraints to control and/or state #11

monabf opened this issue May 24, 2019 · 2 comments

Comments

@monabf
Copy link

monabf commented May 24, 2019

Hi,

Thanks a lot for the great repo! Clean implementation of iLQR and easy to understand, it's really useful.

I have a question though: would it be possible to constrain the possible values of the control input u that is returned by the optimization procedure? Like we want to pick the optimal control trajectory, but inside of some bounds on the values that are outputted by the algorithm. I'm happy to implement it myself if you know where/how it should be done, but I can't figure it out yet.

Let me know if you have any idea how to do that!

@anassinator
Copy link
Owner

anassinator commented May 25, 2019

Thanks!

The cartpole and pendulum notebooks in examples/ actually constrain the action space through a squashing function tanh(u) with iLQR. I believe something similar could work for constraining state. Unfortunately, this is neither an idiomatic nor ideal solution due to potentially vanishing gradients, but that's the best we can do within the limitations of iLQR.

Another option is to implement something like BoxQP that can deal with this more explicitly. I would gladly accept an implementation of that. It would probably fit well as another implementation of BaseController separate from the iLQR controller.

@monabf
Copy link
Author

monabf commented May 26, 2019

Thanks for your reply!
I read the paper, indeed their solution seems to be better than squashing or clamping. However I don't have time to implement it right now, I might try later, but for now I'll just use squashing as you do in the cartpole example. Hopefully it will be enough for my applications ! Otherwise I'll let you know.

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