com.kuka.roboticsAPI.geometricModel
Class TreeUtilities

java.lang.Object
  extended by com.kuka.roboticsAPI.geometricModel.TreeUtilities

public final class TreeUtilities
extends Object

Helper class which implements the transformation calculation between two frames in the frame-tree.

This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

Method Summary
static void buildFramePath(ObjectFrame frame, ObjectFrame strip, StringBuilder sb)
          Adds the path of the given frame from its root to the given StringBuilder.
static ITransformation calculateTransformation(AbstractFrame source, AbstractFrame destination, boolean staticPathOnly)
          Calculates the transformation from the given source to the destination.
static PositionInformation calculateTransformationFrameWithRedundancy(AbstractFrame source, AbstractFrame destination)
          Calculates the transformation from the given source to the destination.
static void dumpTree(PrintStream out, ObjectFrame start)
          Dumps the frame tree starting from the given frame.
static AbstractFrame findCommonRoot(AbstractFrame frame1, AbstractFrame frame2, boolean onlyStatic)
          Finds the first common ancestor of the given frames in the tree.
static String getFramePath(ObjectFrame frame, ObjectFrame strip)
          Returns the path of the given frame from its root.
static List<AbstractFrame> getPathToRoot(AbstractFrame startFrame, boolean onlyStatic)
          Returns a list of frames that contains the path from the given frame along it's parents to the root of the tree.
static boolean havePath(AbstractFrame source, AbstractFrame destination)
          Determines if the two given frames have a path (can have dynamic frames in between) in the tree that connects the two.
static boolean haveStaticPath(AbstractFrame source, AbstractFrame destination)
          Determines if the two given frames have a static path in the tree that connects the two.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getFramePath

public static String getFramePath(ObjectFrame frame,
                                  ObjectFrame strip)
Returns the path of the given frame from its root.

Parameters:
frame - a frame
strip - if this frame is an ancestor, strip its path from the result. May be null.
Returns:
the full path of the frame, stripped by the path of the possibly parent frame

buildFramePath

public static void buildFramePath(ObjectFrame frame,
                                  ObjectFrame strip,
                                  StringBuilder sb)
Adds the path of the given frame from its root to the given StringBuilder. If the frame is null, nothing will be appended.

Parameters:
frame - a frame
strip - if this frame is an ancestor, strip its path from the result. May be null.
sb - the string builder to which the path will be appended

getPathToRoot

public static List<AbstractFrame> getPathToRoot(AbstractFrame startFrame,
                                                boolean onlyStatic)
Returns a list of frames that contains the path from the given frame along it's parents to the root of the tree. Optionally stops at the first dynamic frame, which is then included as the last element in the resulting list.

Parameters:
startFrame - the frame from which to start the search.
onlyStatic - if true, stop the search at the first dynamic frame
Returns:
a list of frames, ordered from the given frame to the root or the last non-dynamic frame in the path to the root
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

findCommonRoot

public static AbstractFrame findCommonRoot(AbstractFrame frame1,
                                           AbstractFrame frame2,
                                           boolean onlyStatic)
Finds the first common ancestor of the given frames in the tree. Optionally only follows static frame relations.

Parameters:
frame1 - first frame
frame2 - second frame
onlyStatic - if true, no dynamic frames will be traversed
Returns:
the first common ancestor of the frames, or null if none could be found
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

calculateTransformation

public static ITransformation calculateTransformation(AbstractFrame source,
                                                      AbstractFrame destination,
                                                      boolean staticPathOnly)
Calculates the transformation from the given source to the destination.

No checks on the parameters are performed. This must be done by the caller.

Parameters:
source - The source frame.
destination - The destination frame.
staticPathOnly - Indicates if the user only wants to walk along a static path.
Returns:
The transformation from the source frame to the destination frame.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

calculateTransformationFrameWithRedundancy

public static PositionInformation calculateTransformationFrameWithRedundancy(AbstractFrame source,
                                                                             AbstractFrame destination)
Calculates the transformation from the given source to the destination. Redundancy information along the path is collected. The results are assigned to a PositionInformation that is returned to the caller.

No checks on the parameters are performed. This must be done by the caller.

Parameters:
source - The source frame.
destination - The destination frame.
Returns:
A new PositionInformation containing the transformation from the source frame to the destination frame and the redundancy information gathered along the path for both current and commanded position. The parent of the created frames is the given source frame.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

havePath

public static boolean havePath(AbstractFrame source,
                               AbstractFrame destination)
Determines if the two given frames have a path (can have dynamic frames in between) in the tree that connects the two.

No checks on the parameters are performed. This must be done by the caller.

Parameters:
source - The source frame.
destination - The destination frame.
Returns:
True if a static path exists.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

haveStaticPath

public static boolean haveStaticPath(AbstractFrame source,
                                     AbstractFrame destination)
Determines if the two given frames have a static path in the tree that connects the two.

No checks on the parameters are performed. This must be done by the caller.

Parameters:
source - the source frame.
destination - the destination frame.
Returns:
true if a static path exists.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

dumpTree

public static void dumpTree(PrintStream out,
                            ObjectFrame start)
Dumps the frame tree starting from the given frame.

dumpTree(World.Current) will print out all frames connected to the world.

Parameters:
out - the stream to dump the tree to
start - the start frame.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.


Copyright © 2019. All rights reserved.