com.kuka.math.geometry
Class XyzAbcTransformation

java.lang.Object
  extended by com.kuka.math.geometry.AbstractTransformation
      extended by com.kuka.math.geometry.XyzAbcTransformation
All Implemented Interfaces:
ITransformation

public final class XyzAbcTransformation
extends AbstractTransformation

Immutable representation of a spatial transformation as a combination of x, y, z translational elements and α, β, γ (resp. A, B, C) rotational elements.

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


Field Summary
static XyzAbcTransformation IDENTITY
          Immutable XyzAbcTransformation instance representing identity (i.e. unchanging) transformation.
 
Method Summary
 boolean equals(Object obj)
           
 double getAlphaRad()
          Returns the α (alpha) angle of the rotation part of the transformation in radians.
 double getBetaRad()
          Returns the β (beta) angle of the rotation part of the transformation in radians.
 double getGammaRad()
          Returns the γ (gamma) angle of the rotation part of the transformation in radians.
 EulerZyxRotation getRotation()
          Returns the rotation corresponding to this transformation.
 Vector3D getTranslation()
          Returns the translation part of the transformation, i.e. the upper-right 3x1 part of the corresponding homogeneous transformation matrix.
 double getX()
          Returns the x element of the translation part of the transformation.
 double getY()
          Returns the y element of the translation part of the transformation.
 double getZ()
          Returns the z element of the translation part of the transformation.
 int hashCode()
           
static XyzAbcTransformation of(double x, double y, double z)
          Returns an immutable XyzAbcTransformation instance, consisting of a translational part and no rotation.
static XyzAbcTransformation of(ITransformation orig)
          Returns an immutable XyzAbcTransformation instance with the same value as the given transformation.
static XyzAbcTransformation of(Vector3D translation)
          Returns an immutable XyzAbcTransformation instance, consisting of a translational part and no rotation.
static XyzAbcTransformation of(Vector3D translation, IRotation rotation)
          Returns an immutable XyzAbcTransformation instance, consisting of a rotational and a translational part.
static XyzAbcTransformation ofDeg(double x, double y, double z, double alpha, double beta, double gamma)
          Returns an immutable XyzAbcTransformation instance, consisting of a translational and a rotational part.
static XyzAbcTransformation ofRad(double x, double y, double z, double alpha, double beta, double gamma)
          Returns an immutable XyzAbcTransformation instance, consisting of a translational and a rotational part.
 String toString()
          Returns a textual description of the transformation.
 String toString(NumberFormat fmt)
          Returns a textual description of the transformation.
 XyzAbcTransformation withAlphaRad(double value)
          Returns a new instance (copy) of the transformation, with the α (alpha) angle replaced by the new value.
 XyzAbcTransformation withBetaRad(double value)
          Returns a new instance (copy) of the transformation, with the β (beta) angle replaced by the new value.
 XyzAbcTransformation withGammaRad(double value)
          Returns a new instance (copy) of the transformation, with the γ (gamma) angle replaced by the new value.
 XyzAbcTransformation withRotation(EulerZyxRotation rotation)
          Returns a new instance (copy) of the transformation, with the rotational part replaced by the given rotation.
 XyzAbcTransformation withTranslation(Vector3D translation)
          Returns a new instance (copy) of the transformation, with the translational part replaced by the given translation.
 XyzAbcTransformation withX(double value)
          Returns a new instance (copy) of this transformation where the x element of the translation part of the is replaced by the given value.
 XyzAbcTransformation withY(double value)
          Returns a new instance (copy) of this transformation where the y element of the translation part of the is replaced by the given value.
 XyzAbcTransformation withZ(double value)
          Returns a new instance (copy) of this transformation where the z element of the translation part of the is replaced by the given value.
 
Methods inherited from class com.kuka.math.geometry.AbstractTransformation
applyTo, applyTo, compose, distanceTo, invert, rotationalDistanceTo, transformationTo, withRotation
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

