function ActualizaRobo( GP )


E1 = GP.obj.E1;
Hh = GP.obj.Hh;
Eh = GP.obj.Eh;
Jh = GP.obj.Jh;
Fh = GP.obj.Fh;
Sh = GP.obj.Sh;
Wh = GP.obj.Wh;
CG = GP.obj.CG;
CP = GP.obj.CP;
Cg = GP.obj.Cg;
hr = GP.obj.hr;




P = GP.def.P;
C = GP.def.C;
F = GP.def.F;
H = GP.def.H;
W = GP.def.W;
E = GP.def.E;
COG = GP.def.COG;
COG_mi2R = GP.def.COG_mi2R;

 
 %-- Superficie de contacto ---------------------------------------------------------------------------------------
 if (isfield(GP.def, 'T'))
     Th = GP.obj.Th;    % Tapete
     T = GP.def.T;
     set(Th,    'Xdata', T(1,:),...
                'Ydata', T(2,:),...
                'Zdata', T(3,:));   
 end
 
 if(isfield(GP.def, 'S'))
    Esh = GP.obj.Esh;   % escadas
    S = GP.def.S;
    set(Esh, 'Xdata', S(:,:,1),...
             'Ydata', S(:,:,2),...
             'Zdata', S(:,:,3),...
             'FaceVertexCData', S(1,:,4)'); 
 end
 if(isfield(GP.def, 'Sp'))
     Sph = GP.obj.Sph;   % Bola
     Sp = GP.def.Sp;
     set(Sph,'Xdata', Sp(:,:,1),...
             'Ydata', Sp(:,:,2),...
             'Zdata', Sp(:,:,3));
 end
 %-- Elos mecanicos: endoesqueleto ("stick diagram") ----------------
 refreshdata(E1, 'caller');  %-- Pernas
 %-- Elos mecanicos: exoesqueleto -----------------------------------
 for i=1:length(Eh), 
     set(Eh(i), 'XData', E(1,:,i),...
                'YData', E(2,:,i),...
                'ZData', E(3,:,i)), 
 end  
 %-- Juntas rotacionais ---------------------------------------------  
 for i=1:length(Jh), 
     set(Jh(i), 'Xdata', [C(1,:,i); C(2,:,i)],...
                'Ydata', [C(3,:,i); C(4,:,i)],...
                'Zdata', [C(5,:,i); C(6,:,i)]), 
 end     
 %-- Pe de suporte e pe livre --------------------------------------
 for i=1:length(Fh), 
     set(Fh(i), 'Xdata', F(1,:,i),...
                'Ydata', F(2,:,i),...
                'Zdata', F(3,:,i)), 
 end
 %-- Secçao da Anca -----------------------------------------------------------------------------------------------  
  for i=1:length(Fh), 
     set(Hh(i), 'Xdata', H(1,:,i),...
                'Ydata', H(2,:,i),...
                'Zdata', H(3,:,i)), 
  end
 %-- Secçao do Tronco ----------------------------------------------  
  for i=1:length(Fh), 
     set(Wh(i), 'Xdata', W(1,:,i),...
                'Ydata', W(2,:,i),...
                'Zdata', W(3,:,i)), 
  end  
 %-- Esfera na extremidade ----------------------------------------------------------------------------------------
  [X,Y,Z] = sphere(100);     %-- Esfera de raio unitario
    R = 0.025; X = R*X+P(28,1); Y = R*Y+P(28,2); Z = R*Z+P(28,3);
    set(Sh, 'Xdata', X,...
            'Ydata', Y,...
            'Zdata', Z)
  %-- COG -----------------------------------------------------------
      refreshdata(CG, 'caller');  %-- Pernas
      refreshdata(CP, 'caller');  %-- Pernas
      refreshdata(Cg, 'caller');  %-- Pernas
      
  drawnow