Drake
Drake C++ Documentation
Transform Class Reference

Detailed Description

A specification for a 3d rotation and translation, optionally with respect to a base frame.

For an overview of configuring stochastic transforms, see Configuring transforms and Configuring distributions.

See Implementing Serialize for implementation details, especially the unusually public member fields.

#include <drake/common/schema/transform.h>

Public Member Functions

 Transform ()=default
 Constructs the Identity transform. More...
 
 Transform (const math::RigidTransformd &)
 Constructs the given transform. More...
 
void set_rotation_rpy_deg (const Eigen::Vector3d &rpy_deg)
 Sets the rotation field to the given deterministic RPY, in degrees. More...
 
bool IsDeterministic () const
 Returns true iff this is fully deterministic. More...
 
math::RigidTransformd GetDeterministicValue () const
 If this is deterministic, retrieves its value. More...
 
math::RigidTransform< symbolic::ExpressionToSymbolic () const
 Returns the symbolic form of this rotation. More...
 
math::RigidTransformd Mean () const
 Returns the mean of this rotation. More...
 
math::RigidTransformd Sample (RandomGenerator *generator) const
 Samples this Transform. More...
 
Transform SampleAsTransform (RandomGenerator *generator) const
 Samples this Transform; the returned value is deterministic and has the same base frame. More...
 
template<typename Archive >
void Serialize (Archive *a)
 
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable
 Transform (const Transform &)=default
 
Transformoperator= (const Transform &)=default
 
 Transform (Transform &&)=default
 
Transformoperator= (Transform &&)=default
 

Public Attributes

std::optional< std::string > base_frame
 An optional base frame name for this transform. More...
 
DistributionVectorVariant< 3 > translation {Eigen::Vector3d::Zero()}
 A translation vector, in meters. More...
 
Rotation rotation
 A variant that allows for several ways to specify a rotation. More...
 

Constructor & Destructor Documentation

◆ Transform() [1/4]

Transform ( const Transform )
default

◆ Transform() [2/4]

Transform ( Transform &&  )
default

◆ Transform() [3/4]

Transform ( )
default

Constructs the Identity transform.

◆ Transform() [4/4]

Transform ( const math::RigidTransformd &  )
explicit

Constructs the given transform.

Member Function Documentation

◆ GetDeterministicValue()

math::RigidTransformd GetDeterministicValue ( ) const

If this is deterministic, retrieves its value.

Exceptions
std::exceptionif this is not fully deterministic.

◆ IsDeterministic()

bool IsDeterministic ( ) const

Returns true iff this is fully deterministic.

◆ Mean()

math::RigidTransformd Mean ( ) const

Returns the mean of this rotation.

If this is deterministic, the result is the same as GetDeterministicValue. If this is random, note that the mean here is simply defined as setting all of the random variables individually to their mean. Various other measures of the resulting RigidTransform (e.g., the distribution of one of the Euler angles) may not necessarily match that measure on the returned value.

◆ operator=() [1/2]

Transform& operator= ( Transform &&  )
default

◆ operator=() [2/2]

Transform& operator= ( const Transform )
default

◆ Sample()

math::RigidTransformd Sample ( RandomGenerator generator) const

Samples this Transform.

If this is deterministic, the result is the same as GetDeterministicValue.

Warning
Calling this function when this object has a non-null, non-world base_frame is deprecated and will become an error on 2024-05-01. (The returned value would be misleading because it doesn't incorporate the base frame.)

◆ SampleAsTransform()

Transform SampleAsTransform ( RandomGenerator generator) const

Samples this Transform; the returned value is deterministic and has the same base frame.

◆ Serialize()

void Serialize ( Archive *  a)

◆ set_rotation_rpy_deg()

void set_rotation_rpy_deg ( const Eigen::Vector3d &  rpy_deg)

Sets the rotation field to the given deterministic RPY, in degrees.

◆ ToSymbolic()

Returns the symbolic form of this rotation.

If this is deterministic, the result will contain no variables. If this is random, the result will contain one or more random variables, based on the distributions in use.

Member Data Documentation

◆ base_frame

std::optional<std::string> base_frame

An optional base frame name for this transform.

When left unspecified, the default depends on the semantics of the enclosing struct.

◆ rotation

Rotation rotation

A variant that allows for several ways to specify a rotation.

◆ translation

DistributionVectorVariant<3> translation {Eigen::Vector3d::Zero()}

A translation vector, in meters.


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