Drake
Drake C++ Documentation
Rotation Class Reference

Detailed Description

A specification for an SO(3) rotation, to be used for serialization purposes, e.g., to define stochastic scenarios.

This structure specifies either one specific rotation or else a distribution of possible rotations. It does not provide mathematical operators to compose or mutate rotations. Instead, users should call either GetDeterministicValue() or ToSymbolic() to obtain a RotationMatrix value that can be operated on.

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/rotation.h>

Classes

struct  AngleAxis
 Rotation constructed from a fixed axis and an angle. More...
 
struct  Identity
 No-op rotation. More...
 
struct  Rpy
 A roll-pitch-yaw rotation, using the angle conventions of Drake's RollPitchYaw. More...
 
struct  Uniform
 Rotation sampled from a uniform distribution over SO(3). More...
 

Public Types

using Variant = std::variant< Identity, Rpy, AngleAxis, Uniform >
 

Public Member Functions

 Rotation ()=default
 Constructs the Identity rotation. More...
 
 Rotation (const math::RotationMatrix< double > &)
 Constructs an Rpy rotation with the given value. More...
 
 Rotation (const math::RollPitchYaw< double > &)
 Constructs an Rpy rotation with the given value. More...
 
bool IsDeterministic () const
 Returns true iff this is fully deterministic. More...
 
math::RotationMatrixd GetDeterministicValue () const
 If this is deterministic, retrieves its value. More...
 
math::RotationMatrix< symbolic::ExpressionToSymbolic () const
 Returns the symbolic form of this rotation. More...
 
math::RotationMatrixd Sample (RandomGenerator *generator) const
 Samples this Rotation. More...
 
void set_rpy_deg (const Eigen::Vector3d &rpy_deg)
 Sets this value to the given deterministic RPY, in degrees. More...
 
template<typename Archive >
void Serialize (Archive *a)
 
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable
 Rotation (const Rotation &)=default
 
Rotationoperator= (const Rotation &)=default
 
 Rotation (Rotation &&)=default
 
Rotationoperator= (Rotation &&)=default
 

Public Attributes

Variant value
 

Member Typedef Documentation

◆ Variant

using Variant = std::variant<Identity, Rpy, AngleAxis, Uniform>

Constructor & Destructor Documentation

◆ Rotation() [1/5]

Rotation ( const Rotation )
default

◆ Rotation() [2/5]

Rotation ( Rotation &&  )
default

◆ Rotation() [3/5]

Rotation ( )
default

Constructs the Identity rotation.

◆ Rotation() [4/5]

Rotation ( const math::RotationMatrix< double > &  )
explicit

Constructs an Rpy rotation with the given value.

◆ Rotation() [5/5]

Rotation ( const math::RollPitchYaw< double > &  )
explicit

Constructs an Rpy rotation with the given value.

Member Function Documentation

◆ GetDeterministicValue()

math::RotationMatrixd 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.

◆ operator=() [1/2]

Rotation& operator= ( Rotation &&  )
default

◆ operator=() [2/2]

Rotation& operator= ( const Rotation )
default

◆ Sample()

math::RotationMatrixd Sample ( RandomGenerator generator) const

Samples this Rotation.

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

◆ Serialize()

void Serialize ( Archive *  a)

◆ set_rpy_deg()

void set_rpy_deg ( const Eigen::Vector3d &  rpy_deg)

Sets this value 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

◆ value

Variant value

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