Class Transform

Class Documentation

class Transform

An abstraction of the tf2::Transform class to support transforms in addition to the rigid transforms supported by tf.

Additional transforms are implemented through transformer plug-ins.

It can be used in conjunction with the tf2::Vector3 data type.

Public Functions

Transform()

Generates an identity transform.

explicit Transform(const tf2::Transform &transform)

Generates a standard rigid transform from a tf2::Transform.

Parameters:

transform[in] The input transform.

explicit Transform(const tf2::Stamped<tf2::Transform> &transform)

Generates a standard rigid transform from a tf2::Transform.

Parameters:

transform[in] The input transform.

explicit Transform(std::shared_ptr<TransformImpl> transform)

Defines the transform using an arbitrary transform implementation.

Parameters:

transform[in] The input transform implementation.

Transform &operator=(const tf2::Transform transform)

Assignment operator for tf2::Transform.

Generates a standard rigid transform from a tf2::Transform.

Parameters:

transform[in] The input transform.

Transform &operator=(std::shared_ptr<TransformImpl> transform)

Assignment operator for TransformImpl.

Note: The transform implementation is only a shallow copy.

Parameters:

transform[in] The input transform.

tf2::Vector3 operator()(const tf2::Vector3 &v) const

Apply the transform to a vector and return the result.

Parameters:

v[in] The vector.

Returns:

The transformed vector.

tf2::Vector3 operator*(const tf2::Vector3 &v) const

Apply the transform to a vector and return the result.

Parameters:

v[in] The vector.

Returns:

The transformed vector.

tf2::Quaternion operator*(const tf2::Quaternion &q) const

Apply the transform to a quaternion and return the result.

Parameters:

q[in] The quaternion.

Returns:

The transformed quaternion.

tf2::Transform GetTF() const

Return a TF transform equivalent to this transform

Returns:

The equivalent tf2::Transform

Transform Inverse() const

Return the inverse transform.

Returns:

The inverse transform.

tf2::Vector3 GetOrigin() const

Get the origin (translation component) of the transform

The result of this should always be equal to applying the transform to the vector (0, 0, 0).

Returns:

The origin (translation component) of the transform

tf2::Quaternion GetOrientation() const

Get the orientation (rotation component) of the transform

Returns:

The orientation (translation component) of the transform

inline tf2::TimePoint GetStamp()

Get the time stamp of the transform

Returns:

The time stamp of the transform