0
solver = SnoptSolver()
options = SolverOptions()
options.SetOption(solver.id(), "Time limit", 2)
options.SetOption(solver.id(), "Major iterations limit", 200)
options.SetOption(solver.id(), "Minor iterations limit", 100)

result = solver.Solve(prog, None, options)

I've been using the above code to try to limit the Snopt iterations, but it is having no noticeable effect on the runtime. It still takes up to 25 seconds. Am I setting the limit correctly?

  • Don't know Drake, but I usually inspect the SNOPT log file to see why it stopped. – Erwin Kalvelagen Dec 05 '21 at 18:15
  • Could you add the print file with options.SetOption(solver.id(), "Print file", "my_print.out")? Then you can check the print file `my_print.out` and see what happens. – Hongkai Dai Dec 05 '21 at 18:31

0 Answers0