1

As a followup from this post, I've successfully passed in "Time limit" through Drake and into Snopt. I've verified this by checking the output debug file that Snopt generates, and see that my specified time limit was set.

However, I notice that Snopt often exceeds my time limit (ex: specified time limit of 0.5s, but actual runtime was 1s). This is actually documented in Snopt, since the time limit is "only checked every 20 minor iterations".

I'm purely looking for advice from those who have worked with Snopt: are there any tricks to employ that can force Snopt to stay closer to the time limit? One immediate idea is to run the solver in a separate thread that is killed at the time limit, but are there any other tricks using parameters or modifying the optimization problem? I'm trying to solve IK for a 7DOF arm with self-collision avoidance.

alvin
  • 137
  • 7

1 Answers1

0

I ran into the sameproblem, and apprently you have to set a second option to make the time limit work (https://discuss.ampl.com/t/time-limit-with-snopt-and-minos-solvers/418):

options.SetOption(solver.solver_id(), "time limit", 0.1)
options.SetOption(solver.solver_id(), "timing level", 3)

It seems to be the 3 is the default but somehow we have to set it again.

Super Kai - Kazuya Ito
  • 22,221
  • 10
  • 124
  • 129
Franek Stark
  • 37
  • 1
  • 7