RobWorkProject
Static Public Member Functions | List of all members
Kinematics Class Reference

Utility functions for the rw::kinematics module. More...

#include <Kinematics.hpp>

Static Public Member Functions

static math::Transform3D worldTframe (const Frame *to, const State &state)
 The transform of frame in relative to the world frame. More...
 
static math::Transform3D frameTframe (const Frame *from, const Frame *to, const State &state)
 The transform of frame to relative to frame from. More...
 
static std::vector< Frame * > findAllFrames (Frame *root, const State &state)
 All frames reachable from root for a tree structure of state. More...
 
static std::vector< Frame * > findAllFrames (Frame *root)
 All frames reachable from root for a tree structure. More...
 
static FrameworldFrame (Frame *frame, const State &state)
 Find the world frame of the workcell by traversing the path from frame to the root of the tree. More...
 
static const FrameworldFrame (const Frame *frame, const State &state)
 Find the world frame of the workcell by traversing the path from frame to the root of the tree. More...
 
static std::vector< Frame * > childToParentChain (Frame *child, Frame *parent, const State &state)
 The chain of frames connecting child to parent. More...
 
static std::vector< Frame * > reverseChildToParentChain (Frame *child, Frame *parent, const State &state)
 Like ChildToParentChain() except that the frames are returned in the reverse order.
 
static std::vector< Frame * > parentToChildChain (Frame *parent, Frame *child, const State &state)
 The chain of frames connecting parent to child. More...
 
static std::map< std::string, kinematics::Frame * > buildFrameMap (kinematics::Frame *root, const kinematics::State &state)
 A map linking frame names to frames. More...
 
static bool isDAF (const Frame *frame)
 True if frame is a DAF and false otherwise.
 
static bool isFixedFrame (const Frame *frame)
 Check if frame is fixed. More...
 
static void gripFrame (Frame *item, Frame *gripper, State &state)
 Grip item with gripper thereby modifying state. More...
 
static void gripFrame (MovableFrame *item, Frame *gripper, State &state)
 Grip item with gripper thereby modifying state. More...
 
static std::vector< FrameListgetStaticFrameGroups (Frame *root, const State &state)
 Get static frame groups. More...
 
static std::vector< ConstFrameListgetStaticFrameGroups (const Frame *root, const State &state)
 Get static frame groups. More...
 

Detailed Description

Utility functions for the rw::kinematics module.

Member Function Documentation

◆ buildFrameMap()

static std::map<std::string, kinematics::Frame*> buildFrameMap ( kinematics::Frame root,
const kinematics::State state 
)
static

A map linking frame names to frames.

The map contains an entry for every frame below root in the tree with structure described by state.

Parameters
root[in] Root of the kinematics tree to search.
state[in] The kinematics tree structure.

◆ childToParentChain()

static std::vector<Frame*> childToParentChain ( Frame child,
Frame parent,
const State state 
)
static

The chain of frames connecting child to parent.

child is included in the chain, but parent is not included. If parent is NULL then the entire path from child to the world frame is returned. If child as well as parent is NULL then the empty chain is gracefully returned.

The state gives the connectedness of the tree.

If parent is not on the chain from child towards the root, then an exception is thrown.

◆ findAllFrames() [1/2]

static std::vector<Frame*> findAllFrames ( Frame root,
const State state 
)
static

All frames reachable from root for a tree structure of state.

This is a tremendously useful utility. An alternative would be to have an iterator interface for trees represented by work cell states.

We give no guarantee on the ordering of the frames.

Parameters
root[in] The root node from where the frame search is started.
state[in] The structure of the tree.
Returns
All reachable frames.

◆ findAllFrames() [2/2]

static std::vector<Frame*> findAllFrames ( Frame root)
static

All frames reachable from root for a tree structure.

This is a tremendously useful utility. An alternative would be to have an iterator interface for trees represented by work cell states.

We give no guarantee on the ordering of the frames.

DAF are not included.

Parameters
root[in] The root node from where the frame search is started.
Returns
All reachable frames.

◆ frameTframe()

static math::Transform3D frameTframe ( const Frame from,
const Frame to,
const State state 
)
static

The transform of frame to relative to frame from.

FrameTframe() is related to WorldTframe() as follows:

frameTframe(from, to, state) ==
inverse(worldTframe(from, state)) *
worldTframe(to, state);
Parameters
from[in] The start frame.
to[in] The end frame.
state[in] The state of the kinematics tree.
Returns
The transform from the start frame to the end frame.

◆ getStaticFrameGroups() [1/2]

static std::vector<FrameList> getStaticFrameGroups ( Frame root,
const State state 
)
static

Get static frame groups.

A static frame group consist of frames that are fixed with respect to the other frames in the group. A Dynamically Attachable Frame (DAF) or a MovableFrame will divide a static group.

Parameters
root[in] the root frame of the tree to search.
state[in] containing information about the current tree state and the Dynamically Attachable Frames (DAF).
Returns
vector with the frame groups.

◆ getStaticFrameGroups() [2/2]

static std::vector<ConstFrameList> getStaticFrameGroups ( const Frame root,
const State state 
)
static

Get static frame groups.

A static frame group consist of frames that are fixed with respect to the other frames in the group. A Dynamically Attachable Frame (DAF) or a MovableFrame will divide a static group.

Parameters
root[in] the root frame of the tree to search.
state[in] containing information about the current tree state and the Dynamically Attachable Frames (DAF).
Returns
vector with the frame groups.

◆ gripFrame() [1/2]

static void gripFrame ( Frame item,
Frame gripper,
State state 
)
static

Grip item with gripper thereby modifying state.

item must be a DAF.

Parameters
item[in] the frame to grip.
gripper[in] the grasping frame.
state[in/out] the state.
Exceptions
Anexception is thrown if item is not a DAF.
See also
See also gripFrame(MovableFrame*, Frame*, State&).

◆ gripFrame() [2/2]

static void gripFrame ( MovableFrame item,
Frame gripper,
State state 
)
static

Grip item with gripper thereby modifying state.

item must be a DAF.

Parameters
item[in] the frame to grip.
gripper[in] the grasping frame.
state[in/out] the state.
Exceptions
Anexception is thrown if item is not a DAF.
See also
See also gripFrame(Frame*, Frame*, State&).

◆ isFixedFrame()

static bool isFixedFrame ( const Frame frame)
static

Check if frame is fixed.

Parameters
frame[in] the frame.
Returns
true if fixed, false otherwise.

◆ parentToChildChain()

static std::vector<Frame*> parentToChildChain ( Frame parent,
Frame child,
const State state 
)
static

The chain of frames connecting parent to child.

parent is included in the list, but child is excluded. If parent as well as child is NULL then the empty chain is returned. Otherwise parent is included even if parent is NULL.

◆ worldFrame() [1/2]

static Frame* worldFrame ( Frame frame,
const State state 
)
static

Find the world frame of the workcell by traversing the path from frame to the root of the tree.

The state state is needed to retrieve the parent frames, but the world frame returned is the same for any (valid) state.

◆ worldFrame() [2/2]

static const Frame* worldFrame ( const Frame frame,
const State state 
)
static

Find the world frame of the workcell by traversing the path from frame to the root of the tree.

The state state is needed to retrieve the parent frames, but the world frame returned is the same for any (valid) state.

◆ worldTframe()

static math::Transform3D worldTframe ( const Frame to,
const State state 
)
static

The transform of frame in relative to the world frame.

If to=NULL the method returns a $4\times 4$ identify matrix

Parameters
to[in] The transform for which to find the world frame.
state[in] The state of the kinematics tree.
Returns
The transform of the frame relative to the world frame.

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