Drake
 All Classes Files Functions Variables
MultiCoordinateFrame Class Reference

Makes a mux'd coordinate frame out of a list of other frames. More...

Inheritance diagram for MultiCoordinateFrame:
Collaboration diagram for MultiCoordinateFrame:

Public Member Functions

function MultiCoordinateFrame (coordinate_frames, frame_id)
 
function disp (obj)
 
function display (obj)
 
function isequal_modulo_transforms (a, b)
 
function findTransform (obj, target, options)
 There are three ways to get a transform from this multiframe to another frame. More...
 
function transformToChild (obj, frame_id)
 
function findChildTransform (obj, target, options)
 note: if target is one of the children, then this will return an empty tf but an fid>0 More...
 
function findChildReverseTransform (obj, origin, options)
 finds a transform from origin to one of my children note: if origin is one of the children, then this will return an empty tf but an fid>0 More...
 
function subFrameByFrameID (obj, frame_ids)
 comparable to subFrame, but at the frame ID More...
 
function findSubFrameEquivalentModuloTransforms (obj, fr)
 
function splitCoordinates (obj, vector_vals)
 Extract values of individual CoordinateFrames from a vector in the multi-frame. More...
 
function mergeCoordinates (obj, cell_vals)
 sizecheck(cell_vals,length(obj.frame)); % commented out for speed More...
 
function getNumFrames (obj)
 
function getFrameByNum (obj, n)
 
function getFrameByName (obj, name)
 
function getFrameByNameRecursive (obj, name)
 Looks in all subframes that are multicoordinate frames for this frame. More...
 
function getFrameNumByName (obj, name)
 
function getFrameNumByNameRecursive (obj, name)
 Returns vector of subframe ids to get to the supplied frame from the root. More...
 
function getFrameNum (obj, frame)
 
function replaceFrameNum (obj, num, new_subframe)
 
function appendFrame (obj, new_subframe)
 
function getCoordinateName (obj, i)
 
function setupMultiInput (obj, mdl, subsys)
 
function setupMultiOutput (obj, mdl, subsys)
 
function setupLCMInputs (obj, mdl, subsys, subsys_portnum, options)
 
function setupLCMOutputs (obj, mdl, subsys, subsys_portnum, options)
 
- Public Member Functions inherited from CoordinateFrame
function CoordinateFrame (name, dim, prefix, coordinates)
 Constructs a new coordinate frame. More...
 
function hasSamePrefix (frame1, frame2)
 useful for alarming on a possible prefix clash between two polys More...
 
function getPoly (obj)
 create the poly now if it hasn't been created yet More...
 
function disp (obj)
 
function isequal_modulo_transforms (a, b)
 returns true if the two coordinate frames are the same. More...
 
function getSym (obj)
 
function addTransform (obj, transform, bforce)
 Attaches a new coordinate transform from the current frame to a different frame. More...
 
function updateTransform (obj, newtransform)
 find a current transform with the same target frame and replace it with the new transform. More...
 
function addProjectionTransformByCoordinateNames (fr, fr2, fr2_defaultvals)
 adds a transform from fr to fr2 which copies over the dimensions with matching coordinate names, and sets the remaining elements of fr2 to their default values. More...
 
function drawFrameGraph (obj)
 Calls graphviz to visualize this frame plus all other frames that are reachable by some (potentially multi-hop) transform. More...
 
function findTransform (obj, target, options)
 Performs a simple breadth-first search of all available multi-hop transforms for a transformation from the current frame to the target frame. More...
 
function getCoordinateName (obj, i)
 
function findCoordinateIndex (obj, varname)
 
function getCoordinateNames (obj)
 getCoordinateNames encapsulates the lazy generation of the default coordinates. More...
 
function setCoordinateNames (obj, cnames)
 Updates the coordinate names. More...
 
function subFrame (obj, dims)
 Extracts a new frame with a subset of the original variables, so that fr.coordinates = obj.coordinates(dims) More...
 
function constructFrameWithAnglesWrapped (obj, angle_flag, q0)
 produces a copy of the current frame, but with a transform placed between them that wraps the angles around 2pi. More...
 
function scope (obj, t, val, options)
 publishes coordinate information to the lcm scope More...
 
function generateLCMType (obj, robot_name, signal_name)
 writes an lcm type specification to file from the coordinate frame description. More...
 
function getNumFrames (obj)
 
function getFrameByNum (obj, n)
 
function getFrameNum (obj, fr)
 
function setupMultiInput (obj, mdl, subsys)
 
function setupMultiOutput (obj, mdl, subsys)
 
function setupLCMInputs (obj, mdl, subsys, subsys_portnum, options)
 
function setupLCMOutputs (obj, mdl, subsys, subsys_portnum, options)
 
function autoConnect (fr1, fr2, connection)
 populates the connection structure as used in mimoCascade and mimoFeedback if connection is passed in, then it simply attempts to validate the connection. More...
 

Static Public Member Functions

