RTSX Help: Display robot structure/DH coordinate frame



PlotRobot( ) launches a graphic window and shows a skeleton of the robot model passed to it. PlotRobotFrame( ) behaves similarly except that it plots how DH coordiate frames are arranged.


  • T=PlotRobot(robot, q, options)
  • T=PlotRobotFrame(robot, q, options)

Input Arguments

  • robot –a robot model
  • q –a 1 x nq vector of joint variable values, where nq = number of joint variables

    Output Arguments

    • T — a 4 x 4 homogeneous transformation matrix from tool to base at the given values of joint variables


    Note : options in [ ] must be passed to the function in pairs.

    • ‘grid’ — show grid
    • ‘noworld’ — do not plot world coordinate frame
    • ‘notool’ — do not plot tool coordinate frame
    • ‘hold’ — hold previous plot
    • [ ‘figure’, fnum] — command the plot to a particular window indicated by fnum


    This pair of plotting functions are used to visualize a robot model and its DH coordinate frame structure corresponding to given joint variable values.


    This example demonstrates how to plot an RPR robot and its DH frame. The plot results are shown in Figure 1 and 2 below.

    clear L;
    // length and offset parameters
    d1 = 1;
    d2 = 2;  // default value for variable d2
    a3 = 1;
    L(1)=Link([0 d1 0 -pi/2]);
    L(2)=Link([-pi/2 d2 0 -pi/2],'P');    // prismatic joint
    L(3)=Link([0 0 a3 0]);
    RPRrobot=SerialLink(L,'name','An RPR robot','viewangle',[58.5 46.5]);
    q = [0 1 0];  // joint variable values

    Figure 1: robot model plot example with PlotRobot( )

    Figure 2: robot DH frame plot example with PlotRobotFrame( )

    See Also

    • AnimateRobot — show a movie of commanded robot movements