Closed aristotpap closed 1 month ago
@aristotpap -- Also, do not forget to update our changelog.
Hi @cmastalli,
Thank you for the suggestions. I can definitely create a private member for g_adj
, however we need to consider whether we want or not dynamic allocation during the calculations. A situation like this may arise if certain action models have different numbers of constraints. In these situations we have two alternatives as I see it:
Dynamically resize the vector like below:
g_adj_.resize(models[t]->ng).setZero()
Find the maximum constraint dimension during the construction of the Shooting Problem and use part of the pre-allocated vector for the feasibility calculations, as below:
g_adj_.resize(max_ng).setZero() # During the Construction of the Shooting Problem
...
...
g_adj_.head(models[t]->ng) # Use during the calculations with models[t] -> ng <= max_ng
Let me know what you prefer according to Crocoddyl's requirements.
I don't like the idea of using a "max dimension". It seems to me that the best implementation is when we create a list of g_adj_
items and resize them when needed.
We have defined a resizeData
function that is called every time the shooting problem is changed. Our MPC highly depends on it. For more details see: https://github.com/loco-3d/crocoddyl/blob/devel/src/core/solver-base.cpp#L68-L79.
Note that resizeData
is a virtual function that can be specialized for any solver.
Hello @cmastalli,
I have implemented the requested changes and updated the CHANGELOG.md
in the most recent commit. Let me know if there is anything else that requires my attention.
This pull request introduces a refinement to the calculation of the inequality feasibility by adding the inequality bounds to the calculation. The update ensures that when a constraint is within its specified bounds, its feasibility is considered 0. Only if the constraint exceeds the bounds, its feasibility is greater than zero.