%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Q = NORMALIZE(Q) Normalizes a vector of joint values to [-pi, pi] Author: Arturo Gil. Universidad Miguel Hernández de Elche. email: arturo.gil@umh.es date: 26/06/2012 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0002 % Q = NORMALIZE(Q) 0003 % 0004 % Normalizes a vector of joint values to [-pi, pi] 0005 % 0006 % Author: Arturo Gil. Universidad Miguel Hernández de Elche. 0007 % email: arturo.gil@umh.es date: 26/06/2012 0008 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0009 0010 % Copyright (C) 2012, by Arturo Gil Aparicio 0011 % 0012 % This file is part of ARTE (A Robotics Toolbox for Education). 0013 % 0014 % ARTE is free software: you can redistribute it and/or modify 0015 % it under the terms of the GNU Lesser General Public License as published by 0016 % the Free Software Foundation, either version 3 of the License, or 0017 % (at your option) any later version. 0018 % 0019 % ARTE is distributed in the hope that it will be useful, 0020 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0021 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0022 % GNU Lesser General Public License for more details. 0023 % 0024 % You should have received a copy of the GNU Leser General Public License 0025 % along with ARTE. If not, see <http://www.gnu.org/licenses/>. 0026 function q = normalize(q) 0027 0028 for i=1:size(q,2) 0029 q(:,i)=atan2(sin(q(:,i)),cos(q(:,i))); 0030 end 0031