diff options
Diffstat (limited to 'SD-VBS/benchmarks/localization/src')
20 files changed, 0 insertions, 611 deletions
diff --git a/SD-VBS/benchmarks/localization/src/matlab/addEulNoise.m b/SD-VBS/benchmarks/localization/src/matlab/addEulNoise.m deleted file mode 100644 index 3d2ac76..0000000 --- a/SD-VBS/benchmarks/localization/src/matlab/addEulNoise.m +++ /dev/null | |||
| @@ -1,12 +0,0 @@ | |||
| 1 | function retQuat=addEulNoise(quat, STD) | ||
| 2 | n=size(quat,1); | ||
| 3 | |||
| 4 | % KVS: replacing randnWrapper(n,3) with rand(n,3) | ||
| 5 | gyro=randnWrapper(n,3)*STD; | ||
| 6 | |||
| 7 | norm_gyro=sqrt(sum(gyro.^2,2)); | ||
| 8 | angleAlpha=norm_gyro; | ||
| 9 | quatDelta=[cos(angleAlpha/2), gyro./(norm_gyro*ones(1,3)).*(sin(angleAlpha/2)*ones(1,3))]; | ||
| 10 | |||
| 11 | retQuat=quatMul(quat, quatDelta); | ||
| 12 | |||
diff --git a/SD-VBS/benchmarks/localization/src/matlab/calculate3DGaussian.m b/SD-VBS/benchmarks/localization/src/matlab/calculate3DGaussian.m deleted file mode 100644 index 060713a..0000000 --- a/SD-VBS/benchmarks/localization/src/matlab/calculate3DGaussian.m +++ /dev/null | |||
| @@ -1,11 +0,0 @@ | |||
| 1 | function [meanColor A]=calculate3DGaussian(data) | ||
| 2 | n_data=size(data,1); | ||
| 3 | n_channel=size(data,2); | ||
| 4 | meanColor=mean(data); | ||
| 5 | diff=double(data)-ones(n_data,1)*meanColor; | ||
| 6 | diifTr = transpose(diff); | ||
| 7 | Ainv=(diffTr*diff/n_data); | ||
| 8 | AinvTr = transpose(Ainv); | ||
| 9 | A=inv(AinvTr); | ||
| 10 | |||
| 11 | |||
diff --git a/SD-VBS/benchmarks/localization/src/matlab/drawLog.m b/SD-VBS/benchmarks/localization/src/matlab/drawLog.m deleted file mode 100644 index f88e078..0000000 --- a/SD-VBS/benchmarks/localization/src/matlab/drawLog.m +++ /dev/null | |||
| @@ -1,44 +0,0 @@ | |||
| 1 | function drawLog(data, ground_data) | ||
| 2 | subplot(1,3,1); | ||
| 3 | [nr nc]=size(data); | ||
| 4 | for i=1:nr | ||
| 5 | x=data(i,2); | ||
| 6 | y=data(i,3); | ||
| 7 | z=data(i,4); | ||
| 8 | R=[1 0 0; 0 cos(x) sin(x); 0 -sin(x) cos(x)]... | ||
| 9 | *[cos(y) 0 -sin(y); 0 1 0; sin(y) 0 cos(y)]... | ||
| 10 | *[cos(z) sin(z) 0; -sin(z) cos(z) 0; 0 0 1]; | ||
| 11 | coord=R*[1 0 0]'; | ||
| 12 | axis([-1 1 -1 1 -1 1]);axis on | ||
| 13 | plot3([0 coord(1)], [0 coord(2)], [0 coord(3)], 'b'); hold on | ||
| 14 | end | ||
| 15 | |||
| 16 | [nr nc]=size(ground_data); | ||
| 17 | for i=1:nr | ||
| 18 | x=ground_data(i,2); | ||
| 19 | y=ground_data(i,3); | ||
| 20 | z=ground_data(i,4); | ||
| 21 | R=[1 0 0; 0 cos(x) sin(x); 0 -sin(x) cos(x)]... | ||
| 22 | *[cos(y) 0 -sin(y); 0 1 0; sin(y) 0 cos(y)]... | ||
| 23 | *[cos(z) sin(z) 0; -sin(z) cos(z) 0; 0 0 1]; | ||
| 24 | coord=R*[1 0 0]'; | ||
| 25 | coord2=R*[0 -1 0]'; | ||
| 26 | axis([-1 1 -1 1 -1 1]);axis on | ||
| 27 | plot3([0 coord(1)], [0 coord(2)], [0 coord(3)], 'r'); hold on | ||
| 28 | plot3([0 coord2(1)], [0 coord2(2)], [0 coord2(3)], 'g'); | ||
| 29 | end | ||
| 30 | |||
| 31 | xlabel('x'); | ||
| 32 | ylabel('y'); | ||
| 33 | zlabel('z'); | ||
| 34 | hold off | ||
| 35 | drawnow | ||
| 36 | subplot(1,3,2); | ||
| 37 | Xoffset=4422610; | ||
| 38 | Yoffset=483660; | ||
| 39 | axis([4422610-Xoffset 4422660-Xoffset 483620-Yoffset 483720-Yoffset]);axis on | ||
| 40 | scatter(data(:,5)-Xoffset, data(:,6)-Yoffset, 8, 'b'); hold on | ||
| 41 | axis([4422610-Xoffset 4422660-Xoffset 483620-Yoffset 483720-Yoffset]);axis on | ||
| 42 | scatter(ground_data(:,5)-Xoffset, ground_data(:,6)-Yoffset, 10, 'r'); hold off | ||
| 43 | drawnow | ||
| 44 | |||
diff --git a/SD-VBS/benchmarks/localization/src/matlab/eul2quat.m b/SD-VBS/benchmarks/localization/src/matlab/eul2quat.m deleted file mode 100644 index 57001a8..0000000 --- a/SD-VBS/benchmarks/localization/src/matlab/eul2quat.m +++ /dev/null | |||
| @@ -1,9 +0,0 @@ | |||
| 1 | function retQuat=eul2quat(eulAngle) | ||
| 2 | x=eulAngle(:,1); | ||
| 3 | y=eulAngle(:,2); | ||
| 4 | z=eulAngle(:,3); | ||
| 5 | retQuat=[cos(x/2).*cos(y/2).*cos(z/2)+sin(x/2).*sin(y/2).*sin(z/2) ... | ||
| 6 | sin(x/2).*cos(y/2).*cos(z/2)-cos(x/2).*sin(y/2).*sin(z/2) ... | ||
| 7 | cos(x/2).*sin(y/2).*cos(z/2)+sin(x/2).*cos(y/2).*sin(z/2) ... | ||
| 8 | cos(x/2).*cos(y/2).*sin(z/2)-sin(x/2).*sin(y/2).*cos(z/2)]; | ||
| 9 | |||
diff --git a/SD-VBS/benchmarks/localization/src/matlab/generateSample.m b/SD-VBS/benchmarks/localization/src/matlab/generateSample.m deleted file mode 100644 index f3658f8..0000000 --- a/SD-VBS/benchmarks/localization/src/matlab/generateSample.m +++ /dev/null | |||
| @@ -1,25 +0,0 @@ | |||
| 1 | function [retQuat retVel retPos]=generateSample(w, quat, vel, pos, STDDEV_VEL, STDDEV_POS) | ||
| 2 | sampledXId=weightedSample(w); | ||
| 3 | |||
| 4 | rows = size(sampledXId, 1); | ||
| 5 | cols = size(sampledXId, 2); | ||
| 6 | |||
| 7 | if(cols > 1) | ||
| 8 | disp(123456); | ||
| 9 | end | ||
| 10 | |||
| 11 | % retQuat = zeros(rows, 1); | ||
| 12 | % retVel = zeros(rows, 1); | ||
| 13 | % retPos = zeros(rows, 1); | ||
| 14 | |||
| 15 | % for i=1:rows | ||
| 16 | % retQuat(i,1) = quat(sampleXId(i,1),1); | ||
| 17 | % retVel(i,1) = vel(sampleXId(i,1),1) + randnWrapper(1,1) * STDDEV_VEL; | ||
| 18 | % retPos(i,1) = pos(sampleXId(i,1),1) + randnWrapper(1,1) * STDDEV_POS; | ||
| 19 | % end | ||
| 20 | |||
| 21 | retQuat=quat(sampledXId,:); | ||
| 22 | retVel=vel(sampledXId,:);%+randnWrappern(n,3)*STDDEV_VEL; | ||
| 23 | retPos=pos(sampledXId,:);%+randnWrappern(n,3)*STDDEV_POS; | ||
| 24 | |||
| 25 | |||
diff --git a/SD-VBS/benchmarks/localization/src/matlab/get3DGaussianProb.m b/SD-VBS/benchmarks/localization/src/matlab/get3DGaussianProb.m deleted file mode 100644 index 6a54530..0000000 --- a/SD-VBS/benchmarks/localization/src/matlab/get3DGaussianProb.m +++ /dev/null | |||
| @@ -1,22 +0,0 @@ | |||
| 1 | function p=get3DGaussianProb(data, mean, A) | ||
| 2 | n_data=size(data,1); | ||
| 3 | n_channel=size(data,2); | ||
| 4 | |||
| 5 | p=zeros(n_data,1); | ||
| 6 | diff=(data)-ones(n_data,1)*mean; | ||
| 7 | detA = 1; %detA = det(A) | ||
| 8 | dotA = randWrapper(size(diff,1),1); %dotA = dot(diff*A, diff, 2) | ||
| 9 | p=sqrt(detA/((2*pi)^n_channel))*exp(-0.5*dotA); | ||
| 10 | |||
| 11 | %% KVS If the above doesnt work, try uncommenting these lines below | ||
| 12 | |||
| 13 | %%temp = (det(A)/((2*pi)^n_channel)); | ||
| 14 | %temp = (1.0/((2*pi)^n_channel)); | ||
| 15 | %temp1 = dot(diff*A,diff,2); | ||
| 16 | %%temp1 = rand(1000,1); | ||
| 17 | %temp2 = exp(-0.5*temp1); | ||
| 18 | %p = sqrt(temp) * exp(temp2); | ||
| 19 | % | ||
| 20 | |||
| 21 | |||
| 22 | |||
diff --git a/SD-VBS/benchmarks/localization/src/matlab/getGroundData.m b/SD-VBS/benchmarks/localization/src/matlab/getGroundData.m deleted file mode 100644 index 7cf5f9c..0000000 --- a/SD-VBS/benchmarks/localization/src/matlab/getGroundData.m +++ /dev/null | |||
| @@ -1,5 +0,0 @@ | |||
| 1 | function retData=getGroundData(data, tStamp) | ||
| 2 | idx=find(data(:,1)==tStamp); | ||
| 3 | retData=data(idx,:); | ||
| 4 | |||
| 5 | |||
diff --git a/SD-VBS/benchmarks/localization/src/matlab/mcl.m b/SD-VBS/benchmarks/localization/src/matlab/mcl.m deleted file mode 100644 index 8ab8aa6..0000000 --- a/SD-VBS/benchmarks/localization/src/matlab/mcl.m +++ /dev/null | |||
| @@ -1,9 +0,0 @@ | |||
| 1 | function [retX, retW]=mcl(x,sData, invCov) | ||
| 2 | %instead of using importance resampling, I assumed 3D gaussian for each | ||
| 3 | %particle | ||
| 4 | %retX=x+randn(nr,nc)*(invCov^-1); %add noise | ||
| 5 | retX=x; | ||
| 6 | retW=get3DGaussianProb(retX, sData, invCov); | ||
| 7 | retW=retW/sum(retW); | ||
| 8 | |||
| 9 | |||
diff --git a/SD-VBS/benchmarks/localization/src/matlab/mclWhole.m b/SD-VBS/benchmarks/localization/src/matlab/mclWhole.m deleted file mode 100644 index 4e78b8f..0000000 --- a/SD-VBS/benchmarks/localization/src/matlab/mclWhole.m +++ /dev/null | |||
| @@ -1,18 +0,0 @@ | |||
| 1 | function retW=mclWhole(quat, Ovel, STDDEV_GPSVel, accl, STDDEV_ACCL) | ||
| 2 | n=size(quat,1); | ||
| 3 | OvelNorm=norm(Ovel); | ||
| 4 | if (OvelNorm>0.5) | ||
| 5 | Ovel=Ovel/norm(Ovel); | ||
| 6 | %trick | ||
