1 function vec=ros2vec(ros)
2 % from the ros values in 8 directions make vector representation
16 plot([xx(i,j)],[yy(i,j)],'*k')
20 tt=linspace(0,9/4,10)*pi;
22 pp = csape(tt,rr,'periodic');
23 fpolarplot([0,0],@(theta)ppval(pp,theta),500,'-r');
25 % find the vector xs,yz of largest spread
26 % X(i,j)*xs + Y(i,j)*ys = r(i,j)-omni
27 %A = [X(:),Y(:)]; A(5,:)=[];
28 %b = r(:)-omni; b(5)=[];
30 %f = @(theta)2*omni+v(1)*cos(theta)+v(2)*sin(theta);
35 function H=fpolarplot(center,f,np,LineSpec)
36 % H=radplot(center,f,np,style)
40 % adapted from https://www.mathworks.com/matlabcentral/fileexchange/2876-draw-a-circle
41 theta=linspace(0,2*pi,np);
43 [x,y]=pol2cart(theta,rho);