loco-3d / crocoddyl

Crocoddyl is an optimal control library for robot control under contact sequence. Its solver is based on various efficient Differential Dynamic Programming (DDP)-like algorithms
BSD 3-Clause "New" or "Revised" License
841 stars 172 forks source link

Exiting solver based on timeout #1163

Closed will-gerard closed 1 year ago

will-gerard commented 1 year ago

We are looking to limit the length of time the DDP solver can run for. I see that we can change max iters from the default of 100 by passing the parameter to the solve function, and also it appears we can change the exit tolerance via set_th_stop if I am understanding correctly. There does not appear to be any setting which results in a timeout for the solver. At first I thought doing something to stoppingCriteria would do it, but I don't see any way to change the functionality of this other than extending with a new solver class. I just was hoping to double check and see that I am not missing anything - is this accurate?

cmastalli commented 1 year ago

Hi @will-gerard,

Crocoddyl solvers don't use timings to interrupt the computation. However, this is something that I could implement shortly. In the meantime, I am keen to hear from you more about your requirements.

There are a few design choices to be made when introducing this feature. For instance, we can check timings once per loop, twice (backward and forward passes) or even more. There are also different choices for measuring time: real, user, system, or, hopefully not, wall clock with different precisions. I am also particularly concerned with overheads, and honestly, I am not super clear on this topic yet.