# Resolve Frame

## PlotResolveFrame

For a chain with missing frame, ResolveFrame( ) connects the chain with another completed chain to form a closed loop and then computes the missing data. PlotResolveFrame( ) adds plotting feature to visualize the closed chain.

### Syntax

• [T_rel, T_abs, fc1]= ResolveFrame(fc1,fc2)
• [T_rel, T_abs, fc1]= PlotResolveFrame(fc1,fc2, options)

### Input Arguments

• fc1  — an incomplete chain of coordinate frames created by SerialFrame( ) that has exactly one frame missing somewhere along the chain.
• fc2  — a completed chain of coordinate frames created by SerialFrame( ), or simply a homogeneous transformation matrix describing the end frame of fc1 w.r.t its base.

### Output Arguments

• T_rel — 4 x 4 relative homogeneous transformation matrix of the missing frame w.r.t the frame below it.
• T_abs — 4 x 4 absolute homogeneous transformation matrix of the missing frame w.r.t frame 1 of the chain.
• fc1 — chain passed to the first input argument whose missing information is resolved and is now completed.

### Options

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

• ‘grid’ — show grid
• ‘oinfo’ — show origin location (may look messy when several frames are condensed together)
• [ ‘figure’, fnum] — command the plot to a particular window indicated by fnum

### Description

It is a common problem in robotic study when homogeneous transformations are connected in a closed chain configuration, with all information known except one particular link. The goal is to solve for that unknown link in terms of the rest, the known ones. One common algebraic method is to form two transform equations of the two paths from base to end, combine them, and rearrange so that the unknown frame on the left side is described as a product of the known frames and their inversions. Alternatively, one can write a computer program to solve this problem numerically. ResolveFrame( ) is an algorithm designed to perform this job. PlotResolveFrame( ) is just a graphical shell that internally calls ResolveFrame( ).

To use the functions, two loops of the closed chain must be constructed as two separate transformation chain using Frame( ) and SerialFrame( ) . The chain fc1   contains the missing link, while fc2   must be a completed chain with the same base and end frame as fc1  . Alternatively, fc2   can be passed as a homogeneous transformation matrix describing the end frame of fc1   w.r.t its base. If the problem is solvable, ResolveFrame( ) returns the transformations of missing frame together with the chain fc1   that is now completed. PlotResolveFrame( ) also creates a graphical window to display the frames of closed chain formed by fc1   and fc2  . Chain fc1   is drawn in red, while fc2  is in blue. The missing link is shown as a dotted red arrow. The base and end frame are in black and purple, respectively.

### Examples

The example below shows the necessary steps from frame creation to plotting. The result is shown in Figure 1 below.

```-->F1(1)=Frame(eye(4,4),'name','U'); -->F1(2)=Frame(transl([1 1 0.5])*trotx(pi/2),'name','V'); -->F1(3)=Frame([],'name','X'); // missing frame at location 3 -->F1(4)=Frame(transl([1 1 1])*angvec2t(pi/2, [1 1 1]),'name','W'); -->fc1=SerialFrame(F1,'name','Chain 1'); // incomplete chain to be solved   Reading frame data and computing missing information Processing Upwards ... 1 -- {U} : Found T_rel. Fill in T_abs with T_rel 2 -- {V}: Found T_rel. Computing T_abs :{V} w.r.t {U}-- Finished 3 -- {X}: *** Missing both T_abs: {X} w.r.t {U} and T_rel: {X} w.r.t {V} *** 4 -- {W}: *** Missing T_abs: {W} w.r.t {U} *** List of missing frames in Chain 1 =============================== 3 -- {X}: T_abs : {X} w.r.t {U} , T_rel : {X} w.r.t {V} , 4 -- {W}: T_abs : {W} w.r.t {U} ,   -->F2(1)=Frame(eye(4,4),'name','U'); -->F2(2)=Frame(transl([-3 -2 -1])*eul2t([pi/6 pi/3 pi/4]),'name','A'); -->F2(3)=Frame(transl([-3 -4 -1])*troty(pi/4),'name','W'); -->fc2=SerialFrame(F2,'name','Chain 2'); // chain 2 is completed   Reading frame data and computing missing information Processing Upwards ... 1 -- {U} : Found T_rel. Fill in T_abs with T_rel 2 -- {A}: Found T_rel. Computing T_abs :{A} w.r.t {U}-- Finished 3 -- {W}: Found T_rel. Computing T_abs :{W} w.r.t {U}-- Finished Chain 2: All missing information are computed and filled in   -->[Trel,Tabs,fc1r]=PlotResolveFrame(fc1,fc2);   Running ResolveFrame ... 4 -- {W}: Fill in T_abs : {W} w.r.t {U}-- Finished 3 -- {X}: Computing T_abs : {X} w.r.t {U} -- Finished 3 -- {X}: Computing T_rel : {X} w.r.t {V} -- Finished Rechecking if there are still missing frame data in Chain 1-- none found. --- Chain 1 is now completed. ---   Missing data T: {X} w.r.t {V} in Chain 1 is computed as   0.2333285 0.0273474 0.9720133 - 7.7659853 - 0.8371037 - 0.5029826 0.2150952 - 1.4899574 0.4947881 - 0.8638638 - 0.0944675 5.8682128 0. 0. 0. 1.```

Figure 1: Close chain plot using PlotResolveFrame( )