Files
ar_basalt/thirdparty/opengv/matlab/helpers/perturb.m
2022-04-05 11:42:28 +03:00

12 lines
307 B
Matlab

function [t_perturbed,R_perturbed] = perturb(t,R,amplitude)
t_perturbed = t;
r = rodrigues(R);
for i=1:3
t_perturbed(i,1) = t_perturbed(i,1) + (rand-0.5)*2.0*amplitude;
r(i,1) = r(i,1) + (rand-0.5)*2.0*amplitude;
end
R_perturbed = rodrigues(r);
end