-
Notifications
You must be signed in to change notification settings - Fork 171
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
Using constraints in custom action models (Python) #1170
Comments
Thank you very much @cmastalli! I was able to create a constrained LQR by inheriting from However, I noticed the following: when I create a constrained LQR by inheriting from Here is an example:
Is there something wrong in what I am doing? |
Yes, this fixes the issue. Thank you! |
I would like to create a LQR model with linear constraints using the constraint management API of Crocoddyl v2, and it seems that I cannot create arbitrary constraints with my custom action model: indeed, my custom action model inherits from the abstract class
DifferentialActionModelAbstract
which does not accept any form of constraint model attribute.I also tried to specify the constraint bounds manually in my custom model, but found that setters were not binded in python.
Here is a piece of code illustrating what I am trying to do:
Hence it appears that in the current API, constraints can only be added as constraint models in the derived classes (e.g.
DifferentialActionModelFreeFwdDynamics
) which is limiting as it means that the user must define aStateMultibody
, which in turn implies to use a Pinocchio model.One potential way to address this would be to allow the constructor of
DifferentialActionModelAbstract
to take directly an abstractconstraint model. Alternatively, there could be additional bindings in order to specify the lower and upper bound of the constraints manually in a custom python action models inheriting from
DifferentialActionModelAbstract
.Is my understanding correct, and if so, is it possible to enhance the API accordingly ?
The text was updated successfully, but these errors were encountered: