Scilab Function
Last update : April 2007

rt_link - construct/clone a link object[view code]

Calling Sequence

l = rt_link()
l = rt_link(dh_row [, convention])
l = rt_link(dyn_row [, convention])
l2 = rt_link(l)
A = rt_link(q)



The rt_link function constructs a link object. The object contains kinematic and dynamic parameters as well as actuator and transmission parameters. The link object has type link.

The first form returns a default object.

The second form initializes the kinematic model based on Denavit and Hartenberg parameters. By default the standard Denavit and Hartenberg conventions are assumed but this can be overridden by the optional convention argument.

The dynamic model can be initialized using the third form of the constructor.

The fourth form is the copy constructor for the link object and returns a new link object with the same value as its argument. Note that, unlike the Matlab version of this toolbox, THE VARIABLE ASSIGNMENT OPERATOR (=) DOES NOT CLONE A LINK OBJECT.

The last form given above is not a constructor but a link method that returns the link transformation matrix for the given joint coordinate. The argument has to be given to the link object using parenthesis.

Since Scilab does not support the concept of public class, variables methods have been written to allow link object parameters to be referenced (r) or assigned (a) as given by the following table:

Method Operation Returns Type
link.alpha r + a link twist angle scalar
link.A r + a link length scalar
link.theta r + a link rotation angle scalar
link.D r + a link offset distance scalar
link.sigma r + a joint type; 0 for revolute, non-zero for prismatic scalar
link.RP r joint type; "R" or "P" char
link.mdh r + a DH convention: 0 if standard, 1 if modified scalar
link.I r symmetric inertia matrix 3-by-3 matrix
link.I a symmetric inertia matrix from a matrix or a vector whose elements are Ixx, Iyy, Izz, Ixy, Iyz and Ixz 3-by-3 matrix or 6-element row vector
link.m r + a link mass scalar
link.r r + a link COG vector 3-element column vector
link.G r + a gear ratio scalar
link.Jm r + a motor inertia scalar
link.B r + a viscous friction scalar
link.Tc r Coulomb friction 2-element row vector
link.Tc a Coulomb friction: symmetric or asymmetric friction scalar (symm.) or 2-element row vector (asymm.)
link.dh r + a row of legacy DH matrix 5-element row vector
link.dyn r + a row of legacy DYN matrix 20 elements row vector
link.qlim r + a joint coordinate limits 2-element row vector
link.offset r + a joint coordinate offset scalar
link.islimit(q) r 0 when value of q is inside the joint limit bounds, -1 and 1 when it exceeds the lower and the upper bound, respectively scalar

Overloaded Operators and Functions

In Scilab variable display and operators may be defined for new objects using Scilab-coded functions. For this new Scilab object, the link, only the display has been overloaded:

  • disp(l): gives a one-line summary of the link's kinematic parameters
  • Examples

       // create a default link model
       ldef = rt_link(),
       // create a link model based on standard Denavit-Hartenberg convention
       l1s = rt_link([-%pi/2, 0.02, 0, 0.15]),
       l2s = rt_link([-%pi/2, 0.8, 0, 0], "standard"),
       l3s = rt_link([0, 0, -%pi/2, 0, 1], "stand"),
       l4s = rt_link([0, 0.5, 0, 0, 0], "sta"),
       l5s = rt_link([0, 0.5, 0, 0, 0], "std"),         // error
       l5s = rt_link([0, 0.5, 0, 0, 0], "s"),           // error
       // create a link model based on modified Denavit-Hartenberg convention
       l1m = rt_link([%pi/2, -0.0203, 0, 0.4331], "modified"),
       l2m = rt_link([-%pi/2, 0, 0, 0], "mod"),
       l3m = rt_link([0, 0.5, 0, 0, 0], "m"),           // error
       // clone a link
       l1s_copy = rt_link(l1s);             // l1s and l1s_copy are distinct
       // refer to a link
       l = l1s_copy;                        // l "points" to l1s_copy and from
       l.alpha = 0; l.A = 1; l.D = 0;       // now on each change on it will
       disp(l);                             // affect the l1s_copy object too.
       disp(l1s_copy);                      // l1s_copy has changed!
       disp(l1s);                           // But l1s has not! This because
                                            // l1s and l1s_copy are distinct
                                            // objects
       // create a dynamic model of a link
       ll_dyn_row = [-%pi/2, 0, 0, 0.412, 0, 9.29, 0, 0.0175, -0.1105, 0.276,..
            0.255, 0.071, 0, 0, 0, 0.953, 1];
       ll = rt_link(ll_dyn_row, "stand");
       // some other reference or assignment operations
       ll.mdh,                              // refer mdh
       ll.mdh = 1,                          // assign mdh
       ll.Tc = 5;                           // assign symmetric Coulomb friction
       ll.I,                                // refer inertia matrix (IM)
       ll.I = [0.1, 0.05, 0.1, 0, 0, 0];    // assign IM (6-element vector)
       ll.I = [0.2, 0,      0;..            // assign IM (3-by-3 matrix)
               0,   0.1,    0;..
               0,   0,      0.2];
       rt_showlink(ll);                     // show all link's data in detail
       ll.RP,                               // refer joint type
       ll.RP = 1,                           // assign joint type, error!
       ll.sigma = 1,                        // assign joint type, ok
       // link coordinate frame with respect to the previous link's coordinate
       // system
       alphai = -%pi/2; ai = 0.0203; thetai = 0.85; di = 0.15005;
       ll = rt_link([alphai, ai, 0, di], "standard"),
       Ai = rt_transl(0, 0, di)*rt_rotz(thetai)*..
            rt_transl(ai, 0, 0) * rt_rotx(alphai),  // by compounded transforms
       Ai2 = ll(thetai),                            // by direct approach
       // Get the type of a link object
       typeof(l1s) == "link",               // returns %T (true)

    See Also

    rt_showlink,  rt_robot,  


    original Matlab version by

    Peter I. Corke CSIRO Manufacturing Science and Technology

    Scilab implementation by

    Matteo Morelli Interdepartmental Research Center "E. Piaggio", University of Pisa


    Corke, P.I. "A Robotics Toolbox for MATLAB", IEEE Robotics and Automation Magazine, Volume 3(1), March 1996, pp. 24-32

    R. P. Paul, Robot Manipulators: Mathematics, Programming and Control. Cambridge, Massachusetts: MIT Press, 1981.

    J. J. Craig, Introduction to Robotics. Addison Wesley, second ed., 1989.

    Get the Robotics Toolbox for Scilab/Scicos at Fast, secure and Free Open Source software downloads