Package org.robwork.sdurw_kinematics
Class Frame
- java.lang.Object
-
- org.robwork.sdurw_kinematics.StateData
-
- org.robwork.sdurw_kinematics.Frame
-
- Direct Known Subclasses:
FixedFrame
,Joint
,MovableFrame
public class Frame extends StateData
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 Summary
Constructors Constructor Description Frame(long cPtr, boolean cMemoryOwn)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
attachTo(FramePtr parent, State state)
Move a frame within the tree.
The frame frame is detached from its parent and reattached to
parent.void
delete()
boolean
equals(Frame rhs)
Compares the Frame to see if they are the same
Checks the statedata, parent frame and chld frameTransform3D
fTf(FrameCPtr to, State state)
Get the transform of other frame relative to this frame.SWIGTYPE_p_rw__core__iter_pairT_rw__common__ConcatVectorIteratorT_rw__kinematics__Frame_t_t
getChildren()
SWIGTYPE_p_rw__core__iter_pairT_rw__common__ConcatVectorIteratorT_rw__kinematics__Frame_t_t
getChildren(State state)
Iterator pair for all children of the frame.VectorFramePtr
getChildrenList(State state)
get a list of all frame childrenstatic long
getCPtr(Frame obj)
SWIGTYPE_p_rw__core__iter_pairT_rw__common__ConcatVectorIteratorT_rw__kinematics__Frame_t_t
getDafChildren(State state)
Frame
getDafParent(State state)
int
getDOF()
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().
Frame
getParent()
The parent of the frame or NULL if the frame is a DAF.Frame
getParent(State state)
Returns the parent of the frame
If no static parent exists it look for at DAF parent.PropertyMap
getPropertyMap()
Transform3D
getTransform(State state)
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.boolean
isDAF()
Test if this frame is a Dynamically Attachable Framevoid
multiplyTransform(Transform3D parent, State state, Transform3D result)
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.boolean
notEqual(Frame rhs)
Check if not equaljava.lang.String
toString()
Transform3D
wTf(State state)
Get the transform relative to world.
-
-
-
Method Detail
-
getCPtr
public static long getCPtr(Frame obj)
-
multiplyTransform
public void multiplyTransform(Transform3D parent, State state, Transform3D result)
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.
-
getTransform
public Transform3D getTransform(State state)
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.
-
getPropertyMap
public PropertyMap getPropertyMap()
-
getDOF
public int getDOF()
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
public Frame getParent()
The parent of the frame or NULL if the frame is a DAF.
-
getParent
public Frame getParent(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
-
getChildren
public SWIGTYPE_p_rw__core__iter_pairT_rw__common__ConcatVectorIteratorT_rw__kinematics__Frame_t_t getChildren()
-
getChildren
public SWIGTYPE_p_rw__core__iter_pairT_rw__common__ConcatVectorIteratorT_rw__kinematics__Frame_t_t getChildren(State state)
Iterator pair for all children of the frame.
-
getChildrenList
public VectorFramePtr getChildrenList(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
public SWIGTYPE_p_rw__core__iter_pairT_rw__common__ConcatVectorIteratorT_rw__kinematics__Frame_t_t getDafChildren(State state)
-
attachTo
public void attachTo(FramePtr parent, 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.
-
isDAF
public boolean isDAF()
Test if this frame is a Dynamically Attachable Frame- Returns:
- true if this frame is a DAF, false otherwise
-
wTf
public Transform3D wTf(State state)
Get the transform relative to world.- Parameters:
state
- [in] the state.- Returns:
- transform relative to world.
-
fTf
public Transform3D fTf(FrameCPtr to, State state)
Get the transform of other frame relative to this frame.- Parameters:
to
- [in] the other framestate
- [in] the state.- Returns:
- transform of frame to relative to this frame.
-
equals
public boolean equals(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
-
notEqual
public boolean notEqual(Frame rhs)
Check if not equal- Parameters:
rhs
- [in] the Frame to compare with- Returns:
- true if not equal
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-