Skip to content

Commit

Permalink
mex example: add check when setting cost_Vx
Browse files Browse the repository at this point in the history
  • Loading branch information
FreyJo committed Oct 10, 2019
1 parent 0283cbc commit ee61954
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,12 @@
ocp.set('init_u', u_traj_init);
ocp.set('init_pi', pi_traj_init);

% modify numerical data for a certain stage
% use ocp.set to modify numerical data for a certain stage
some_stages = 1:10:ocp_N-1;
for i = some_stages
ocp.set('cost_Vx', Vx, i); % cost_y_ref, cost_Vu, cost_Vx, cost_W, cost_Z, cost_Zl,...
% cost_Zu, cost_z, cost_zl, cost_zu;
if strcmp( ocp.model_struct.cost_type, 'linear_ls')
ocp.set('cost_Vx', Vx, i);
end
end

% solve OCP
Expand Down

0 comments on commit ee61954

Please sign in to comment.