WaterlooRobotics / mobilerobotics

Matlab and Robot code for MTE 544: Autonomous Mobile Robotics at the University of Waterloo
66 stars 38 forks source link

I23 nonlinear programming #55

Closed neginlashkari closed 8 years ago

neginlashkari commented 8 years ago

Summary of code improvements:

Changes have been done on main codes in order to:

1- Combine all figures in one place to run the animation 2- Save a .GIF file from final animation in the current path 3- Change the vehicle model to a two-wheeled car 4- Add velocity constraint of robot 5- Use Bezier curves to generate random desired trajectory 6- Display if the problem has feasible solution using exit flag

yshiyi commented 8 years ago

fig2 I see you have changed the vehicle model to a two-wheeled car. Then there is a problem. You may see it form the figure above. The edge of the car and the edge of the obstacle are overlapping. Maybe add a constraint of the minimum distance between the center of the car and the edge of the obstacle.

yshiyi commented 8 years ago

fig1 fig3 I've got two fail results which are shown in the above figures. I guess the reason is that the "fmincon" function doesn't always result a optimal solution. I am trying to find out what the exact reason for this failure is and will let you know if I've got anything.

yshiyi commented 8 years ago

fig4 I've also got this error message. Because "fmincon" fails again, I guess.

yshiyi commented 8 years ago

In addition, please consider commenting on that each of state represents for. It is a good idea to use Bezier curves to generate the desired trajectory. Overall, I think it is a good work. It looks clean and neat. In the end, please check the cases I list above.

stevenwaslander commented 8 years ago

It would be best to remove the animation, but to place an example code to generate the animation in the 01-examples-lecture folder. Move the function that does the optimization to the planning folder, and any common tools like bezier curve generation to the utilities folder.

You'll also need to resolve the merge conflict locally (figure out what conflicts, and then fix it and commit the fix locally, then push the commit to your branch on the remote (github)).

stevenwaslander commented 8 years ago

Please add comments throughout the code explaining what you are doing, especially when it comes to indexes in this problem.

stevenwaslander commented 8 years ago

Windows needs lower-case fmincon, upper case fails.

When I switch, I get the following indexing error every time. Subscripted assignment dimension mismatch.

Error in constraints (line 28) C(ind_end+1,1)=x(4)-vd_cnst;

Error in @(x)constraints(x)

Error in fmincon (line 632) [ctmp,ceqtmp] = feval(confcn{3},X,varargin{:});

Error in nonlinearplan (line 105) [X,FVAL,EXITFLAG,OUTPUT,LAMBDA] = fmincon(@(x) cost(x),x0,A,B,Aeq,Beq,LB,UB,@(x) constraints(x), options);

Caused by: Failure in initial user-supplied nonlinear constraint function evaluation. FMINCON cannot continue.

stevenwaslander commented 8 years ago

Have modified code and merged directly into master. This pull request pushes changes the wrong way.