MTIMES Multiply robot objects Robot objects can be multiplied r1*r2 which is mechanically equivalent to concatenating the two robots, or mounting robot r2 on the end of robot r1.
0001 %MTIMES Multiply robot objects 0002 % 0003 % Robot objects can be multiplied r1*r2 which is mechanically equivalent 0004 % to concatenating the two robots, or mounting robot r2 on the end of robot r1. 0005 0006 % Copyright (C) 1999-2008, by Peter I. Corke 0007 % 0008 % This file is part of The Robotics Toolbox for Matlab (RTB). 0009 % 0010 % RTB is free software: you can redistribute it and/or modify 0011 % it under the terms of the GNU Lesser General Public License as published by 0012 % the Free Software Foundation, either version 3 of the License, or 0013 % (at your option) any later version. 0014 % 0015 % RTB is distributed in the hope that it will be useful, 0016 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0017 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0018 % GNU Lesser General Public License for more details. 0019 % 0020 % You should have received a copy of the GNU Leser General Public License 0021 % along with RTB. If not, see <http://www.gnu.org/licenses/>. 0022 0023 function r2 = mtimes(r, l) 0024 0025 if ~isa(r, 'robot') 0026 error('left arg must be a robot') 0027 end 0028 if isa(l, 'robot') 0029 r2 = robot(r); 0030 r2.link = [r2.link l.link]; 0031 r2.n = length(r2.link); 0032 elseif isa(l, 'link') 0033 end