Skip to content

Commit

Permalink
mex templates: checks on supported formulations
Browse files Browse the repository at this point in the history
  • Loading branch information
FreyJo committed Oct 10, 2019
1 parent eb21716 commit 0283cbc
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
%nlp_solver = 'sqp_rti';
%nlp_solver_exact_hessian = 'false';
nlp_solver = 'sqp'; % sqp, sqp_rti
nlp_solver_exact_hessian = 'true';
nlp_solver_exact_hessian = 'false';
regularize_method = 'project_reduc_hess'; % no_regularize, project,...
% project_reduc_hess, mirror, convexify
%regularize_method = 'mirror';
Expand Down
29 changes: 21 additions & 8 deletions interfaces/acados_matlab_octave/ocp_generate_c_code.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,27 @@ function ocp_generate_c_code(obj)
end
end

% add checks for
% 1) nonlinear least-squares (jeez)
% 2) Vz (already implemented?)
% 3) exact Hessian
% 4) external cost
% 5) GNSF
% 6) discrete dynamics

% add checks for
if ~strcmp( obj.model_struct.cost_type, 'linear_ls' ) || ...
~strcmp( obj.model_struct.cost_type_e, 'linear_ls' )
error('mex templating does only support linear_ls cost for now');
% TODO: add
% nonlinear least-squares
% external cost
elseif isfield( obj.model_struct, 'cost_Vz') && any(obj.model_struct.cost_Vz)
error('mex templating does not support nonzero cost_Vz for yet.');
% TODO add Vz (already implemented?)
elseif ~strcmp( obj.opts_struct.nlp_solver_exact_hessian, 'false')
error('mex templating does only support nlp_solver_exact_hessian = false, i.e. Gauss-Newton Hessian approximation for now.');
% TODO: add exact Hessian
elseif strcmp( obj.model_struct.dyn_type, 'discrete')
error('mex templating does only support continuous dynamics for now.');
% TODO: implement
elseif strcmp( obj.opts_struct.sim_method, 'irk_gnsf')
error('mex templating does not support irk_gnsf integrator yet.')
% TODO: implement
end

% set include and lib path
acados_folder = getenv('ACADOS_INSTALL_DIR');
obj.acados_ocp_nlp_json.acados_include_path = [acados_folder, '/include'];
Expand Down

0 comments on commit 0283cbc

Please sign in to comment.