Drake

This class is used to represent physical quantities that correspond to spatial vectors such as spatial velocities, spatial accelerations and spatial forces. More...
#include <drake/multibody/multibody_tree/math/spatial_vector.h>
Public Types  
enum  { kSpatialVectorSize = 6, kRotationSize = 3, kTranslationSize = 3 } 
Sizes for spatial quantities and its components in three dimensions. More...  
using  SpatialQuantity = SV< T > 
The more specialized spatial vector class templated on the scalar type T. More...  
typedef Vector6< T >  CoeffsEigenType 
The type of the underlying inmemory representation using an Eigen vector. More...  
typedef T  ScalarType 
Public Member Functions  
SpatialVector ()  
Default constructor. More...  
SpatialVector (const Eigen::Ref< const Vector3< T >> &w, const Eigen::Ref< const Vector3< T >> &v)  
SpatialVector constructor from an rotational component w and a linear component v . More...  
template<typename OtherDerived >  
SpatialVector (const Eigen::MatrixBase< OtherDerived > &V)  
SpatialVector constructor from an Eigen expression that represents a sixdimensional vector. More...  
int  size () const 
The total size of the concatenation of the angular and linear components. More...  
const T &  operator[] (int i) const 
Const access to the ith component of this spatial vector. More...  
T &  operator[] (int i) 
Mutable access to the ith component of this spatial vector. More...  
const Vector3< T > &  rotational () const 
Const access to the rotational component of this spatial vector. More...  
Vector3< T > &  rotational () 
Mutable access to the rotational component of this spatial vector. More...  
const Vector3< T > &  translational () const 
Const access to the translational component of this spatial vector. More...  
Vector3< T > &  translational () 
Mutable access to the translational component of this spatial vector. More...  
const T *  data () const 
Returns a (const) bare pointer to the underlying data. More...  
T *  mutable_data () 
Returns a (mutable) bare pointer to the underlying data. More...  
bool  IsApprox (const SpatialQuantity &other, double tolerance=Eigen::NumTraits< T >::epsilon()) const 
Compares this spatial vector to the provided spatial vector other within a specified precision. More...  
void  SetNaN () 
Sets all entries in this SpatialVector to NaN. More...  
SpatialQuantity &  SetZero () 
Sets both rotational and translational components of this SpatialVector to zero. More...  
CoeffsEigenType &  get_coeffs () 
Returns a reference to the underlying storage. More...  
const CoeffsEigenType &  get_coeffs () const 
Returns a constant reference to the underlying storage. More...  
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable  
SpatialVector (const SpatialVector &)=default  
SpatialVector &  operator= (const SpatialVector &)=default 
SpatialVector (SpatialVector &&)=default  
SpatialVector &  operator= (SpatialVector &&)=default 
Static Public Member Functions  
static SpatialQuantity  Zero () 
Factory to create a zero SpatialVector, i.e. More...  
Friends  
SpatialQuantity  operator* (const Matrix3< T > &R_FE, const SpatialQuantity &V_E) 
This operation reexpresses the spatial vector V_E originally expressed in frame E, into V_F , the same spatial vector expresed in another frame F. More...  
Related Functions  
(Note that these are not member functions.)  
SpatialQuantity  operator* (const T &s, const SpatialQuantity &V) 
Multiplication of a spatial vector V from the left by a scalar s . More...  
SpatialQuantity  operator* (const SpatialQuantity &V, const T &s) 
Multiplication of a spatial vector V from the right by a scalar s . More...  
template<template< typename > class SpatialQuantity, typename T >  
std::ostream &  operator<< (std::ostream &o, const SpatialVector< SpatialQuantity, T > &V) 
Stream insertion operator to write SpatialVector objects into a std::ostream . More...  
This class is used to represent physical quantities that correspond to spatial vectors such as spatial velocities, spatial accelerations and spatial forces.
Spatial vectors are 6element quantities that are pairs of ordinary 3vectors. Elements 02 are always the rotational component while elements 35 are always the translational component. For a more detailed introduction on spatial vectors please refer to section Spatial Vectors.
SV  The type of the more specialized spatial vector class. It must be a template on the scalar type T. 
T  The underlying scalar type. Must be a valid Eigen scalar. 
typedef Vector6<T> CoeffsEigenType 
The type of the underlying inmemory representation using an Eigen vector.
typedef T ScalarType 
using SpatialQuantity = SV<T> 
The more specialized spatial vector class templated on the scalar type T.
anonymous enum 

default 

default 

inline 
Default constructor.
In Release builds the elements of the newly constructed spatial vector are left uninitialized resulting in a zero cost operation. However in Debug builds those entries are set to NaN so that operations using this uninitialized spatial vector fail fast, allowing fast bug detection.

inline 
SpatialVector constructor from an rotational component w
and a linear component v
.

inlineexplicit 
SpatialVector constructor from an Eigen expression that represents a sixdimensional vector.
This constructor will assert the size of V is six (6) at compiletime for fixed sized Eigen expressions and at runtime for dynamic sized Eigen expressions.

inline 
Returns a (const) bare pointer to the underlying data.
It is guaranteed that there will be six (6) T's densely packed at data[0], data[1], etc.

inline 
Returns a reference to the underlying storage.

inline 
Returns a constant reference to the underlying storage.

inline 
Compares this
spatial vector to the provided spatial vector other
within a specified precision.
true
if other
is within a precision given by tolerance
. The comparison is performed by comparing the translational component of this
spatial vector with the rotational component of other
using the fuzzy comparison provided by Eigen's method isApprox().

inline 
Returns a (mutable) bare pointer to the underlying data.
It is guaranteed that there will be six (6) T's densely packed at data[0], data[1], etc.

default 

default 

inline 
Const access to the ith component of this spatial vector.
Bounds are only checked in Debug builds for a zero overhead implementation in Release builds.

inline 
Mutable access to the ith component of this spatial vector.
Bounds are only checked in Debug builds for a zero overhead implementation in Release builds.

inline 
Const access to the rotational component of this spatial vector.

inline 
Mutable access to the rotational component of this spatial vector.

inline 
Sets all entries in this
SpatialVector to NaN.
Typically used to quickly detect uninitialized values since NaN will trigger a chain of invalid computations that can then be tracked back to the source.

inline 
Sets both rotational and translational components of this
SpatialVector to zero.

inline 
The total size of the concatenation of the angular and linear components.
In three dimensions this is six (6) and it is known at compile time.

inline 
Const access to the translational component of this spatial vector.

inline 
Mutable access to the translational component of this spatial vector.

inlinestatic 
Factory to create a zero SpatialVector, i.e.
rotational and translational components are both zero.

friend 
Multiplication of a spatial vector V from the left by a scalar s
.

friend 
Multiplication of a spatial vector V from the right by a scalar s
.

friend 
This operation reexpresses the spatial vector V_E
originally expressed in frame E, into V_F
, the same spatial vector expresed in another frame F.
The transformation requires the rotation matrix R_FE
representing the orientation of the original frame E with respect to frame F. The operation performed is:
V_F.rotational() = R_FE * V_E.rotational(), V_F.translational() = R_FE * V_E.translational()

related 
Stream insertion operator to write SpatialVector objects into a std::ostream
.
Especially useful for debugging.