File: perturb.m

package info (click to toggle)
opengv 1.0%2B1git91f4b1-8
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 5,484 kB
  • sloc: cpp: 45,813; python: 152; makefile: 17; xml: 13; sh: 4
file content (12 lines) | stat: -rw-r--r-- 307 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
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