Ocean
|
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 ×tamp) |
Sets or updates a new transformation. More... | |
void | setSmoothingInterval (const double smoothingInterval) |
Sets a new smoothing interval. More... | |
HomogenousMatrix4 | transformation (const Timestamp ×tamp) 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... | |
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.
|
explicit |
Creates a new transformation object.
smoothingInterval | The time interval in which the old transformation will be merged/inerpolated into the new transformation, in seconds, with range (0, infinity) |
|
inline |
Returns whether this object holds a valid transformation.
void Ocean::Tracking::SmoothedTransformation::reset | ( | ) |
Resets this transformation object and removes all previously set transformations.
The smoothing interval is untouched.
|
inline |
Sets a new smoothing interval.
smoothingInterval | The time interval in which the old transformation will be merged/inerpolated into the new transformation, in seconds, with range (0, infinity) |
void Ocean::Tracking::SmoothedTransformation::setTransformation | ( | const HomogenousMatrix4 & | transformation, |
const Timestamp & | timestamp | ||
) |
Sets or updates a new transformation.
transformation | The new (e.g., the latest) 12-DOF transformation to be set, must be valid |
timestamp | The timestamp of the given transformation, must be valid, with range [timestamp(), infinity) |
|
inline |
Returns the timestamp of the latest transformation.
transformation | Optional resulting transformation associated with the latest transformation, invalid if the resulting timestamp is invalid |
HomogenousMatrix4 Ocean::Tracking::SmoothedTransformation::transformation | ( | const Timestamp & | timestamp | ) | const |
Returns the smoothed 12-DOF transformation of this object.
timestamp | The timestamp for which the smoothed transformation is requested, with range (-infinity, infinity), must be valid |
|
mutableprivate |
The lock of this transformation object.
|
private |
The timestamp of the new transformation.
|
private |
The new 12-DOF transformation connected with the new timestamp.
|
private |
The timestamp of the old transformation.
|
private |
The old 12-DOF transformation connected with the old timestamp.
|
private |
The time interval in which the old transformation will be merged/inerpolated into the new transformation, in seconds, with range (0, infinity).