How to convert joint angles into b spline?

I have to represent x (2 x n), joint angles and u (1 x n-m), control input using cubic B-splines and the solve the motion optimisation problem. I tried using the function csapi to convert them into spline form. However the optimisation function could not read the data type of the spline. I tried with fmincon and lsqnolin. Both gave the same error. Did i miss out something or the function i used is unsuitable?

2 Comments

Show us the objective function and constraints as you implemented them.
Hi, here is the code i tried. is there a way to convert a 1xn matrix into bspline? i receive this early while compiling.
??? Error using ==> vertcat The following error occurred converting from double to struct: Error using ==> struct Conversion to struct from double is not possible.
Error in ==> twoD_Model at 53 initial_guess = [x(:); U1(:)];
x=csapi(x(1,:),x(2,:));
initial_guess = [x(:); U1(:)];
[q2,p2] = size(U1);
[q1,p1] = size(initial_guess);
options = optimset('Algorithm','sqp');
lb=-pi;
ub=pi;
f = @(O)objective(O,m,T,A,a,B1,n,q1,p2,J,E,b); %constriants and dynamic
[O,fval] = fmincon(f,initial_guess,[],[],[],[],lb,ub,@confun,options)

Sign in to comment.

Answers (0)

Asked:

on 27 Nov 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!