pyomeca / bioptim

An optimization framework that links CasADi, Ipopt, ACADOS and biorbd for Optimal Control Problem
MIT License
95 stars 47 forks source link

Value of ConstraintFcn cost print incorrect when the constraint is time based #874

Open Kev1CO opened 6 months ago

Kev1CO commented 6 months ago

The output of sol.print_cost() returns an incorrect value of ConstraintFcn.STATE_CONTINUITY or ConstraintFcn.CUSTOM when time is involved. This error comes from the solution.py file.

`class Solution:

 def _get_penalty_cost():
        for idx in range(le(penalty.node_idx)):
                t0 = PenaltyHelphers.t0(penalty, idx, lambda p, n: self._stepwise_time[p][n][0]`

self._stepwise_time[p][n][0] the [0] is where it creates a mistake