IDENTITY

public static final XyzAbcTransformation IDENTITY
Immutable XyzAbcTransformation instance representing identity (i.e. unchanging) transformation.

Method Detail

ofDeg

public static XyzAbcTransformation ofDeg(double x,
                                         double y,
                                         double z,
                                         double alpha,
                                         double beta,
                                         double gamma)
Returns an immutable XyzAbcTransformation instance, consisting of a translational and a rotational part. The translation is given by the three cartesian vector elements x, y, z. The rotation is given by the three Euler Z-Y-X angles α, β, γ in degree.

Parameters:
x - x element of translation
y - y element of translation
z - z element of translation
alpha - the α (alpha) angle of the rotation in degrees. Note: This is the same as the angle A in KUKA notation.
beta - the β (beta) angle of the rotation in degrees. Note: This is the same as the angle B in KUKA notation.
gamma - the γ (gamma) angle of the rotation in degrees. Note: This is the same as the angle C in KUKA notation.
Returns:
an immutable XyzAbcTransformation instance

ofRad

public static XyzAbcTransformation ofRad(double x,
                                         double y,
                                         double z,
                                         double alpha,
                                         double beta,
                                         double gamma)
Returns an immutable XyzAbcTransformation instance, consisting of a translational and a rotational part. The translation is given by the three cartesian vector elements x, y, z. The rotation is given by the three Euler Z-Y-X angles α, β, γ in radians.

Parameters:
x - x element of translation
y - y element of translation
z - z element of translation
alpha - the α (alpha) angle of the rotation in radians. Note: This is the same as the angle A in KUKA notation.
beta - the β (beta) angle of the rotation in radians. Note: This is the same as the angle B in KUKA notation.
gamma - the γ (gamma) angle of the rotation in radians. Note: This is the same as the angle C in KUKA notation.
Returns:
an immutable XyzAbcTransformation instance

of

public static XyzAbcTransformation of(double x,
                                      double y,
                                      double z)
Returns an immutable XyzAbcTransformation instance, consisting of a translational part and no rotation. The translation is given by the three cartesian vector elements x, y, z.

Parameters:
x - x element of translation
y - y element of translation
z - z element of translation
Returns:
an immutable XyzAbcTransformation instance

of

public static XyzAbcTransformation of(Vector3D translation,
                                      IRotation rotation)
Returns an immutable XyzAbcTransformation instance, consisting of a rotational and a translational part.

Parameters:
translation - the translational part of the transformation.
rotation - the rotational part of the transformation.
Returns:
an immutable XyzAbcTransformation instance
Throws:
IllegalArgumentException - if rotation or translation is null

of

public static XyzAbcTransformation of(Vector3D translation)
Returns an immutable XyzAbcTransformation instance, consisting of a translational part and no rotation.

Parameters:
translation - the translational part of the transformation.
Returns:
an immutable XyzAbcTransformation instance
Throws:
IllegalArgumentException - if translation is null

of

public static XyzAbcTransformation of(ITransformation orig)
Returns an immutable XyzAbcTransformation instance with the same value as the given transformation. If the given transformation is already of a known immutable type then it is returned unchanged.

Parameters:
orig - an object describing the transformation
Returns:
an immutable XyzAbcTransformation instance
Throws:
IllegalArgumentException - if orig is null

getX

public double getX()
Returns the x element of the translation part of the transformation.

Returns:
the x element of the translation part of the transformation

getY

public double getY()
Returns the y element of the translation part of the transformation.

Returns:
the y element of the translation part of the transformation

getZ

public double getZ()
Returns the z element of the translation part of the transformation.

Returns:
the z element of the translation part of the transformation

getAlphaRad

public double getAlphaRad()
Returns the α (alpha) angle of the rotation part of the transformation in radians.

Note: This is the same as the angle A in KUKA notation.

