TRPLOT Plot a transformation TRPLOT(T) TRPLOT(T, name) TRPLOT(T, name, color) In a set of axes draw a coordinate frame. The frame can optionally be named and have a specified color.
0001 %TRPLOT Plot a transformation 0002 % 0003 % TRPLOT(T) 0004 % TRPLOT(T, name) 0005 % TRPLOT(T, name, color) 0006 % 0007 % In a set of axes draw a coordinate frame. The frame can optionally 0008 % be named and have a specified color. 0009 0010 % Copyright (C) 2008, by Peter I. Corke 0011 % 0012 % This file is part of The Robotics Toolbox for Matlab (RTB). 0013 % 0014 % RTB 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 % RTB 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 RTB. If not, see <http://www.gnu.org/licenses/>. 0026 0027 function trplot(T, name, color) 0028 0029 if nargin == 1, 0030 fmt = '%c'; 0031 else 0032 fmt = sprintf('%%c%s', name); 0033 end 0034 if nargin < 3, 0035 color = 'b'; 0036 end 0037 0038 q = quaternion(T); 0039 plot(q, transl(T), fmt, color);