meco-group / omg-tools

Optimal Motion Generation-tools: motion planning made easy
GNU Lesser General Public License v3.0
563 stars 97 forks source link

Should we add debugging functionality? #28

Open timmercy opened 8 years ago

timmercy commented 8 years ago

Maybe we should add an option to show which constraints are violated in the case of an infeasible problem?

rubenvanparys commented 8 years ago

ok maybe, but

jgillis commented 8 years ago

In my experience such information is valuable. Especially when you see ipopt during its iterations to struggle to meet some constraints. It can be a helpful way to spot mistakes in your formulation.

timmercy commented 8 years ago

Joris showed me once how to do this. If I recall correctly: Before solving: from casadi.tools import reportBounds solver.setOption('warn_initial_bounds', True) solver.setOption('constr_viol_tol', 1e-4) After soving: solver.reportConstraints() reportBounds(nlp.getOutput("g"),solver.getInput("lbg"),solver.getInput("ubg"), showNonViolating=False)

You get a list in which you can see which constraints are fulfilled and which are violated. The only downside is that you don't get the name of the constraint, so you have to couple your list to your optimization formulation.

Is this implementation still possible in CasADi 3.0 or are there any other/better ways to do this?

jgillis commented 8 years ago

well okay that method is lame; i'm sure you can do it better..

jgillis commented 8 years ago

(if you used casadi structures, you can easily request readable labels for all entries of g)

timmercy commented 8 years ago

Okay, I used this method indeed before CasADi structures were used

rubenvanparys commented 8 years ago

We do use casadi structs for constraints

Okay, I used this method indeed before CasADi structures were used

You are receiving this because you commented. Reply to this email directly or view it on GitHubhttps://github.com/meco-group/omg-tools/issues/28#issuecomment-213275143