com.kuka.roboticsAPI.geometricModel.math
Class AbstractTransformation

java.lang.Object
  extended by com.kuka.roboticsAPI.geometricModel.math.AbstractTransformation
All Implemented Interfaces:
ITransformation
Direct Known Subclasses:
MatrixTransformation, Transformation, XyzAbcTransformation

public abstract class AbstractTransformation
extends Object
implements ITransformation

Represents a transformation in 3-dimensional space. A transformation consists of a spatial rotation and a translation.

The Robotics API always assumes the translation vector to be given in [mm].

By default all computations will be done on the MatrixTransformation representation of the rotation.

Note: When operating on AbstractTransformation there is no guarantee that the type is immutable, unless you have explicitly converted it to an immutable type before.


Constructor Summary
AbstractTransformation()
           
 
Method Summary
 Point applyTo(Point point)
          Applies this transformation to the given point.
 Vector applyTo(Vector vector)
          Applies this transformation to the given vector.
 ITransformation compose(ITransformation other)
          If the transformations A and B are represented as homogeneous matrices, then the effect of A.compose(B) is that of the matrix multiplication A*B.
 double distanceTo(ITransformation other)
          Calculates the euclidean distance of the origin of this transformation to the origin of the given transformation.
abstract  IRotation getRotation()
          Returns the rotation corresponding to this transformation.
abstract  Vector getTranslation()
          Returns the translation part of the transformation, i.e. the upper-right 3x1 part of the corresponding homogeneous transformation matrix.
 ITransformation invert()
          Returns an inverted transformation, i.e. a transformation that reverses the effect of this one.
 double rotationalDistanceTo(ITransformation other)
          Calculates the rotational distance from this transformation to the other transformation.
 String toString()
          Returns a textual description of the transformation.
 ITransformation transformationTo(ITransformation other)
          Calculates the transformation needed to move this transformation into the other transformation.
 ITransformation withRotation(IRotation rotation)
          Returns a new instance (copy) of the transformation, with the rotational part replaced by the given rotation.
 ITransformation withTranslation(Vector translation)
          Returns a new instance (copy) of the transformation, with the translational part replaced by the given translation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractTransformation

public AbstractTransformation()
Method Detail

applyTo

public Vector applyTo(Vector vector)
Description copied from interface: ITransformation
Applies this transformation to the given vector. This results in a (displacement) vector represented in the new coordinate system. From a numerical point of view only the rotational part of the transformation is applied to the three components of the vector, the translational part of the transformation will not be applied to the vector

See class info of ITransformation or Vector for more information

Specified by:
applyTo in interface ITransformation
Parameters:
vector - the vector to be transformed
Returns:
a new rotated vector

applyTo

public Point applyTo(Point point)
Description copied from interface: ITransformation
Applies this transformation to the given point. This results in a point represented in the new coordinate system, which means that the origin of the point is translated. From a numerical point of view the translational and the rotational part of the transformation are applied to the three components of the vector.

Specified by:
applyTo in interface ITransformation
Parameters:
point - the point to be transformed
Returns:
a new point

compose

public ITransformation compose(ITransformation other)
Description copied from interface: ITransformation
If the transformations A and B are represented as homogeneous matrices, then the effect of A.compose(B) is that of the matrix multiplication A*B.

Specified by:
compose in interface ITransformation
Parameters:
other - the transformation to combine with this one
Returns:
the combined transformation

invert

public ITransformation invert()
Description copied from interface: ITransformation
Returns an inverted transformation, i.e. a transformation that reverses the effect of this one.

Specified by:
invert in interface ITransformation
Returns:
the inverted transformation.

toString

public String toString()
Returns a textual description of the transformation. The representation is subject to change.

This implementation will return a description of origin in cartesian coordinates and rotation in Euler Z-Y-X angles with KUKA notation (A, B, C). The following string can be regarded as typical:

"[X=100.00 Y=-234.23 Z=-3.00 A=1.23 B=3.14 C=-0.13]"

Overrides:
toString in class Object
Returns:
a brief description of the transformation

getRotation

public abstract IRotation getRotation()
Description copied from interface: ITransformation
Returns the rotation corresponding to this transformation.

Specified by:
getRotation in interface ITransformation
Returns:
the rotation part of the transformation

getTranslation

public abstract Vector getTranslation()
Description copied from interface: ITransformation
Returns the translation part of the transformation, i.e. the upper-right 3x1 part of the corresponding homogeneous transformation matrix.

Specified by:
getTranslation in interface ITransformation
Returns:
the translation part of the transformation

withRotation

public ITransformation withRotation(IRotation rotation)
Returns a new instance (copy) of the transformation, with the rotational part replaced by the given rotation.

Parameters:
rotation - the rotational part of the transformation (the upper-left 3x3 part of a homogeneous transformation matrix).
Returns:
a new instance of the class

withTranslation

public ITransformation withTranslation(Vector translation)
Returns a new instance (copy) of the transformation, with the translational part replaced by the given translation.

Parameters:
translation - the translational part of the transformation (the upper-right 3x1 part of a homogeneous transformation matrix).
Returns:
a new instance of the class

transformationTo

public ITransformation transformationTo(ITransformation other)
Description copied from interface: ITransformation
Calculates the transformation needed to move this transformation into the other transformation. The following holds true:

trafo1.compose(trafo1.rotationTo(trafo2)) is equal to trafo2

Specified by:
transformationTo in interface ITransformation
Parameters:
other - another transformation
Returns:
the difference transformation between this and the other transformation.

distanceTo

public double distanceTo(ITransformation other)
Description copied from interface: ITransformation
Calculates the euclidean distance of the origin of this transformation to the origin of the given transformation.

Specified by:
distanceTo in interface ITransformation
Parameters:
other - another transformation
Returns:
the distance of the origins in [mm]

rotationalDistanceTo

public double rotationalDistanceTo(ITransformation other)
Description copied from interface: ITransformation
Calculates the rotational distance from this transformation to the other transformation. The rotational distance is the angle of rotation needed to turn this transformation into the orientation of the other transformation.

Use this function to compare the orientations of two transformations.

Specified by:
rotationalDistanceTo in interface ITransformation
Parameters:
other - another transformation
Returns:
the positive rotational distance to the other transformation in [rad], in the range 0 to pi.


Copyright © 2019. All rights reserved.