Returns:
the α (alpha) angle of the rotation part of the transformation in radians

getBetaRad

public double getBetaRad()
Returns the β (beta) angle of the rotation part of the transformation in radians.

Note: This is the same as the angle B in KUKA notation.

Returns:
the β (beta) angle of the rotation part of the transformation in radians

getGammaRad

public double getGammaRad()
Returns the γ (gamma) angle of the rotation part of the transformation in radians.

Note: This is the same as the angle C in KUKA notation.

Returns:
the γ (gamma) angle of the rotation part of the transformation in radians

getRotation

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

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

getTranslation

public Vector3D 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
Specified by:
getTranslation in class AbstractTransformation
Returns:
the translation part of the transformation

withX

public XyzAbcTransformation withX(double value)
Returns a new instance (copy) of this transformation where the x element of the translation part of the is replaced by the given value.

Parameters:
value - the x element of the translation part of the transformation
Returns:
a new instance of the class

withY

public XyzAbcTransformation withY(double value)
Returns a new instance (copy) of this transformation where the y element of the translation part of the is replaced by the given value.

Parameters:
value - the y element of the translation part of the transformation
Returns:
a new instance of the class

withZ

public XyzAbcTransformation withZ(double value)
Returns a new instance (copy) of this transformation where the z element of the translation part of the is replaced by the given value.

Parameters:
value - the z element of the translation part of the transformation
Returns:
a new instance of the class

withAlphaRad

public XyzAbcTransformation withAlphaRad(double value)
Returns a new instance (copy) of the transformation, with the α (alpha) angle replaced by the new value.

Parameters:
value - the α (alpha) angle of the transformation in radians. Note: This is the same as the angle A in KUKA notation.
Returns:
a new instance of the class

withBetaRad

public XyzAbcTransformation withBetaRad(double value)
Returns a new instance (copy) of the transformation, with the β (beta) angle replaced by the new value.

Parameters:
value - the β (beta) angle of the transformation in radians. Note: This is the same as the angle B in KUKA notation.
Returns:
a new instance of the class

withGammaRad

public XyzAbcTransformation withGammaRad(double value)
Returns a new instance (copy) of the transformation, with the γ (gamma) angle replaced by the new value.

Parameters:
value - the γ (gamma) angle of the transformation in radians. Note: This is the same as the angle C in KUKA notation.
Returns:
a new instance of the class

withRotation

public XyzAbcTransformation withRotation(EulerZyxRotation 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 in Euler-Z-Y-X representation.
Returns:
an immutable XyzAbcTransformation instance

withTranslation

public XyzAbcTransformation withTranslation(Vector3D translation)
Description copied from class: AbstractTransformation
Returns a new instance (copy) of the transformation, with the translational part replaced by the given translation.

Overrides:
withTranslation in class AbstractTransformation
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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

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

This implementation will print all angle values in rad. The numerical values will be printed with the default format as returned by MathUtils.getDefaultNumberFormat(). The following string can be regarded as typical:

[X=10.0 Y=-20.5 Z=3.0 A=0.0 B=1.5708 C=0.0]

Overrides:
toString in class AbstractTransformation
Returns:
a textual description of the transformation with angle values in rad

toString

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

This implementation will print all angle values in rad. The numerical values will be printed using the NumberFormat.format(double) method of the given formatter.

Example: The following code snippet, used on a given XyzAbcTransformation trafo

 NumberFormat fmt = NumberFormat.getNumberInstance(Locale.US);
 fmt.setMinimumFractionDigits(1);
 fmt.setMaximumFractionDigits(3);
 System.out.println(trafo.toString(fmt));
might give the following output:
 [X=100.0 Y=-1.235 Z=3.0 A=-1.047 B=1.571 C=0.785]

Parameters:
fmt - the NumberFormat used to format the number values
Returns:
a textual description of the transformation with angle values in rad


Copyright © 2019. All rights reserved.