Reaches max iteration although within tolerance

Hi,

I’m using python interface and I’m running into an error of Exception: acados acados_ocp_solver returned status 2, which I read to have something to do with reaching maximum number of iteration. Here’s the stats printed out:

where my tolerances are set to be:

ocp.solver_options.levenberg_marquardt = 1e-2
    ocp.solver_options.regularize_method = 'PROJECT'
    ocp.solver_options.nlp_solver_type = 'SQP'
    ocp.solver_options.nlp_solver_max_iter = 50
    ocp.solver_options.qp_solver = 'PARTIAL_CONDENSING_HPIPM'
    ocp.solver_options.qp_solver_iter_max = 50
    ocp.solver_options.hessian_approximation = 'GAUSS_NEWTON'
    ocp.solver_options.integrator_type = 'ERK'  
    ocp.solver_options.sim_method_num_stages = 4
    ocp.solver_options.sim_method_newton_iter = 3
    ocp.solver_options.qp_solver_tol_stat = 1e-3
    ocp.solver_options.qp_solver_tol_eq = 1e-3
    ocp.solver_options.qp_solver_tol_ineq = 1e-6
    ocp.solver_options.qp_solver_tol_comp = 1e-3
    
    ocp.solver_options.print_level = 2  
    ocp.solver_options.warm_start = 1

    ocp.solver_options.nlp_solver_step_length = 0.9 # Smaller steps
    ocp.solver_options.globalization = 'MERIT_BACKTRACKING'
    ocp.solver_options.alpha_min = 0.2
    ocp.solver_options.alpha_reduction = 0.7

It seems like I’m not violating the tolerance, it there any reason I’m not able to exit the iterations?

Hi,

It seems that you only set the QP solver tolerances.
The acados SQP method checks the NLP solver tolerances, see e.g. Python Interface — acados documentation
The QP solver tolerances are used in the QP solver only.

Best,
Jonathan