Replies: 2 comments 1 reply
-
When having hybrid events, it is always convenient to update the warm start. For instance, it is better to shift the previous solution. However, we could agree on an API to accommodate our requirements. Could you elaborate on an API proposal that potentially doesn't break actual code? Writing a Python pseudo-code would be helpful. I have some ideas but prefer to hear from you first. Thanks! |
Beta Was this translation helpful? Give feedback.
-
Hi, sorry for the delay. I was thinking about overloading the virtual bool solve(const std::size_t maxiter, const bool is_feasible,
const double init_reg)
{
// I skip the setCandidate
if (std::isnan(init_reg)) {
preg_ = reg_min_;
dreg_ = reg_min_;
} else {
preg_ = init_reg;
dreg_ = init_reg;
}
// ... the rest of the current solve method
} Then, the current version of the method would use the one defined above as: solve(const std::vector<Eigen::VectorXd>& init_xs,
const std::vector<Eigen::VectorXd>& init_us,
const std::size_t maxiter = 100, const bool is_feasible,
const double init_reg)
{
setCandidate(init_xs, init_us, is_feasible);
solve(maxiter, is_feasible, init_reg);
} The only problem I see with this approach is that right now, all parameters in the solve method are defaulted, and I think the compiler cannot resolve the overloading. |
Beta Was this translation helpful? Give feedback.
-
I am using Crocddyl solvers to run MPC controllers. One common case within the MPC use is to use the previous iteration solution as a warm start for the current call to solve(). In Crocoddyl's solvers, I can only see one signature of the
solve
method, which requires passing a vector with the initial state and control trajectories. This method immediately copies the warm start trajectories via thesetCandidate()
function.I think it would be interesting to overload the
solve
method so that init_xs and init_us are not required and that the directly starts iterating with the values contained withinxs_
andus_
.I couldn't find this feature, but I am willing to implement it. If this issue could be tackled with the current API, I would appreciate a little guidance! Thank you!
Beta Was this translation helpful? Give feedback.
All reactions