Commit 922758a3 authored by fpa's avatar fpa

changed treatment of NaN entries, are now preserved

parent 5cc1c170
......@@ -40,7 +40,7 @@ classdef itaOrientation
% ita_vu2quat, ita_vu2rpy, itaOptitrack
%
% Author: Florian Pausch, fpa@akustik.rwth-aachen.de
% Version: 2016-05-09
% Version: 2018-05-04
%
% <ITA-Toolbox>
% This file is part of the ITA-Toolbox. Some rights reserved.
......@@ -205,7 +205,7 @@ classdef itaOrientation
% set quat, nPoints x 4 [double]
if ~isa(value,'quaternion')
assert( isequal(size(value,2),4),['Size of input must be ',num2str(this.nPoints),' x 4 [double].'])
if size(value,1)~=this.nPoints;
if size(value,1)~=this.nPoints
fprintf('[\b[itaOrientation]\tSize of input does not match %d x 4.]\b\n',this.nPoints)
fprintf('[\b\t\t\t\t\tSize of class object is changed.]\b\n')
end
......
......@@ -28,7 +28,7 @@ function [r, p, y] = ita_vu2rpy(v, u)
%
% Authors: Florian Pausch, Jonas Stienen
% e-Mail: {fpa, jst}@akustik.rwth-aachen.de
% Version: 2016-04-07
% Version: 2018-04-05
%
% <ITA-Toolbox>
% This file is part of the ITA-Toolbox. Some rights reserved.
......@@ -69,8 +69,8 @@ if (colv == 1)
v(~isnan(v(:,1)),:) = v(~isnan(v(:,1)),:) ./ abs(v(~isnan(v(:,1)),:));
u(~isnan(u(:,1)),:) = u(~isnan(u(:,1)),:) ./ abs(u(~isnan(u(:,1)),:));
else
v = sqrt( ones ./ (sum((v(~isnan(v(:,1)),:).*v(~isnan(v(:,1)),:))')) )' * ones(1,colv).*v(~isnan(v(:,1)),:);
u = sqrt( ones ./ (sum((u(~isnan(u(:,1)),:).*u(~isnan(u(:,1)),:))')) )' * ones(1,colu).*u(~isnan(u(:,1)),:);
v = sqrt( ones ./ (nansum((v.*v)')) )' * ones(1,colv).*v;
u = sqrt( ones ./ (nansum((u.*u)')) )' * ones(1,colu).*u;
end
% init.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment