Shinnnn
Shinnnn

Reputation: 99

Is there a verbose mode for trajectory optimization?

When we are calling functions like DirectCollocation, is there a way to see some progress in the middle (verbose mode)? I am not sure how helpful it is to check formulation errors. But just wondering :)

Upvotes: 1

Views: 150

Answers (1)

Hongkai Dai
Hongkai Dai

Reputation: 2766

There are two ways to monitor the progress

  1. You could add a visual call back function with prog.AddVisualizationCallback. If this callback function visualizes the trajectory, then you can monitor the visualization in every iteration of the optimizer.
  2. If you use Snopt solver, then you could ask the solver to print out statistics on each iteration. The pseudo-code looks like this
    std::string print_file_name="foo.txt";
    prog.SetSolverOption(SnoptSolver::id(), "Print file", print_file_name);
    SnoptSolver solver;
    const auto result = solver.Solve(prog, initial_guess);
    
    Then Snopt will print its statistics in each iteration to foo.txt.

Upvotes: 4

Related Questions