OA2TR Convert O/A vectors to homogeneous transformation TR = OA2TR(O, A) Returns a homogeneous tranformation for the specified orientation and approach vectors. The rotation submatrix is formed from 3 vectors such that R = [N O A] and N = O x A. The submatrix is guaranteed to be orthonormal so long as O and A are not parallel. See also: RPY2TR, EUL2TR, OA2R
0001 %OA2TR Convert O/A vectors to homogeneous transformation 0002 % 0003 % TR = OA2TR(O, A) 0004 % 0005 % Returns a homogeneous tranformation for the specified orientation and 0006 % approach vectors. The rotation submatrix is formed from 3 vectors such that 0007 % R = [N O A] and N = O x A. 0008 % The submatrix is guaranteed to be orthonormal so long as O and A are 0009 % not parallel. 0010 % 0011 % See also: RPY2TR, EUL2TR, OA2R 0012 0013 % Copyright (C) 1993-2008, by Peter I. Corke 0014 % 0015 % This file is part of The Robotics Toolbox for Matlab (RTB). 0016 % 0017 % RTB is free software: you can redistribute it and/or modify 0018 % it under the terms of the GNU Lesser General Public License as published by 0019 % the Free Software Foundation, either version 3 of the License, or 0020 % (at your option) any later version. 0021 % 0022 % RTB is distributed in the hope that it will be useful, 0023 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0024 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0025 % GNU Lesser General Public License for more details. 0026 % 0027 % You should have received a copy of the GNU Leser General Public License 0028 % along with RTB. If not, see <http://www.gnu.org/licenses/>. 0029 0030 function r = oa2tr(o, a) 0031 n = cross(o, a); 0032 o = cross(a, n); 0033 r = [unit(n(:)) unit(o(:)) unit(a(:)) zeros(3,1); 0 0 0 1];