RobWorkProject  24.5.15-
Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
Frame Class Referenceabstract

The type of node of forward kinematic trees. More...

#include <Frame.hpp>

Inherits StateData.

Inherited by FixedFrame, MovableFrame, and Joint.

Public Types

typedef rw::core::Ptr< FramePtr
 Smart pointer type for a Frame object.
 
typedef rw::core::Ptr< const FrameCPtr
 Smart pointer type for a constant Frame object.
 
typedef rw::common::ConcatVectorIterator< Frameiterator
 Forward iterator for frames.
 
typedef rw::common::ConstConcatVectorIterator< Frameconst_iterator
 Forward iterator for const frames.
 
typedef rw::core::iter_pair< iteratoriterator_pair
 Pair of iterators.
 
typedef rw::core::iter_pair< const_iteratorconst_iterator_pair
 Pair of const iterators.
 

Public Member Functions

virtual ~Frame ()
 Destructor for the frame.
 
void multiplyTransform (const rw::math::Transform3D<> &parent, const rw::kinematics::State &state, rw::math::Transform3D<> &result) const
 Post-multiply the transform of the frame to the parent transform. More...
 
rw::math::Transform3D getTransform (const rw::kinematics::State &state) const
 The transform of the frame relative to its parent. More...
 
const rw::core::PropertyMapgetPropertyMap () const
 Miscellaneous properties of the frame. More...
 
rw::core::PropertyMapgetPropertyMap ()
 Miscellaneous properties of the frame. More...
 
int getDOF () const
 The number of degrees of freedom (dof) of the frame. More...
 
const rw::kinematics::FramegetParent () const
 The parent of the frame or NULL if the frame is a DAF.
 
rw::kinematics::FramegetParent ()
 The parent of the frame or NULL if the frame is a DAF.
 
rw::kinematics::FramegetParent (const rw::kinematics::State &state)
 Returns the parent of the frame. More...
 
const rw::kinematics::FramegetParent (const rw::kinematics::State &state) const
 Returns the parent of the frame. More...
 
const rw::kinematics::FramegetDafParent (const rw::kinematics::State &state) const
 The dynamically attached parent or NULL if the frame is not a DAF.
 
rw::kinematics::FramegetDafParent (const rw::kinematics::State &state)
 The dynamically attached parent or NULL if the frame is not a DAF. More...
 
const_iterator_pair getChildren () const
 Iterator pair for the fixed children of the frame.
 
iterator_pair getChildren ()
 Iterator pair for the fixed children of the frame. More...
 
const_iterator_pair getChildren (const rw::kinematics::State &state) const
 Iterator pair for all children of the frame.
 
iterator_pair getChildren (const rw::kinematics::State &state)
 Iterator pair for all children of the frame.
 
std::vector< Frame::PtrgetChildrenList (const rw::kinematics::State &state)
 get a list of all frame children More...
 
const_iterator_pair getDafChildren (const rw::kinematics::State &state) const
 Iterator pair for the dynamically attached children of the frame.
 
iterator_pair getDafChildren (const rw::kinematics::State &state)
 Iterator pair for the dynamically attached children of the frame. More...
 
void attachTo (const Ptr &parent, rw::kinematics::State &state)
 Move a frame within the tree. More...
 
bool isDAF ()
 Test if this frame is a Dynamically Attachable Frame. More...
 
rw::math::Transform3D wTf (const rw::kinematics::State &state) const
 Get the transform relative to world. More...
 
rw::math::Transform3D fTf (const CPtr &to, const rw::kinematics::State &state) const
 Get the transform of other frame relative to this frame. More...
 
bool operator== (const Frame &rhs)
 Compares the Frame to see if they are the same Checks the statedata, parent frame and chld frame. More...
 
bool operator!= (const Frame &rhs)
 Check if not equal. More...
 
- Public Member Functions inherited from StateData
virtual ~StateData ()
 destructor
 
int getID () const
 An integer ID for the StateData. More...
 
const std::string & getName () const
 The name of the state data. More...
 
int size () const
 The number of doubles allocated by this StateData in each State object. More...
 
