com.kuka.geometry
Class LocalFrame

java.lang.Object
  extended by com.kuka.geometry.Frame
      extended by com.kuka.geometry.LocalFrame

public class LocalFrame
extends Frame

This is a lightweight class that is meant for frame calculations and intermediate results. A LocalFrame that is no longer referenced will be collected by the JVM garbage collector. A LocalFrame instance can be modified.

This class is not thread safe. If a frame will be used by concurrent threads, external synchronization must be used.

See Also:
LocalFrame(Frame, ITransformation)

Constructor Summary
LocalFrame()
          Creates a new frame instance that has no parent, i.e. a new root frame.
LocalFrame(Frame parent, IFrameConnection connection)
          Creates a new frame instance with a specialized connection to a parent frame.
LocalFrame(Frame parent, ITransformation trafoFromParent)
          Creates a new frame instance that will use the given frame as parent, with a static connection to that frame.
LocalFrame(String name)
          Creates a new frame instance that has no parent, i.e. a new root frame.
LocalFrame(String name, Frame parent, ITransformation trafoFromParent)
          Creates a new frame instance that will use the given frame as parent, with a static connection to that frame.
 
Method Summary
 void connectToParent(Frame parent, IFrameConnection connection)
          Connects this frame to the given parent frame with the given connection.
 void connectToParent(Frame parent, ITransformation trafoFromParent)
          Changes this frame's parent and the connection to the parent.
static LocalFrame copyOf(Frame orig, Frame newParent)
          Creates a new frame instance from an original frame, which must have a direct or indirect connection to the given newParent frame.
 void disconnectFromParent()
          Disconnects this frame from its parent frame and connection.
 void setName(String name)
          Sets the name of this frame.
 void setTransformationFromParent(ITransformation transformation)
          Changes this frame's spatial relation to the parent.
 
Methods inherited from class com.kuka.geometry.Frame
calculateTransformationTo, distanceTo, getConnectionFromParent, getName, getParent, getRedundancyDataMap, getRedundancyInformation, getTransformationFromParent, hasAncestor, hasPathTo, hasStaticPathTo, isNearTo, representationOf, representationOf, rotate, rotate, rotateTo, rotationalDistanceTo, setConnectionFromParent, setRedundancyInformation, toString, transform, transform, transformTo, translate, translate, translateTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LocalFrame

public LocalFrame()
Creates a new frame instance that has no parent, i.e. a new root frame.


LocalFrame

public LocalFrame(String name)
Creates a new frame instance that has no parent, i.e. a new root frame.

Parameters:
name - the frame's initial name

LocalFrame

public LocalFrame(Frame parent,
                  ITransformation trafoFromParent)
Creates a new frame instance that will use the given frame as parent, with a static connection to that frame.

For example: To create a new frame under otherFrame, that is shifted 100 mm along the Y axis and turned by 45° around the Z (resp. A) axis (all seen in the coordinate system of otherFrame), you might use this construct:

Frame myFrame = new Frame(otherFrame, Transformation.ofDeg(0, 100, 0, 45, 0, 0));

Parameters:
parent - a frame
trafoFromParent - a spatial transformation, seen from the parent frame
Throws:
IllegalArgumentException - if exactly one of parent or parentConnection parameter is null
See Also:
Transformation

LocalFrame

public LocalFrame(String name,
                  Frame parent,
                  ITransformation trafoFromParent)
Creates a new frame instance that will use the given frame as parent, with a static connection to that frame.

For example: To create a new frame under otherFrame, that is shifted 100 mm along the Y axis and turned by 45° around the Z (resp. A) axis (all seen in the coordinate system of otherFrame), you might use this construct:

Frame myFrame = new Frame(otherFrame, Transformation.ofDeg(0, 100, 0, 45, 0, 0));

Parameters:
name - the frame's initial name
parent - a frame
trafoFromParent - a spatial transformation, seen from the parent frame
Throws:
IllegalArgumentException - if exactly one of parent or parentConnection parameter is null
See Also:
Transformation

LocalFrame

public LocalFrame(Frame parent,
                  IFrameConnection connection)
Creates a new frame instance with a specialized connection to a parent frame. This constructor is meant for advanced use cases.

Parameters:
parent - a frame
connection - a frame connection
Throws:
IllegalArgumentException - if any argument is null
Method Detail

copyOf

public static LocalFrame copyOf(Frame orig,
                                Frame newParent)
Creates a new frame instance from an original frame, which must have a direct or indirect connection to the given newParent frame. The new frame will be in the same location and have the same orientation as the original frame. The new frame's parent frame will be the given newParent frame, and the new frame will be statically connected to the parent frame. This method uses Frame.calculateTransformationTo(Frame) to query the original frame's position.

Parameters:
orig - the original frame
newParent - the parent frame for the newly created frame
Returns:
a new frame instance with the given newParent
Throws:
IllegalArgumentException - if there is no static connection between orig and newParent, or if any argument is null
IllegalArgumentException - if there is no connection or an unknown connection type between the original frame and the new parent frame, or if any argument is null
IllegalStateException - if the relation between the involved frames could not be determined
ThreadInterruptedException - if the thread was interrupted during execution. The thread interrupt flag will be set if the thread was interrupted (that is, Thread.isInterrupted() will return true)

setName

public void setName(String name)
Description copied from class: Frame
Sets the name of this frame.

Overrides:
setName in class Frame
Parameters:
name - any string, including null or "".

connectToParent

public void connectToParent(Frame parent,
                            IFrameConnection connection)
Description copied from class: Frame
Connects this frame to the given parent frame with the given connection.

Useful for advanced use cases - This frame's position in space may be changed. The positions of frames connected to this frame will also be affected by this method.

Parameters:
parent - the new parent frame. May be null if the connection is null also.
connection - the type of connection to the new parent frame. May be null if the parent is null also.
Throws:
IllegalArgumentException - if this frame is given as parent, or if one but not all of the arguments is null

connectToParent

public void connectToParent(Frame parent,
                            ITransformation trafoFromParent)
Changes this frame's parent and the connection to the parent. This method changes this frame's position in space. The positions of frames connected to this frame will also be affected by this method.

Parameters:
parent - a frame
trafoFromParent - a spatial transformation, seen from the parent frame
Throws:
IllegalArgumentException - if any argument is null
See Also:
Transformation

setTransformationFromParent

public void setTransformationFromParent(ITransformation transformation)
Description copied from class: Frame
Changes this frame's spatial relation to the parent. This frame's position in space may be changed. The positions of frames connected to this frame will also be affected by this method.

Parameters:
transformation - a spatial transformation, seen from the parent frame
Throws:
IllegalArgumentException - if trafoFromParent is null
IllegalStateException - if this frame's parent connection type is anything other than StaticConnection
See Also:
Transformation

disconnectFromParent

public void disconnectFromParent()
Description copied from class: Frame
Disconnects this frame from its parent frame and connection.



Copyright © 2019. All rights reserved.