function    [factorLat, factorLon] = calibra(H, scuId) 

    offSet1 = readjoint(H,scuId,0);
    offSet2 = readjoint(H,1,0);
    
    % calibração longitudinal
        
        factor = getfactor(H, 3, 3, [70 -70], offSet1);

        factorLon = mean(factor);
        
pause(3)
    
    % calibração lateral
    
        factor = getfactor(H, 1, 1, [70 -70], offSet2);

        factorLat = mean(factor);
    
pause(3)
    
return
    
    
    
function factor = getfactor(H, scuId, sensor, gama, offSet)
        
        for i=1:2,
            applyjoint(H,scuId,0,([gama(i) 0 0]+offSet));
            pause(3)
            s = readspecial(H,3)
            s=s(sensor)
            factor(i) = rad2deg(sin(deg2rad(gama(i)/2.5)))/(s-128)
        end
        
        applyjoint(H,scuId,0,offSet);
        
return