Class 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​(Frame 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​(Frame child, Frame 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​(Frame root)
      All frames reachable from root for a tree structure.

      This is a tremendously useful utility.
      static FrameVector findAllFrames​(Frame root, State state)
      All frames reachable from root for a tree structure of
      state.

      This is a tremendously useful utility.
      static Transform3Dd frameTframe​(Frame from, Frame 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​(Frame 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​(Frame item, Frame gripper, State state)
      Grip item with gripper thereby modifying state.

      item must be a DAF.

      static void gripFrame​(MovableFrame item, Frame gripper, State state)
      Grip item with gripper thereby modifying state.

      item must be a DAF.

      static boolean isDAF​(Frame frame)
      True if frame is a DAF and false otherwise.
      static boolean isFixedFrame​(Frame frame)
      Check if frame is fixed.
      static FrameVector parentToChildChain​(Frame parent, Frame child, State state)
      The chain of frames connecting parent to child.

      parent is included in the list, but child is excluded.
      static FrameVector reverseChildToParentChain​(Frame child, Frame parent, State state)
      Like ChildToParentChain() except that the frames are returned
      in the reverse order.
      static Frame worldFrame​(Frame 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 Transform3Dd worldTframe​(Frame 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

      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Kinematics

        public Kinematics​(long cPtr,
                          boolean cMemoryOwn)
    • Method Detail

      • getCPtr

        public static long getCPtr​(Kinematics obj)
      • delete

        public void delete()
      • worldTframe

        public static Transform3Dd worldTframe​(Frame 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 Transform3Dd frameTframe​(Frame from,
                                               Frame 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​(Frame 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​(Frame 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​(Frame 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​(Frame child,
                                                     Frame 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​(Frame child,
                                                            Frame parent,
                                                            State state)
        Like ChildToParentChain() except that the frames are returned
        in the reverse order.
      • parentToChildChain

        public static FrameVector parentToChildChain​(Frame parent,
                                                     Frame 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​(Frame 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​(Frame frame)
        True if frame is a DAF and false otherwise.
      • isFixedFrame

        public static boolean isFixedFrame​(Frame frame)
        Check if frame is fixed.
        Parameters:
        frame - [in] the frame.
        Returns:
        true if fixed, false otherwise.
      • gripFrame

        public static void gripFrame​(Frame item,
                                     Frame gripper,
                                     State state)
        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.
        Note: An exception is thrown if item is not a DAF.
        Note: See also gripFrame(MovableFrame*, Frame*, State&).
      • gripFrame

        public static void gripFrame​(MovableFrame item,
                                     Frame gripper,
                                     State state)
        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.
        Note: An exception is thrown if item is not a DAF.
        Note: See also gripFrame(Frame*, Frame*, State&).
      • getStaticFrameGroups

        public static VectorVectorFrame getStaticFrameGroups​(Frame 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.