diff --git a/org/functions.org b/org/functions.org index 459328d..0f43872 100644 --- a/org/functions.org +++ b/org/functions.org @@ -48,7 +48,7 @@ :END: <> -This Matlab function is accessible [[file:src/computeReferencePose.m][here]]. +This Matlab function is accessible [[file:..//src/computeReferencePose.m][here]]. #+begin_src matlab function [WTr] = computeReferencePose(Dy, Ry, Rz, Dh, Dn) @@ -129,6 +129,7 @@ This Matlab function is accessible [[file:src/computeReferencePose.m][here]]. WTr = Rty*Rry*Rrz*Rh*Rn; end #+end_src + * Compute the Sample Position Error w.r.t. the NASS :PROPERTIES: :header-args:matlab+: :tangle ../src/computeSampleError.m @@ -136,7 +137,7 @@ This Matlab function is accessible [[file:src/computeReferencePose.m][here]]. :END: <> -This Matlab function is accessible [[file:src/computeSampleError.m][here]]. +This Matlab function is accessible [[file:..//src/computeSampleError.m][here]]. #+begin_src matlab function [MTr] = computeSampleError(WTm, WTr) diff --git a/src/computeSampleError.m b/src/computeSampleError.m new file mode 100644 index 0000000..5c42696 --- /dev/null +++ b/src/computeSampleError.m @@ -0,0 +1,20 @@ +function [MTr] = computeSampleError(WTm, WTr) +% computeSampleError - +% +% Syntax: [MTr] = computeSampleError(WTm, WTr) +% +% Inputs: +% - WTm - Homoegeneous transformation that represent the +% wanted pose of the sample with respect to the granite +% - WTr - Homoegeneous transformation that represent the +% measured pose of the sample with respect to the granite +% +% Outputs: +% - MTr - Homoegeneous transformation that represent the +% wanted pose of the sample expressed in a frame +% attached to the top platform of the nano-hexapod + +MTr = zeros(4,4); + +MTr = [WTm(1:3,1:3)', -WTm(1:3,1:3)'*WTm(1:3,4) ; 0 0 0 1]*WTr; +end