Class TransformationClient

Class Documentation

class TransformationClient

Abstract FRI transformation client.

A transformation client enables the user to send transformation matrices cyclically to the KUKA

Sunrise controller for manipulating the transformations of dynamic frames in the Sunrise scenegraph. Usually, these matrices will be provided by external sensors.

Custom transformation clients have to be derived from this class and need to implement the

provide() callback. This callback is called once by the client application whenever a new FRI message arrives.

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.

Public Functions

TransformationClient()

Constructor.

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.

virtual ~TransformationClient()

Virtual destructor.

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.

virtual void provide() = 0

Callback which is called whenever a new FRI message arrives.

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.

In this callback all requested transformations have to be set.

double getSampleTime() const

Get the sample time in seconds.

This is the period in which the KUKA Sunrise controller is sending FRI packets.

Returns:

sample time in seconds

EConnectionQuality getConnectionQuality() const

Get the current FRI connection quality.

Returns:

current FRI connection quality

const std::vector<const char*> &getRequestedTransformationIDs() const

Returns a vector of identifiers of all requested transformation matrices.

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.

The custom TransformationClient has to provide data for transformation matrices with these identifiers.

Returns:

reference to vector of IDs of requested transformations

const unsigned int getTimestampSec() const

Get the timestamp of the current received FRI monitor message in Unix time.

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.

This method returns the seconds since 0:00, January 1st, 1970 (UTC). Use getTimestampNanoSec() to increase your timestamp resolution when seconds are insufficient.

Returns:

timestamp encoded as Unix time (seconds)

const unsigned int getTimestampNanoSec() const

Get the nanoseconds elapsed since the last second (in Unix time).

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.

This method complements getTimestampSec() to get a high resolution timestamp.

Returns:

timestamp encoded as Unix time (nanoseconds part)

void setTransformation(const char *transformationID, const double transformationMatrix[3][4], unsigned int timeSec, unsigned int timeNanoSec)

Provides a requested transformation matrix.

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.

A transformation matrix has 3x4 elements. It consists of a rotational matrix (3x3 elements) and a translational vector (3x1 elements). The complete transformation matrix has the following structure:

[Transformation(3x4)] = [Rotation(3x3) | Translation(3x1) ]

All provided transformation matrices need a timestamp that corresponds to their time of acquisition. This timestamp must be synchronized to the timestamp provided by the KUKA Sunrise controller (see getTimestampSec(), getTimestampNanoSec()).

If an update to the last transformation is not yet available when the provide() callback is executed, the last transformation (including its timestamp) should be repeated until a new transformation is available.

Throws:

FRIException – Throws a FRIException if the maximum number of transformations is exceeded.

Parameters:
  • transformationID – Identifier string of the transformation matrix

  • transformationMatrix – Provided transformation matrix

  • timeSec – Timestamp encoded as Unix time (seconds)

  • timeNanoSec – Timestamp encoded as Unix time (nanoseconds part)

void setBooleanIOValue(const char *name, const bool value)

Set boolean output value.

Throws:
Parameters:
  • name – Full name of the IO (Syntax “IOGroupName.IOName”).

  • value – Boolean value to set.

void setDigitalIOValue(const char *name, const unsigned long long value)

Set digital output value.

Throws:
Parameters:
  • name – Full name of the IO (Syntax “IOGroupName.IOName”).

  • value – Digital value to set.

void setAnalogIOValue(const char *name, const double value)

Set analog output value.

Throws:
Parameters:
  • name – Full name of the IO (Syntax “IOGroupName.IOName”).

  • value – Analog value to set.

bool getBooleanIOValue(const char *name) const

Get boolean IO value.

Throws:

FRIException – May throw an FRIException if the IO is of wrong type or unknown.

Parameters:

name – Full name of the IO (Syntax “IOGroupName.IOName”).

Returns:

Returns IO’s boolean value.

unsigned long long getDigitalIOValue(const char *name) const

Get digital IO value.

Throws:

FRIException – May throw an FRIException if the IO is of wrong type or unknown.

Parameters:

name – Full name of the IO (Syntax “IOGroupName.IOName”).

Returns:

Returns IO’s digital value.

double getAnalogIOValue(const char *name) const

Get analog IO value.

Throws:

FRIException – May throw an FRIException if the IO is of wrong type or unknown.

Parameters:

name – Full name of the IO (Syntax “IOGroupName.IOName”).

Returns:

Returns IO’s analog value.