const double * getData (const rw::kinematics::State &state) const
 An array of length size() containing the values for the state data. More...
 
double * getData (rw::kinematics::State &state)
 An array of length size() containing the values for the state data. More...
 
void setData (rw::kinematics::State &state, const double *vals) const
 Assign for state data the size() of values of the array vals. More...
 
void setData (rw::kinematics::State &state, const std::vector< double > &vals) const
 Assign for state data the size() of values of the array vals. More...
 
void setData (rw::kinematics::State &state, const double &val) const
 Assign for state data the size() of values of the array vals. More...
 
bool hasCache () const
 Check is state data includes a cache. More...
 
rw::core::Ptr< rw::kinematics::StateCachegetCache (const rw::kinematics::State &state) const
 Get the cache. More...
 
rw::core::Ptr< rw::kinematics::StateCachegetCache (rw::kinematics::State &state)
 Get the cache. . More...
 
rw::core::Ptr< rw::kinematics::StateCachegetDefaultCache ()
 Get default cache. More...
 
void setCache (rw::core::Ptr< rw::kinematics::StateCache > cache, rw::kinematics::State &state)
 Set the cache values. More...
 
class rw::kinematics::StateStructuregetStateStructure ()
 Get the state structure. More...
 
bool operator== (const StateData &rhs)
 Compares the state data to see if they are the same Checks the ID, name and which statetrucure they belong to. More...
 
bool operator!= (const StateData &rhs)
 Check if not equal. More...
 
 StateData (int size, const std::string &name)
 A state with size number of doubles in the State vector. More...
 
 StateData (int size, const std::string &name, rw::core::Ptr< rw::kinematics::StateCache > cache)
 A state with size number of doubles in the State vector. More...
 

Protected Member Functions

 Frame (int dof, const std::string &name)
 A frame with dof number of degrees of freedom. More...
 
virtual void doMultiplyTransform (const rw::math::Transform3D<> &parent, const rw::kinematics::State &state, rw::math::Transform3D<> &result) const =0
 Subclass implementation of the getTransform() method.
 
virtual rw::math::Transform3D doGetTransform (const rw::kinematics::State &state) const =0
 

Friends

class StateStructure
 
std::ostream & operator<< (std::ostream &out, const Frame &frame)
 Streaming operator.
 

Detailed Description

The type of node of forward kinematic trees.

Types of joints are implemented as subclasses of Frame. The responsibility of a joint is to implement the getTransform() method that returns the transform of the frame relative to whatever parent it is attached to.

The getTransform() method takes as parameter the set of joint values State for the tree. Joint values for a particular frame can be accessed via State::getQ(). A frame may contain pointers to other frames so that the transform of a frame may depend on the joint values for other frames also.

Constructor & Destructor Documentation

◆ Frame()

Frame ( int  dof,
const std::string &  name 
)
protected

A frame with dof number of degrees of freedom.

dof must be non-negative.

The newly created frame can be added to a tree with Tree::addFrame().

The number of degrees of freedom of the frame is constant throughout the lifetime of the frame.

Parameters
dof[in] The number of degrees of freedom of the frame.
name[in] The name of the frame.

Member Function Documentation

◆ attachTo()

void attachTo ( const Ptr parent,
rw::kinematics::State state 
)

Move a frame within the tree.

The frame frame is detached from its parent and reattached to parent. The frames frame and parent must both belong to the same kinematics tree.

Only frames with no static parent (see getParent()) can be moved.

Parameters
parent[in] The frame to attach frame to.
state[inout] The state to which the attachment is written.

◆ doGetTransform()

virtual rw::math::Transform3D doGetTransform ( const rw::kinematics::State state) const
protectedpure virtual

◆ fTf()

rw::math::Transform3D fTf ( const CPtr to,
const rw::kinematics::State state 
) const

Get the transform of other frame relative to this frame.

Parameters
to[in] the other frame
state[in] the state.
Returns
transform of frame to relative to this frame.

◆ getChildren()

iterator_pair getChildren ( )
inline

Iterator pair for the fixed children of the frame.

◆ getChildrenList()

