RTSX Help: Plot frames in a transformation chain
PlotFrame( ) provides a more systematic way to visualize a sequence of homogeneous transformations than trplot( ). A tranformation chain must be passed to the function instead of a homogeneous transformation matrix.
- PlotFrame(fc, options)
- fc — a chain of completed coordinate frames created by SerialFrame( )
Note : options in [ ] must be passed to the function in pairs.
- ‘grid’ — show grid
- ‘oinfo’ — show origin location (could look messy when several frames are condensed together)
- [ ‘figure’, fnum] — command the plot to a particular window indicated by fnum
To study robot kinematics, one must understand clearly the basic of kinematic chain connecting coordinate frames together. PlotFrame( ) serves as a convenient graphical tool to visualize such a chain. The function accepts a completed chain created by SerialFrame( ) . An incomplete chain must be resolved first by ResolveFrame( ), if possible. Unlike trplot( ) where a user has control over a frame’s axis color and line style, PlotFrame( ) assigns colors to frames automatically depending on their positions in the chain.
The example below shows the necessary steps from frame creation to plotting. The result is shown in Figure 1 below.
// first create a sequence of frames clear F; F(1)=Frame(eye(4,4),'name','U'); F(2)=Frame(trotx(pi/2)*transl([0 1 1]),'name','V'); F(3)=Frame(trotz(pi/4)*transl([2 3 -1]),'name','W'); F(4)=Frame(troty(pi/3),'name','Y'); fc=SerialFrame(F,'name','Chain 1'); PlotFrame(fc);