icub-basic-demos
write_initial_ball_points.m
1 %I think this is the most up-to-date script to generate the initial ball points.
2 %generate points along two circumferences at 0.9 and 1.1 the radius of the actual ball.
3 
4 R=198/(2*pi) %ball radius.
5 R1=(1-0.20)*R; %ray for placing the internal points [mm]
6 R2=(1+0.20)*R; %ray for placing the external points [mm]
7 nPoints=50;
8 
9 t=0:(2*pi/nPoints):2*pi;
10 z=cos(t(1:nPoints));
11 y=sin(t(1:nPoints));
12 p1=R1*[zeros(1,nPoints);y;z];
13 p2=R2*[zeros(1,nPoints);y;z];
14 points=[p1,p2];
15 
16 ID=fopen('initial_ball_points_smiley_31mm_20percent.csv','w');
17 for(a=1:3)
18  for(b=1:nPoints*2)
19  fprintf(ID,'%f\n',points(a,b));
20  end;
21 end;
22 fclose(ID);