std::vector<Frame::Ptr> getChildrenList ( const rw::kinematics::State state)

get a list of all frame children

Parameters
state[in] the state of to look for children in.
Returns
a vector with the children

◆ getDafChildren()

iterator_pair getDafChildren ( const rw::kinematics::State state)

Iterator pair for the dynamically attached children of the frame.

◆ getDafParent()

rw::kinematics::Frame* getDafParent ( const rw::kinematics::State state)

The dynamically attached parent or NULL if the frame is not a DAF.

◆ getDOF()

int getDOF ( ) const
inline

The number of degrees of freedom (dof) of the frame.

The dof is the number of joint values that are used for controlling the frame.

Given a set joint values of type State, the getDof() number of joint values for the frame can be read and written with State::getQ() and State::setQ().

Returns
The number of degrees of freedom of the frame.

◆ getParent() [1/2]

rw::kinematics::Frame* getParent ( const rw::kinematics::State state)

Returns the parent of the frame.

If no static parent exists it look for at DAF parent. If such does not exists either it returns NULL.

Parameters
state[in] the state to consider
Returns
the parent

◆ getParent() [2/2]

const rw::kinematics::Frame* getParent ( const rw::kinematics::State state) const

Returns the parent of the frame.

If no static parent exists it look for at DAF parent. If such does not exists either it returns NULL.

Parameters
state[in] the state to consider
Returns
the parent

◆ getPropertyMap() [1/2]

rw::core::PropertyMap& getPropertyMap ( )
inline

Miscellaneous properties of the frame.

The property map of the frame is provided to let the user store various settings for the frame. The settings are typically loaded from setup files.

The low-level manipulations of the property map can be cumbersome. To ease these manipulations, the PropertyAccessor utility class has been provided. Instances of this class are provided for a number of common settings, however it is undecided if these properties are a public part of RobWork.

Returns
The property map of the frame.

◆ getPropertyMap() [2/2]

const rw::core::PropertyMap& getPropertyMap ( ) const
inline

Miscellaneous properties of the frame.

The property map of the frame is provided to let the user store various settings for the frame. The settings are typically loaded from setup files.

The low-level manipulations of the property map can be cumbersome. To ease these manipulations, the PropertyAccessor utility class has been provided. Instances of this class are provided for a number of common settings, however it is undecided if these properties are a public part of RobWork.

Returns
The property map of the frame.

◆ getTransform()

rw::math::Transform3D getTransform ( const rw::kinematics::State state) const
inline

The transform of the frame relative to its parent.

The transform is calculated for the joint values of state.

The exact implementation of getTransform() depends on the type of frame. See for example RevoluteJoint and PrismaticJoint.

Parameters
state[in] Joint values for the forward kinematics tree.
Returns
The transform of the frame relative to its parent.

◆ isDAF()

bool isDAF ( )

Test if this frame is a Dynamically Attachable Frame.

Returns
true if this frame is a DAF, false otherwise

◆ multiplyTransform()

void multiplyTransform ( const rw::math::Transform3D<> &  parent,
const rw::kinematics::State state,
rw::math::Transform3D<> &  result 
) const
inline

Post-multiply the transform of the frame to the parent transform.

The transform is calculated for the joint values of state.

The exact implementation of getTransform() depends on the type of frame. See for example RevoluteJoint and PrismaticJoint.

Parameters
parent[in] The world transform of the parent frame.
state[in] Joint values for the forward kinematics tree.
result[in] The transform of the frame in the world frame.

◆ operator!=()

bool operator!= ( const Frame rhs)
inline

Check if not equal.

Parameters
rhs[in] the Frame to compare with
Returns
true if not equal
false if equal

◆ operator==()

bool operator== ( const Frame rhs)

Compares the Frame to see if they are the same Checks the statedata, parent frame and chld frame.

Parameters
rhs[in] the Frame to compare with
Returns
true if equal
false if not equal

◆ wTf()

rw::math::Transform3D wTf ( const rw::kinematics::State state) const

Get the transform relative to world.

Parameters
state[in] the state.
Returns
transform relative to world.

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