static function constructFrame (frames, frame_ids, zap_empty_frames)
 if frames has only a single element, then return it, otherwise construct the multi-frame More...
 
- Static Public Member Functions inherited from CoordinateFrame
static function stripSpecialChars (s)
 
static function generateDefaultCoordinates (prefix)
 generates the default coordinate labels for a coordinate Frame when no value is passed in, based on the prefixes provided. More...
 

Public Attributes

Property frame
 a list of CoordinateFrame objects More...
 
Property frame_id
 for each coordinate, an integer index into the frame More...
 
Property coord_ids
 (from the list above) associated with that coordinate More...
 
Property cell_vals
 speed optimization More...
 

Protected Member Functions

function extractFrameGraph (obj)
 
- Protected Member Functions inherited from CoordinateFrame
function ismember (obj, cell_of_frames)
 helper method for searching transforms More...
 
function extractFrameGraph (obj)
 

Detailed Description

Makes a mux'd coordinate frame out of a list of other frames.

This is the means by which drake supports (the simplest form of) multi-input and multi-output systems.

Note that, although the coordinate names (and polynomial variables) are initialized to match the name of the sub coordinate frames, there is no contract guaranteeing that they will continue to match after subsequent coordinate renamings for the multi-frame or the sub-frames.

Constructor & Destructor Documentation

function MultiCoordinateFrame ( coordinate_frames  ,
frame_id   
)
Return values
obj

Member Function Documentation

function appendFrame ( obj  ,
new_subframe   
)
Return values
obj
static function constructFrame ( frames  ,
frame_ids  ,
zap_empty_frames   
)
static

if frames has only a single element, then return it, otherwise construct the multi-frame

Return values
obj
function disp ( obj  )
function display ( obj  )
function extractFrameGraph ( obj  )
protected
Return values
A
fr
function findChildReverseTransform ( obj  ,
origin  ,
options   
)

finds a transform from origin to one of my children note: if origin is one of the children, then this will return an empty tf but an fid>0

Return values
tf
fid
function findChildTransform ( obj  ,
target  ,
options   
)

note: if target is one of the children, then this will return an empty tf but an fid>0

Return values
tf
fid
function findSubFrameEquivalentModuloTransforms ( obj  ,
fr   
)
Return values
ids
function findTransform ( obj  ,
target  ,
options   
)

There are three ways to get a transform from this multiframe to another frame.

One is if a transform exists directly from the multi-frame. Another is if the required transforms exist for ALL of the child frames. The third is if a transform exists from ONE of the child frames to the entire target frame (e.g. if the target is actually one of the child frames). See the mimoCascade and mimoFeedback methods for more complex combinations.

Return values
tf
options
function getCoordinateName ( obj  ,
 
)
Return values
str
function getFrameByName ( obj  ,
name   
)
Return values
fr
function getFrameByNameRecursive ( obj  ,
name   
)

Looks in all subframes that are multicoordinate frames for this frame.

Return values
fr
function getFrameByNum ( obj  ,
 
)
Return values
fr
function getFrameNum ( obj  ,
frame   
)
Return values
id
function getFrameNumByName ( obj  ,
name   
)
Return values
id
function getFrameNumByNameRecursive ( obj  ,
name   
)

Returns vector of subframe ids to get to the supplied frame from the root.

The first elem in the vec is the root level subframe – each sequential item in the vec is the index into the next subframe down.

Return values
id
function getNumFrames ( obj  )
Return values
n
function isequal_modulo_transforms ( ,
 
)
Return values
tf
function mergeCoordinates ( obj  ,
cell_vals   
)

sizecheck(cell_vals,length(obj.frame)); % commented out for speed

Return values
vector_vals
function replaceFrameNum ( obj  ,
num  ,
new_subframe   
)
Return values
obj
function setupLCMInputs ( obj  ,
mdl  ,
subsys  ,
subsys_portnum  ,
options   
)
function setupLCMOutputs ( obj  ,
mdl  ,
subsys  ,
subsys_portnum  ,
options   
)
function setupMultiInput ( obj  ,
mdl  ,
subsys   
)
Return values
insys
function setupMultiOutput ( obj  ,
mdl  ,
subsys   
)
Return values
outsys
function splitCoordinates ( obj  ,
vector_vals   
)

Extract values of individual CoordinateFrames from a vector in the multi-frame.

Parameters
vector_valsa vector in the multi-frame

Usage: cv = splitCoordinates(obj,vv); a = cv{1}; b=cv{2}; or [a,b] = splitCoordinates(obj,vv)

Return values
varargout
function subFrameByFrameID ( obj  ,
frame_ids   
)

comparable to subFrame, but at the frame ID

Return values
fr
function transformToChild ( obj  ,
frame_id   
)
Return values
tf

Member Data Documentation

Property cell_vals

speed optimization

Property coord_ids

(from the list above) associated with that coordinate

for each frame, a list of associate coordinates

Property frame

a list of CoordinateFrame objects

Property frame_id

for each coordinate, an integer index into the frame


The documentation for this class was generated from the following file: