com.kuka.roboticsAPI.geometricModel
Class SpatialObject

java.lang.Object
  extended by com.kuka.common.TaggableObject
      extended by com.kuka.roboticsAPI.geometricModel.SceneGraphObject
          extended by com.kuka.roboticsAPI.geometricModel.SpatialObject
All Implemented Interfaces:
com.kuka.common.ITaggable
Direct Known Subclasses:
PhysicalObject

public class SpatialObject
extends SceneGraphObject

A spatial object describes a geometric area.

This must not be a physical object but just a special region of interest, like a safe working area, or just an object that does not have physical properties in the station model. For that purpose, a spatial object has child frames describing the spatial region. Also, the object has an identifier.

The Robotics API always assumes the translation part of transformations to be given in [mm].


Constructor Summary
SpatialObject(String name)
          Creates a new spatial object.
 
Method Summary
 void attachTo(ObjectFrame frame)
          Changes the objects root frame parent to the given frame and sets the transformation to MatrixTransformation.IDENTITY.
 void attachTo(ObjectFrame frame, ITransformation trans)
          Changes the objects root frame parent to the given frame and sets the root frame transformation to the given transformation.
protected  void changeParent(ObjectFrame frame)
          Sets the new parent frame for this object if the new parent frame is not part of the subtree.
 void detach()
          Removes the connection between an object and its parent by removing the parent of the objects root frame.
 void setName(String name)
          Sets the name of this object.
 void switchParent(ObjectFrame frame)
          Changes the objects root frame parent to the given frame.
 void switchParent(SceneGraphObject obj)
          Changes the objects root frame parent to the root frame of the given object.
 
Methods inherited from class com.kuka.roboticsAPI.geometricModel.SceneGraphObject
addChildFrame, addChildFrame, addChildFrame, addChildFrame, addChildFrame, addChildFrame, allObjects, changeFrameParent, changeFramePosition, findMembersOfGroup, findRobot, getAllFrames, getAllUserParameters, getChild, getChildFrameLock, getChildren, getFrame, getName, getParent, getRootFrame, getRootOfGroup, getUserParameter, groupToParent, isDescendantOf, isGroupedToParent, isMemberOfGroup, isRootOfGroup, removeFrame, renameFrame, setRootFrame, setUserParameter, toString, ungroupFromParent
 
Methods inherited from class com.kuka.common.TaggableObject
getTag, setTag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SpatialObject

public SpatialObject(String name)
Creates a new spatial object.

Parameters:
name - the name of the object
Method Detail

detach

public void detach()
Removes the connection between an object and its parent by removing the parent of the objects root frame.


setName

public void setName(String name)
Sets the name of this object.

Overrides:
setName in class SceneGraphObject
Parameters:
name - the new name of this object.

attachTo

public void attachTo(ObjectFrame frame)
Changes the objects root frame parent to the given frame and sets the transformation to MatrixTransformation.IDENTITY. This is only allowed, if the frame is not part of the objects subtree.

If the object is grouped to the former parent object ( groupToParent()), the whole group will be attached to the new parent, not only the calling object.

Parameters:
frame - the new parent frame of the objects root frame.

attachTo

public void attachTo(ObjectFrame frame,
                     ITransformation trans)
Changes the objects root frame parent to the given frame and sets the root frame transformation to the given transformation. This is only allowed, if the frame is not part of the objects subtree.

If the object is grouped to the former parent object ( groupToParent()), the whole group will be attached to the new parent, not only the calling object.

Parameters:
frame - the new parent frame of the objects root frame.
trans - the new transformation from the specified target frame to the root frame of the object.

switchParent

public void switchParent(SceneGraphObject obj)
Changes the objects root frame parent to the root frame of the given object. Calculates the new transformation between the objects root frame an the root frame of the given object. Sets the calculated transformation to the objects root frame.

This method can only be used if the calling object has a parent that is not null. For example, the parent will be null, if the calling object has been detached from its parent before calling this method. In that case, use the attachTo() method.

If the object is grouped to the former parent object ( groupToParent()), the whole group will be attached to the new parent, not only the calling object.

Parameters:
obj - the root frame of the given object will be the new parent of this object.

switchParent

public void switchParent(ObjectFrame frame)
Changes the objects root frame parent to the given frame. Calculates the new transformation between the objects root frame an the given frame. Sets the calculated transformation to the objects root frame.

This method can only be used if the calling object has a parent that is not null. For example, the parent will be null, if the calling object has been detached from its parent before calling this method. In that case, use the attachTo() method.

If the object is grouped to the former parent object ( groupToParent()), the whole group will be attached to the new parent, not only the calling object.

Parameters:
frame - the new parent of this object.

changeParent

protected void changeParent(ObjectFrame frame)
Sets the new parent frame for this object if the new parent frame is not part of the subtree. It is also not possible to change the worlds parent frame.

Specified by:
changeParent in class SceneGraphObject
Parameters:
frame - the new parent frame.
Throws:
IllegalArgumentException - if frame is null. if the new parent frame is part of the current subtree. if the worlds parent should be changed. the worlds parent cannot be changed.


Copyright © 2019. All rights reserved.