Home > @link > subsasgn.m

subsasgn

PURPOSE ^

SUBSASGN assignment methods on a LINK object

SYNOPSIS ^

function l = subsasgn(l, s, v)

DESCRIPTION ^

SUBSASGN assignment methods on a LINK object

    LINK.alpha = alpha    kinematic parameters
    LINK.A = A
    LINK.theta = theta
    LINK.D = D
    LINK.sigma = sigma    1 if joint is prismatic

    LINK.I = 3x3 inertia matrix about link COG
    LINK.I = 6x1 inertia vector [Ixx Iyy Izz Ixy Iyz Ixz] about link COG
    LINK.m = link mass
    LINK.r = 3vector  link COG wrt link coordinate frame

    LINK.B = link viscous friction (motor referred)
    LINK.Tc = link Coulomb friction 1 element if symmetric, else 2

    LINK.G = G        gear ratio
    LINK.Jm = Jm        gear ratio (motor referred)

    LINK.qlim = 2 x 1    joint limit matrix [lower upper]
    LINK.offset = q0    joint coordinate offset

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %SUBSASGN assignment methods on a LINK object
0002 %
0003 %    LINK.alpha = alpha    kinematic parameters
0004 %    LINK.A = A
0005 %    LINK.theta = theta
0006 %    LINK.D = D
0007 %    LINK.sigma = sigma    1 if joint is prismatic
0008 %
0009 %    LINK.I = 3x3 inertia matrix about link COG
0010 %    LINK.I = 6x1 inertia vector [Ixx Iyy Izz Ixy Iyz Ixz] about link COG
0011 %    LINK.m = link mass
0012 %    LINK.r = 3vector  link COG wrt link coordinate frame
0013 %
0014 %    LINK.B = link viscous friction (motor referred)
0015 %    LINK.Tc = link Coulomb friction 1 element if symmetric, else 2
0016 %
0017 %    LINK.G = G        gear ratio
0018 %    LINK.Jm = Jm        gear ratio (motor referred)
0019 %
0020 %    LINK.qlim = 2 x 1    joint limit matrix [lower upper]
0021 %    LINK.offset = q0    joint coordinate offset
0022 
0023 % Copyright (C) 1999-2008, by Peter I. Corke
0024 %
0025 % This file is part of The Robotics Toolbox for Matlab (RTB).
0026 %
0027 % RTB is free software: you can redistribute it and/or modify
0028 % it under the terms of the GNU Lesser General Public License as published by
0029 % the Free Software Foundation, either version 3 of the License, or
0030 % (at your option) any later version.
0031 %
0032 % RTB is distributed in the hope that it will be useful,
0033 % but WITHOUT ANY WARRANTY; without even the implied warranty of
0034 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0035 % GNU Lesser General Public License for more details.
0036 %
0037 % You should have received a copy of the GNU Leser General Public License
0038 % along with RTB.  If not, see <http://www.gnu.org/licenses/>.
0039 
0040 function l = subsasgn(l, s, v)
0041 
0042     if s(1).type  ~= '.'
0043         error('only .field supported')
0044     end
0045     switch s(1).subs,
0046     case 'alpha',
0047         l.alpha = v;
0048     case 'A',
0049         l.A = v;
0050     case 'theta',
0051         l.theta = v;
0052     case 'D',
0053         l.D = v;
0054     case 'offset',
0055         l.offset = v;
0056     case 'sigma',
0057         if ischar(v)
0058             l.sigma = lower(v) == 'p';
0059         else
0060             l.sigma = v;
0061         end
0062     case 'G',
0063         l.G = v;
0064     case 'I',
0065         if all(size(v) == [3 3])
0066             l.I = v;
0067         elseif length(v) == 3,
0068             l.I = diag(v);
0069         elseif length(v) == 6,
0070             l.I = [    v(1) v(4) v(6)
0071                 v(4) v(2) v(5)
0072                 v(6) v(5) v(3)];
0073         end
0074     case 'r',
0075         l.r = v(:);    % a column vector
0076     case 'Jm',
0077         l.Jm = v;
0078     case 'B',
0079         l.B = v;
0080     case 'Tc',
0081         if length(v) == 1,
0082             l.Tc = [v -v];
0083         elseif length(v) == 2,
0084             l.Tc = v;
0085         else
0086             error('Coulomb friction vector can have 1 (symmetric) or 2 (asymmetric) elements only')
0087         end
0088     case 'm',
0089         l.m = v;
0090     case 'qlim',
0091         if length(v) ~= 2,
0092             error('joint limit must have 2 elements');
0093         end
0094         l.qlim = v;
0095     otherwise, error('Unknown method')
0096     end

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