Ocean
Ocean::Tracking::SmoothedTransformation Class Reference

This class implements a smoother for a 12-DOF transformations (3D translation, 3D rotation, 3D scale, and 3D shear). More...

Public Member Functions

 SmoothedTransformation (const double smoothingInterval=1.0)
 Creates a new transformation object. More...
 
void setTransformation (const HomogenousMatrix4 &transformation, const Timestamp &timestamp)
 Sets or updates a new transformation. More...
 
void setSmoothingInterval (const double smoothingInterval)
 Sets a new smoothing interval. More...
 
HomogenousMatrix4 transformation (const Timestamp &timestamp) const
 Returns the smoothed 12-DOF transformation of this object. More...
 
Timestamp timestamp (HomogenousMatrix4 *transformation=nullptr) const
 Returns the timestamp of the latest transformation. More...
 
void reset ()
 Resets this transformation object and removes all previously set transformations. More...
 
bool isValid () const
 Returns whether this object holds a valid transformation. More...
 

Private Attributes

double smoothingInterval_
 The time interval in which the old transformation will be merged/inerpolated into the new transformation, in seconds, with range (0, infinity). More...
 
HomogenousMatrix4 oldTransformation_
 The old 12-DOF transformation connected with the old timestamp. More...
 
HomogenousMatrix4 newTransformation_
 The new 12-DOF transformation connected with the new timestamp. More...
 
Timestamp oldTimestamp_
 The timestamp of the old transformation. More...
 
Timestamp newTimestamp_
 The timestamp of the new transformation. More...
 
Lock lock_
 The lock of this transformation object. More...
 

Detailed Description

This class implements a smoother for a 12-DOF transformations (3D translation, 3D rotation, 3D scale, and 3D shear).

The transformation can be updated as often as necessary, while an internal smoothing interval is used to create a smooth transition between the current transformation and the given transformation.

                                                                                 new transformation
          old transformation                 new transformation                 + smoothing interval
                 |                                   |                                  |
                 V                                   V                                  V
timeline: ------------------------------------------------------------------------------------------------------------
                the old transformation               |  the interpolated transformation |  the new transformation
                    will be reported                 |         will be reported         |     will be reported

The class is thread-safe.

Constructor & Destructor Documentation

◆ SmoothedTransformation()

Ocean::Tracking::SmoothedTransformation::SmoothedTransformation ( const double  smoothingInterval = 1.0)
explicit

Creates a new transformation object.

Parameters
smoothingIntervalThe time interval in which the old transformation will be merged/inerpolated into the new transformation, in seconds, with range (0, infinity)

Member Function Documentation

◆ isValid()

bool Ocean::Tracking::SmoothedTransformation::isValid ( ) const
inline

Returns whether this object holds a valid transformation.

Returns
True, if so

◆ reset()

void Ocean::Tracking::SmoothedTransformation::reset ( )

Resets this transformation object and removes all previously set transformations.

The smoothing interval is untouched.

◆ setSmoothingInterval()

void Ocean::Tracking::SmoothedTransformation::setSmoothingInterval ( const double  smoothingInterval)
inline

Sets a new smoothing interval.

Parameters
smoothingIntervalThe time interval in which the old transformation will be merged/inerpolated into the new transformation, in seconds, with range (0, infinity)

◆ setTransformation()

void Ocean::Tracking::SmoothedTransformation::setTransformation ( const HomogenousMatrix4 transformation,
const Timestamp timestamp 
)

Sets or updates a new transformation.

Parameters
transformationThe new (e.g., the latest) 12-DOF transformation to be set, must be valid
timestampThe timestamp of the given transformation, must be valid, with range [timestamp(), infinity)

◆ timestamp()

Timestamp Ocean::Tracking::SmoothedTransformation::timestamp ( HomogenousMatrix4 transformation = nullptr) const
inline

Returns the timestamp of the latest transformation.

Parameters
transformationOptional resulting transformation associated with the latest transformation, invalid if the resulting timestamp is invalid
Returns
The latest timestamp, may be invalid

◆ transformation()

HomogenousMatrix4 Ocean::Tracking::SmoothedTransformation::transformation ( const Timestamp timestamp) const

Returns the smoothed 12-DOF transformation of this object.

Parameters
timestampThe timestamp for which the smoothed transformation is requested, with range (-infinity, infinity), must be valid
Returns
The smoothed 12-DOF transformation, invalid if no transformation was set

Field Documentation

◆ lock_

Lock Ocean::Tracking::SmoothedTransformation::lock_
mutableprivate

The lock of this transformation object.

◆ newTimestamp_

Timestamp Ocean::Tracking::SmoothedTransformation::newTimestamp_
private

The timestamp of the new transformation.

◆ newTransformation_

HomogenousMatrix4 Ocean::Tracking::SmoothedTransformation::newTransformation_
private

The new 12-DOF transformation connected with the new timestamp.

◆ oldTimestamp_

Timestamp Ocean::Tracking::SmoothedTransformation::oldTimestamp_
private

The timestamp of the old transformation.

◆ oldTransformation_

HomogenousMatrix4 Ocean::Tracking::SmoothedTransformation::oldTransformation_
private

The old 12-DOF transformation connected with the old timestamp.

◆ smoothingInterval_

double Ocean::Tracking::SmoothedTransformation::smoothingInterval_
private

The time interval in which the old transformation will be merged/inerpolated into the new transformation, in seconds, with range (0, infinity).


The documentation for this class was generated from the following file: