Package org.robwork.sdurw_kinematics
Class Kinematics
- java.lang.Object
-
- org.robwork.sdurw_kinematics.Kinematics
-
public class Kinematics extends java.lang.Object
Utility functions for the rw::kinematics module.
-
-
Constructor Summary
Constructors Constructor Description Kinematics(long cPtr, boolean cMemoryOwn)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MapStringFrame
buildFrameMap(FramePtr root, State state)
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.
static FrameVector
childToParentChain(FramePtr child, FramePtr parent, State state)
The chain of frames connecting child to parent.
child is included in the chain, but parent is not included.void
delete()
static FrameVector
findAllFrames(FramePtr root)
All frames reachable from root for a tree structure.
This is a tremendously useful utility.static FrameVector
findAllFrames(FramePtr root, State state)
All frames reachable from root for a tree structure of
state.
This is a tremendously useful utility.static Transform3D
frameTframe(FrameCPtr from, FrameCPtr to, State state)
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 long
getCPtr(Kinematics obj)
static VectorVectorFrame
getStaticFrameGroups(FramePtr root, State state)
Get static frame groups.
A static frame group consist of frames that are fixed with respect to the other frames in
the group.static void
gripFrame(FramePtr item, FramePtr gripper, State state)
static void
gripFrame(MovableFrame item, FramePtr gripper, State state)
static boolean
isDAF(FrameCPtr frame)
True if frame is a DAF and false otherwise.static boolean
isFixedFrame(FrameCPtr frame)
Check if frame is fixed.static FrameVector
parentToChildChain(FramePtr parent, FramePtr child, State state)
The chain of frames connecting parent to child.
parent is included in the list, but child is excluded.static FrameVector
reverseChildToParentChain(FramePtr child, FramePtr parent, State state)
Like ChildToParentChain() except that the frames are returned
in the reverse order.static Frame
worldFrame(FramePtr frame, State state)
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.static Transform3D
worldTframe(FrameCPtr to, State state)
The transform of frame in relative to the world frame.
If to=NULL the method returns a 4 \times 4 identify matrix
-
-
-
Method Detail
-
getCPtr
public static long getCPtr(Kinematics obj)
-
delete
public void delete()
-
worldTframe
public static Transform3D worldTframe(FrameCPtr to, State state)
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.
-
frameTframe
public static Transform3D frameTframe(FrameCPtr from, FrameCPtr to, State state)
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.
-
findAllFrames
public static FrameVector findAllFrames(FramePtr root, State state)
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
public static FrameVector findAllFrames(FramePtr root)
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.
-
worldFrame
public static Frame worldFrame(FramePtr frame, State state)
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.
-
childToParentChain
public static FrameVector childToParentChain(FramePtr child, FramePtr parent, State state)
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.
-
reverseChildToParentChain
public static FrameVector reverseChildToParentChain(FramePtr child, FramePtr parent, State state)
Like ChildToParentChain() except that the frames are returned
in the reverse order.
-
parentToChildChain
public static FrameVector parentToChildChain(FramePtr parent, FramePtr child, State state)
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.
-
buildFrameMap
public static MapStringFrame buildFrameMap(FramePtr root, State state)
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.
-
isDAF
public static boolean isDAF(FrameCPtr frame)
True if frame is a DAF and false otherwise.
-
isFixedFrame
public static boolean isFixedFrame(FrameCPtr frame)
Check if frame is fixed.- Parameters:
frame
- [in] the frame.- Returns:
- true if fixed, false otherwise.
-
gripFrame
public static void gripFrame(MovableFrame item, FramePtr gripper, State state)
-
getStaticFrameGroups
public static VectorVectorFrame getStaticFrameGroups(FramePtr root, State state)
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.
-
-