ethz-adrl / towr

A light-weight, Eigen-based C++ library for trajectory optimization for legged robots.

Home Page:http://wiki.ros.org/towr

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use SoftConstraint

mpowelson opened this issue · comments

I'm interested in using the SoftConstraint. However, it is not apparent to me how I add it to an ifopt Problem since AddCostSet takes a CostTerm::Ptr, and this is inherits directly from Component.

To that end, I have tried to implement my own Cost in a similar fashion that takes a Constraint and converts it to a cost. However, the jacobian seems a bit problematic since GetJacobian is marked final and FillJacobianBlock is private in Constraint. It seems like my only option is to get the full constraint jacobian and then manually convert that back into something I can use inside my Cost's FillJacobianBlock. Any insight would be appreciated.

I'm interested in using the SoftConstraint. However, it is not apparent to me how I add it to an ifopt Problem since AddCostSet takes a CostTerm::Ptr, and this is inherits directly from Component.

To that end, I have tried to implement my own Cost in a similar fashion that takes a Constraint and converts it to a cost. However, the jacobian seems a bit problematic since GetJacobian is marked final and FillJacobianBlock is private in Constraint. It seems like my only option is to get the full constraint jacobian and then manually convert that back into something I can use inside my Cost's FillJacobianBlock. Any insight would be appreciated.

Hi, have you known how to use soft constraints?

I never got that working. My best guess is that it was a feature that used to work and got stale. I reimplemented the idea in my project here. It takes an arbitrary constraint and converts it into a squared cost.

@mpowelson yes! It is good to help me understand them, thanks very much!