changliuliu / TemporalOptimization

Speed profile planning via temporal optimization
MIT License
31 stars 17 forks source link

The CFS reports errors #4

Open KailinTong opened 3 years ago

KailinTong commented 3 years ago

Thank you very much for your contribution!

I got this error when I try to run CFS. I use MATLAB R2019b.

The problem is infeasible.

During presolve, quadprog found the constraints to be inconsistent 
to within the constraint tolerance.

Index exceeds the number of array elements (0).

Error in temporal_opt (line 84)
        reftnew = soln(1:nstep-1);

Do you have any suggestions?

Thank you very much!

changliuliu commented 3 years ago

Is your soln an empty array? You need to check the formulation of your QP to ensure feasibility.

KailinTong commented 3 years ago

In the cloned code, this part (line 79 to line 82) was commented. Should it be like this? Thank you!

% [~,Aeq,beq] = t2y_lin(reft,path,theta,vref,[v0;0],delta/v0); % soln = quadprog(Q,[],A,b,Aeq,beq); % soln_lin = quadprog(Q,[],A,b,L(1:5(nstep-1),:),S(1:5(nstep-1))); % soln_lin = quadprog(Q,[],A,b,L(5(nstep-1)+1:end,:),S(5(nstep-1)+1:end));

changliuliu commented 3 years ago

in line 77, it is solving a QP. You may want to check whether the constraint in 'Lstack' and 'Sstack' makes sense.

soln = quadprog(Q,[],Lstack,Sstack);
SaulGoodmanCN commented 3 years ago

same problem with original codes:

temporal_opt

yaxis =

Columns 1 through 25

 0     2     4     6     8    10    12    14    16    18    20    22    24    26    28    30    32    34    36    38    40    42    44    46    48

Columns 26 through 34

50    52    54    56    58    60    62    64    66

Solver stopped prematurely.

quadprog stopped because it exceeded the iteration limit, options.MaxIterations = 200 (the default value).

Minimum found that satisfies the constraints.

Optimization completed because the objective function is non-decreasing in feasible directions, to within the default value of the optimality tolerance, and constraints are satisfied to within the default value of the constraint tolerance.

Minimum found that satisfies the constraints. Optimization completed because the objective function is non-decreasing in feasible directions, to within the default value of the optimality tolerance, and constraints are satisfied to within the default value of the constraint tolerance. Minimum found that satisfies the constraints. Optimization completed because the objective function is non-decreasing in feasible directions, to within the default value of the optimality tolerance, and constraints are satisfied to within the default value of the constraint tolerance. Solver stopped prematurely. quadprog stopped because it exceeded the iteration limit, options.MaxIterations = 200 (the default value). No feasible solution found. quadprog stopped because it was unable to find a point that satisfies the constraints within the default value of the constraint tolerance. The problem is infeasible. During presolve, quadprog found the constraints to be inconsistent to within the constraint tolerance. Index exceeds the number of array elements (0). Error in temporal_opt (line 84) reftnew = soln(1:nstep-1);