Home > @robot > subsasgn.m

subsasgn

PURPOSE ^

SUBSASGN Assignment methods on a ROBOT object

SYNOPSIS ^

function r = subsasgn(r, s, v)

DESCRIPTION ^

SUBSASGN Assignment methods on a ROBOT object

    ROBOT.gravity = [gx gy gz]
    ROBOT.base = 4x4 homog xform
    ROBOT.tool = 4x4 homog xform
    ROBOT.qlim = [qlower qupper]    set joint limits
    ROBOT.offset         set joint offset vector

    ROBOT.name = 'name'
    ROBOT.manuf = 'who built it'
    ROBOT.comment = 'general comment'

    ROBOT.plotopt     set options for plot(robot)
    ROBOT.lineopt     set graphical line drawing option string for links
    ROBOT.shadowopt set graphical line drawing option string for shadow
    ROBOT.handle    save graphics handles in object
    ROBOT.q     set joint angles for plot(robot)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %SUBSASGN Assignment methods on a ROBOT object
0002 %
0003 %    ROBOT.gravity = [gx gy gz]
0004 %    ROBOT.base = 4x4 homog xform
0005 %    ROBOT.tool = 4x4 homog xform
0006 %    ROBOT.qlim = [qlower qupper]    set joint limits
0007 %    ROBOT.offset         set joint offset vector
0008 %
0009 %    ROBOT.name = 'name'
0010 %    ROBOT.manuf = 'who built it'
0011 %    ROBOT.comment = 'general comment'
0012 %
0013 %    ROBOT.plotopt     set options for plot(robot)
0014 %    ROBOT.lineopt     set graphical line drawing option string for links
0015 %    ROBOT.shadowopt set graphical line drawing option string for shadow
0016 %    ROBOT.handle    save graphics handles in object
0017 %    ROBOT.q     set joint angles for plot(robot)
0018 
0019 % Copyright (C) 1999-2008, by Peter I. Corke
0020 %
0021 % This file is part of The Robotics Toolbox for Matlab (RTB).
0022 %
0023 % RTB is free software: you can redistribute it and/or modify
0024 % it under the terms of the GNU Lesser General Public License as published by
0025 % the Free Software Foundation, either version 3 of the License, or
0026 % (at your option) any later version.
0027 %
0028 % RTB is distributed in the hope that it will be useful,
0029 % but WITHOUT ANY WARRANTY; without even the implied warranty of
0030 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0031 % GNU Lesser General Public License for more details.
0032 %
0033 % You should have received a copy of the GNU Leser General Public License
0034 % along with RTB.  If not, see <http://www.gnu.org/licenses/>.
0035 
0036 function r = subsasgn(r, s, v)
0037 
0038     if s(1).type  ~= '.'
0039         error('only .field supported')
0040     end
0041     switch s(1).subs,
0042     %%%%%%%%% extensions
0043     case 'tool',
0044         if ~ishomog(v)
0045             error('base must be a homogeneous transform');
0046         end
0047         r.tool = v;
0048     case 'base',
0049         if ~ishomog(v)
0050             error('base must be a homogeneous transform');
0051         end
0052         r.base = v;
0053     case 'offset',
0054         L = r.link;
0055         for i=1:r.n,
0056             L{i}.offset = v(i);
0057         end
0058     case 'qlim',
0059         if numrows(v) ~= r.n,
0060             error('insufficient rows in joint limit matrix');
0061         end
0062         L = r.link;
0063         for i=1:r.n,
0064             L{i}.qlim = v(i,:);
0065         end
0066     case 'gravity',
0067         r.gravity = v;
0068     %%%%%%%%% graphics support
0069     case 'q',
0070         r.q = v;
0071     case 'lineopt',
0072         r.lineopt = v;
0073     case 'shadowopt',
0074         r.shadowopt = v;
0075     case 'plotopt',
0076         r.plotopt = v;
0077     case 'handle',
0078         r.handle = v;
0079 
0080     %%%%%%%%% descriptive strings
0081     case 'name',
0082         r.name = v;
0083     case 'manuf',
0084         r.manuf = v;
0085     case 'comment',
0086         r.comment = v;
0087     otherwise, error('Unknown method')
0088     end

Generated on Sun 15-Feb-2009 18:09:29 by m2html © 2003