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

◆ findAllFrames() [2/2]

static std::vector<rw::kinematics::Frame*> findAllFrames ( rw::core::Ptr< rw::kinematics::Frame root,
const rw::kinematics::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.

◆ frameTframe()

static math::Transform3D frameTframe ( const rw::core::Ptr< const rw::kinematics::Frame > &  from,
const rw::core::Ptr< const rw::kinematics::Frame > &  to,
const rw::kinematics::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);
static math::Transform3D worldTframe(const rw::core::Ptr< const rw::kinematics::Frame > &to, const rw::kinematics::State &state)
The transform of frame in relative to the world frame.
static math::Transform3D frameTframe(const rw::core::Ptr< const rw::kinematics::Frame > &from, const rw::core::Ptr< const rw::kinematics::Frame > &to, const rw::kinematics::State &state)
The transform of frame to relative to frame from.
InertiaMatrix< Q > inverse(const InertiaMatrix< Q > &aRb)
Calculates the inverse of a rotation matrix.
Definition: InertiaMatrix.hpp:332
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/4]

static std::vector<ConstFrameList> getStaticFrameGroups ( const Frame root,
const rw::kinematics::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/4]

static std::vector<FrameList> getStaticFrameGroups ( Frame root,
const rw::kinematics::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() [3/4]

static std::vector<ConstFrameList> getStaticFrameGroups ( rw::core::Ptr< const Frame root,
const rw::kinematics::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() [4/4]

static std::vector<FrameList> getStaticFrameGroups ( rw::core::Ptr< rw::kinematics::Frame root,
const rw::kinematics::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 ( MovableFrame item,
rw::core::Ptr< rw::kinematics::Frame gripper,
rw::kinematics::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( rw::core::Ptr<rw::kinematics::Frame>, rw::core::Ptr<rw::kinematics::Frame>, State&).

◆ gripFrame() [2/2]

static void gripFrame ( rw::core::Ptr< rw::kinematics::Frame item,
rw::core::Ptr< rw::kinematics::Frame gripper,
rw::kinematics::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(Movablerw::kinematics::Frame*, rw::core::Ptr<rw::kinematics::Frame>, State&).

◆ isFixedFrame()

static bool isFixedFrame ( const rw::core::Ptr< const rw::kinematics::Frame > &  frame)
static

Check if frame is fixed.

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

◆ parentToChildChain()

static std::vector<rw::kinematics::Frame*> parentToChildChain ( rw::core::Ptr< rw::kinematics::Frame parent,
rw::core::Ptr< rw::kinematics::Frame child,
const rw::kinematics::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 const Frame* worldFrame ( const rw::core::Ptr< const Frame > &  frame,
const rw::kinematics::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 rw::kinematics::Frame* worldFrame ( rw::core::Ptr< rw::kinematics::Frame frame,
const rw::kinematics::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 rw::core::Ptr< const rw::kinematics::Frame > &  to,
const rw::kinematics::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: