Drake
PoseVector< T > Class Template Reference

A 7-vector representing the transform of frame A in the world frame, X_WA, in the form {p_WA, R_WA}, where p is represented as an x-y-z translation, and R is represented as a quaternion. More...

#include <drake/systems/rendering/pose_vector.h>

Public Member Functions

 PoseVector ()
 Default constructor. More...
 
 ~PoseVector () override
 
 PoseVector (const Eigen::Quaternion< T > &rotation, const Eigen::Translation< T, 3 > &translation)
 Fully-parameterized constructor. More...
 
Isometry3< T > get_isometry () const
 Returns the transform X_WA. More...
 
Eigen::Translation< T, 3 > get_translation () const
 Returns the translation p_WA. More...
 
void set_translation (const Eigen::Translation< T, 3 > &q)
 Assigns the translation p_WA. More...
 
Eigen::Quaternion< T > get_rotation () const
 Returns the rotation R_WA. More...
 
void set_rotation (const Eigen::Quaternion< T > &q)
 Assigns the rotation R_WA. More...
 
- Public Member Functions inherited from BasicVector< T >
 BasicVector ()
 Constructs an empty BasicVector. More...
 
 BasicVector (int size)
 Initializes with the given size using the drake::dummy_value<T>, which is NaN when T = double. More...
 
 BasicVector (VectorX< T > vec)
 Constructs a BasicVector with the specified vec data. More...
 
 BasicVector (const std::initializer_list< T > &init)
 Constructs a BasicVector whose elements are the elements of init. More...
 
int size () const override
 Returns the number of elements in the vector. More...
 
void set_value (const Eigen::Ref< const VectorX< T >> &value)
 Sets the vector to the given value. More...
 
Eigen::VectorBlock< const VectorX< T > > get_value () const
 Returns the entire vector as a const Eigen::VectorBlock. More...
 
Eigen::VectorBlock< VectorX< T > > get_mutable_value ()
 Returns the entire vector as a mutable Eigen::VectorBlock, which allows mutation of the values, but does not allow resizing the vector itself. More...
 
const T & GetAtIndex (int index) const override
 Returns the element at the given index in the vector. More...
 
T & GetAtIndex (int index) override
 Returns the element at the given index in the vector. More...
 
void SetFromVector (const Eigen::Ref< const VectorX< T >> &value) override
 Replaces the entire vector with the contents of value. More...
 
VectorX< T > CopyToVector () const override
 Copies the entire state to a vector with no semantics. More...
 
void ScaleAndAddToVector (const T &scale, Eigen::Ref< VectorX< T >> vec) const override
 Adds a scaled version of this vector to Eigen vector vec, which must be the same size. More...
 
void SetZero () override
 
NormInf () const override
 Computes the infinity norm for this vector. More...
 
std::unique_ptr< BasicVector< T > > Clone () const
 Copies the entire vector to a new BasicVector, with the same concrete implementation type. More...
 
 BasicVector (const BasicVector &)=delete
 
BasicVectoroperator= (const BasicVector &)=delete
 
 BasicVector (BasicVector &&)=delete
 
BasicVectoroperator= (BasicVector &&)=delete
 
- Public Member Functions inherited from VectorBase< T >
virtual ~VectorBase ()
 
T & operator[] (std::size_t idx)
 
const T & operator[] (std::size_t idx) const
 
void SetAtIndex (int index, const T &value)
 Replaces the state at the given index with the value. More...
 
virtual void SetFrom (const VectorBase< T > &value)
 Replaces the entire vector with the contents of value. More...
 
VectorBasePlusEqScaled (const T &scale, const VectorBase< T > &rhs)
 Add in scaled vector rhs to this vector. More...
 
VectorBasePlusEqScaled (const std::initializer_list< std::pair< T, const VectorBase< T > &>> &rhs_scale)
 Add in multiple scaled vectors to this vector. More...
 
VectorBaseoperator+= (const VectorBase< T > &rhs)
 Add in vector rhs to this vector. More...
 
VectorBaseoperator-= (const VectorBase< T > &rhs)
 Subtract in vector rhs to this vector. More...
 
virtual void GetElementBounds (Eigen::VectorXd *lower, Eigen::VectorXd *upper) const
 Get the bounds for the elements. More...
 
 VectorBase (const VectorBase &)=delete
 
VectorBaseoperator= (const VectorBase &)=delete
 
 VectorBase (VectorBase &&)=delete
 
VectorBaseoperator= (VectorBase &&)=delete
 

Static Public Attributes

static constexpr int kSize = 7
 

Protected Member Functions

PoseVector< T > * DoClone () const override
 Returns a new BasicVector containing a copy of the entire vector. More...
 
- Protected Member Functions inherited from BasicVector< T >
const VectorX< T > & values () const
 Provides const access to the element storage. More...
 
VectorX< T > & values ()
 Provides mutable access to the element storage. More...
 
- Protected Member Functions inherited from VectorBase< T >
 VectorBase ()
 

Additional Inherited Members

- Static Public Member Functions inherited from BasicVector< T >
static std::unique_ptr< BasicVector< T > > Make (const std::initializer_list< T > &init)
 Constructs a BasicVector whose elements are the elements of init. More...
 
template<typename... Fargs>
static std::unique_ptr< BasicVector< T > > Make (Fargs &&... args)
 Constructs a BasicVector where each element is constructed using the placewise-corresponding member of args as the sole constructor argument. More...
 
- Static Protected Member Functions inherited from BasicVector< T >
template<typename F , typename... Fargs>
static void MakeRecursive (BasicVector< T > *data, int index, F constructor_arg, Fargs &&... recursive_args)
 Sets data at index to an object of type T, which must have a single-argument constructor invoked via constructor_arg, and then recursively invokes itself on the next index with recursive args. More...
 
template<typename F , typename... Fargs>
static void MakeRecursive (BasicVector< T > *data, int index, F constructor_arg)
 Base case for the MakeRecursive template recursion. More...
 

Detailed Description

template<typename T>
class drake::systems::rendering::PoseVector< T >

A 7-vector representing the transform of frame A in the world frame, X_WA, in the form {p_WA, R_WA}, where p is represented as an x-y-z translation, and R is represented as a quaternion.

The exact order of elements is {x, y, z, qw, qx, qy, qz}.

Template Parameters
TThe Eigen scalar type. Supported scalar types are double, AutoDiffXd, and symbolic::Expression.

Constructor & Destructor Documentation

◆ PoseVector() [1/2]

Default constructor.

◆ ~PoseVector()

~PoseVector ( )
override

◆ PoseVector() [2/2]

PoseVector ( const Eigen::Quaternion< T > &  rotation,
const Eigen::Translation< T, 3 > &  translation 
)

Fully-parameterized constructor.

Parameters
rotationthe orientation R_WA of frame A in the world frame W.
translationthe position vector p_WA giving A's origin measured from W's origin, expressed in W.

Member Function Documentation

◆ DoClone()

PoseVector< T > * DoClone ( ) const
overrideprotectedvirtual

Returns a new BasicVector containing a copy of the entire vector.

Caller must take ownership, and may rely on the NVI wrapper to initialize the clone elementwise.

Subclasses of BasicVector must override DoClone to return their covariant type.

Reimplemented from BasicVector< T >.

◆ get_isometry()

Isometry3< T > get_isometry ( ) const

Returns the transform X_WA.

◆ get_rotation()

Eigen::Quaternion< T > get_rotation ( ) const

Returns the rotation R_WA.

◆ get_translation()

Eigen::Translation< T, 3 > get_translation ( ) const

Returns the translation p_WA.

◆ set_rotation()

void set_rotation ( const Eigen::Quaternion< T > &  q)

Assigns the rotation R_WA.

◆ set_translation()

void set_translation ( const Eigen::Translation< T, 3 > &  q)

Assigns the translation p_WA.

Member Data Documentation

◆ kSize

constexpr int kSize = 7
static

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