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::Expression > | ToSymbolic () 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 | |
Transform & | operator= (const Transform &)=default |
Transform (Transform &&)=default | |
Transform & | operator= (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... | |
|
default |
Constructs the Identity transform.
|
explicit |
Constructs the given transform.
math::RigidTransformd GetDeterministicValue | ( | ) | const |
If this is deterministic, retrieves its value.
std::exception | if this is not fully deterministic. |
bool IsDeterministic | ( | ) | const |
Returns true iff this is fully deterministic.
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.
math::RigidTransformd Sample | ( | RandomGenerator * | generator | ) | const |
Samples this Transform.
If this is deterministic, the result is the same as GetDeterministicValue.
Transform SampleAsTransform | ( | RandomGenerator * | generator | ) | const |
Samples this Transform; the returned value is deterministic and has the same base frame.
void Serialize | ( | Archive * | a | ) |
void set_rotation_rpy_deg | ( | const Eigen::Vector3d & | rpy_deg | ) |
Sets the rotation field to the given deterministic RPY, in degrees.
math::RigidTransform<symbolic::Expression> ToSymbolic | ( | ) | const |
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.
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 |
A variant that allows for several ways to specify a rotation.
DistributionVectorVariant<3> translation {Eigen::Vector3d::Zero()} |
A translation vector, in meters.