grasp
All Data Structures Namespaces Functions Modules
drawResultsiCub.m
1 function drawResultsiCub(hand, x, xo, contactPoints, normals, imgpath)
2 
3  x1=contactPoints(:,1);
4  x2=contactPoints(:,2);
5 
6  normals=normals/100.0;
7 
8  img=figure;
9 
10  hold on;
11  plot3(x1(1),x1(2),x1(3),'*b','LineWidth',8.0);
12  plot3([x1(1) x1(1)+normals(1,1)], [x1(2) x1(2)+normals(2,1)], [x1(3) x1(3)+normals(3,1)], 'r');
13  plot3(x2(1),x2(2),x2(3),'*r','LineWidth',8.0);
14  plot3([x2(1) x2(1)+normals(1,2)], [x2(2) x2(2)+normals(2,2)], [x2(3) x2(3)+normals(3,2)], 'r');
15 
16  if (size(contactPoints,2)>2)
17  hold on;
18  x3=contactPoints(:,3);
19  plot3(x3(1),x3(2),x3(3),'*g','LineWidth',8.0);
20  plot3([x3(1) x3(1)+normals(1,3)], [x3(2) x3(2)+normals(2,3)], [x3(3) x3(3)+normals(3,3)], 'r');
21  end
22 
23  hold on;
24  plot3(xo(1),xo(2),xo(3),'og');
25 
26  %drawHandiCub(x,hand);
27  drawHandiCubCAD(x,hand);
28 
29  axis equal;
30  grid on;
31 
32  if (~isempty(imgpath))
33  saveas(img,imgpath,'fig');
34  end
35 end