RobWorkProject  24.8.23-
Public Member Functions | Friends | Related Functions | List of all members
VelocityScrew6D< T > Class Template Reference

Class for representing 6 degrees of freedom velocity screws. More...

#include <VelocityScrew6D.hpp>

Public Member Functions

 VelocityScrew6D (T vx, T vy, T vz, T wx, T wy, T wz)
 Constructs a 6 degrees of freedom velocity screw. More...
 
template<class R >
 VelocityScrew6D (const Eigen::MatrixBase< R > &v)
 Construct from Eigen vector representation. More...
 
 VelocityScrew6D ()
 Default Constructor. Initialized the velocity to 0.
 
 VelocityScrew6D (const VelocityScrew6D &vs)
 Copy Constructor. More...
 
 VelocityScrew6D (const rw::math::Transform3D< T > &transform)
 Constructs a velocity screw in frame \( a \) from a transform \(\robabx{a}{b}{\mathbf{T}} \). More...
 
 VelocityScrew6D (const Vector3D< T > &linear, const EAA< T > &angular)
 Constructs a velocity screw from a linear and angular velocity. More...
 
const Vector3D< T > linear () const
 Extracts the linear velocity. More...
 
const EAA< T > angular () const
 Extracts the angular velocity and represents it using an equivalent-angle-axis as \( \dot{\Theta}\mathbf{k} \). More...
 
size_t size () const
 get the size of the underlying vector
 
T & operator() (std::size_t index)
 Returns reference to velocity screw element. More...
 
const T & operator() (std::size_t index) const
 Returns const reference to velocity screw element. More...
 
const T & operator[] (size_t i) const
 Returns const reference to velocity screw element. More...
 
T & operator[] (size_t i)
 Returns const reference to velocity screw element. More...
 
VelocityScrew6D< T > & operator+= (const VelocityScrew6D< T > &screw)
 Adds the velocity screw given as a parameter to the velocity screw. More...
 
VelocityScrew6D< T > & operator-= (const VelocityScrew6D< T > &screw)
 Subtracts the velocity screw given as a parameter from the velocity screw. More...
 
VelocityScrew6D< T > & operator*= (T s)
 Scales velocity screw with s. More...
 
bool operator== (const VelocityScrew6D< T > &rhs) const
 Comparison operator. More...
 
bool operator!= (const VelocityScrew6D< T > &rhs) const
 Comparison operator. More...
 
const VelocityScrew6D< T > operator* (T s) const
 Scales velocity screw and returns scaled version. More...
 
const VelocityScrew6D< T > operator+ (const VelocityScrew6D< T > &screw2) const
 Adds two velocity screws together \( \mathbf{\nu}_{12}=\mathbf{\nu}_1+\mathbf{\nu}_2 \). More...
 
const VelocityScrew6D< T > operator- (const VelocityScrew6D< T > &screw2) const
 Subtracts two velocity screws \(\mathbf{\nu}_{12}=\mathbf{\nu}_1-\mathbf{\nu}_2\). More...
 
norm1 () const
 Takes the 1-norm of the velocity screw. All elements both angular and linear are given the same weight. More...
 
norm2 () const
 Takes the 2-norm of the velocity screw. All elements both angular and linear are given the same weight. More...
 
normInf () const
 Takes the infinite norm of the velocity screw. All elements both angular and linear are given the same weight. More...
 
Eigen::Matrix< T, 6, 1 > e () const
 Converter to Eigen vector.
 

Friends

const VelocityScrew6D< T > operator* (T s, const VelocityScrew6D &screw)
 Scales velocity screw and returns scaled version. More...
 
const VelocityScrew6D< T > operator* (const rw::math::Transform3D< T > &aTb, const VelocityScrew6D< T > &bV)
 Changes frame of reference and velocity referencepoint of velocityscrew: \( \robabx{b}{b}{\mathbf{\nu}}\to \robabx{a}{a}{\mathbf{\nu}} \). More...
 
const VelocityScrew6D< T > operator* (const Vector3D< T > &aPqTop, const VelocityScrew6D< T > &bV)
 Changes velocity referencepoint of velocityscrew: \( \robabx{a}{q}{\mathbf{\nu}}\to \robabx{a}{p}{\mathbf{\nu}} \). More...
 
const VelocityScrew6D< T > operator* (const Rotation3D< T > &aRb, const VelocityScrew6D< T > &bV)
 Changes frame of reference for velocityscrew: \( \robabx{b}{i}{\mathbf{\nu}}\to \robabx{a}{i}{\mathbf{\nu}} \). More...
 
std::ostream & operator<< (std::ostream &os, const VelocityScrew6D< T > &screw)
 Ouputs velocity screw to stream. More...
 

Related Functions

(Note that these are not member functions.)

template<>
void write (const rw::math::VelocityScrew6D< double > &sobject, rw::common::OutputArchive &oarchive, const std::string &id)
 
template<>
void write (const rw::math::VelocityScrew6D< float > &sobject, rw::common::OutputArchive &oarchive, const std::string &id)
 
template<>
void read (rw::math::VelocityScrew6D< double > &sobject, rw::common::InputArchive &iarchive, const std::string &id)
 
template<>
void read (rw::math::VelocityScrew6D< float > &sobject, rw::common::InputArchive &iarchive, const std::string &id)
 

Detailed Description

template<class T = double>
class rw::math::VelocityScrew6D< T >

Class for representing 6 degrees of freedom velocity screws.

\[ \mathbf{\nu} = \left[ \begin{array}{c} v_x\\ v_y\\ v_z\\ \omega_x\\ \omega_y\\ \omega_z \end{array} \right] \]

A VelocityScrew is the description of a frames linear and rotational velocity with respect to some reference frame.

Constructor & Destructor Documentation

◆ VelocityScrew6D() [1/5]

VelocityScrew6D ( vx,
vy,
vz,
wx,
wy,
wz 
)

Constructs a 6 degrees of freedom velocity screw.

Parameters
vx[in] \( v_x \)
vy[in] \( v_y \)
vz[in] \( v_z \)
wx[in] \( \omega_x \)
wy[in] \( \omega_y \)
wz[in] \( \omega_z \)

◆ VelocityScrew6D() [2/5]

VelocityScrew6D ( const Eigen::MatrixBase< R > &  v)
inline

Construct from Eigen vector representation.

Parameters
v[in] Eigen matrix with either one row or one column.

◆ VelocityScrew6D() [3/5]

VelocityScrew6D ( const VelocityScrew6D< T > &  vs)
inline

Copy Constructor.

Parameters
vs[in] the velocityscrew6D to copy

◆ VelocityScrew6D() [4/5]

VelocityScrew6D ( const rw::math::Transform3D< T > &  transform)
explicit

Constructs a velocity screw in frame \( a \) from a transform \(\robabx{a}{b}{\mathbf{T}} \).

Parameters
transform[in] the corresponding transform.

◆ VelocityScrew6D() [5/5]

VelocityScrew6D ( const Vector3D< T > &  linear,
const EAA< T > &  angular 
)

Constructs a velocity screw from a linear and angular velocity.

Parameters
linear[in] linear velocity
angular[in] angular velocity

Member Function Documentation

◆ angular()

const EAA<T> angular ( ) const
inline

Extracts the angular velocity and represents it using an equivalent-angle-axis as \( \dot{\Theta}\mathbf{k} \).

Returns
the angular velocity

◆ linear()

const Vector3D<T> linear ( ) const
inline

Extracts the linear velocity.

Returns
the linear velocity

◆ norm1()

T norm1 ( ) const
inline

Takes the 1-norm of the velocity screw. All elements both angular and linear are given the same weight.

Returns
the 1-norm

◆ norm2()

T norm2 ( ) const
inline

Takes the 2-norm of the velocity screw. All elements both angular and linear are given the same weight.

Returns
the 2-norm

◆ normInf()

T normInf ( ) const
inline

Takes the infinite norm of the velocity screw. All elements both angular and linear are given the same weight.

Returns
the infinite norm

◆ operator!=()

bool operator!= ( const VelocityScrew6D< T > &  rhs) const
inline

Comparison operator.

The comparison operator makes a element wise comparison. Returns true if any of the elements are different.

Parameters
rhs[in] VelocityScrew6D to compare with
Returns
True if not equal.

◆ operator()() [1/2]

T& operator() ( std::size_t  index)
inline

Returns reference to velocity screw element.

Parameters
index[in] index in the screw, index must be \( < 6 \).
Returns
reference to velocity screw element

◆ operator()() [2/2]

const T& operator() ( std::size_t  index) const
inline

Returns const reference to velocity screw element.

Parameters
index[in] index in the screw, index must be \( < 6 \).
Returns
const reference to velocity screw element

◆ operator*()

const VelocityScrew6D<T> operator* ( s) const
inline

Scales velocity screw and returns scaled version.

Parameters
s[in] scaling value
Returns
Scales screw

◆ operator*=()

VelocityScrew6D<T>& operator*= ( s)
inline

Scales velocity screw with s.

Parameters
s[in] scaling value
Returns
reference to the VelocityScrew6D to support additional assigments

◆ operator+()

const VelocityScrew6D<T> operator+ ( const VelocityScrew6D< T > &  screw2) const
inline

Adds two velocity screws together \( \mathbf{\nu}_{12}=\mathbf{\nu}_1+\mathbf{\nu}_2 \).

Parameters
screw2[in] \( \mathbf{\nu}_2 \)
Returns
the velocity screw \( \mathbf{\nu}_{12} \)

◆ operator+=()

VelocityScrew6D<T>& operator+= ( const VelocityScrew6D< T > &  screw)
inline

Adds the velocity screw given as a parameter to the velocity screw.

Parameters
screw[in] Velocity screw to add
Returns
reference to the VelocityScrew6D to support additional assignments.

◆ operator-()

const VelocityScrew6D<T> operator- ( const VelocityScrew6D< T > &  screw2) const
inline

Subtracts two velocity screws \(\mathbf{\nu}_{12}=\mathbf{\nu}_1-\mathbf{\nu}_2\).

Parameters
screw2[in] \(\mathbf{\nu}_2\)
Returns
the velocity screw \(\mathbf{\nu}_{12} \)

◆ operator-=()

VelocityScrew6D<T>& operator-= ( const VelocityScrew6D< T > &  screw)
inline

Subtracts the velocity screw given as a parameter from the velocity screw.

Parameters
screw[in] Velocity screw to subtract
Returns
reference to the VelocityScrew6D to support additional assignments.

◆ operator==()

bool operator== ( const VelocityScrew6D< T > &  rhs) const
inline

Comparison operator.

The comparison operator makes a element wise comparison. Returns true only if all elements are equal.

Parameters
rhs[in] VelocityScrew6D to compare with
Returns
True if equal.

◆ operator[]() [1/2]

T& operator[] ( size_t  i)
inline

Returns const reference to velocity screw element.

Parameters
i[in] index in the screw, index must be \( < 6 \).
Returns
const reference to velocity screw element

◆ operator[]() [2/2]

const T& operator[] ( size_t  i) const
inline

Returns const reference to velocity screw element.

Parameters
i[in] index in the screw, index must be \( < 6 \).
Returns
const reference to velocity screw element

Friends And Related Function Documentation

◆ operator* [1/4]

const VelocityScrew6D<T> operator* ( const Rotation3D< T > &  aRb,
const VelocityScrew6D< T > &  bV 
)
friend

Changes frame of reference for velocityscrew: \( \robabx{b}{i}{\mathbf{\nu}}\to \robabx{a}{i}{\mathbf{\nu}} \).

Parameters
aRb[in] the change in orientation between frame \( \mathcal{F}_a \) and frame \( \mathcal{F}_b \): \( \robabx{a}{b}{\mathbf{R}} \)
bV[in] velocity screw wrt. frame \( \mathcal{F}_b \): \( \robabx{b}{i}{\mathbf{\nu}} \)
Returns
the velocity screw wrt. frame \( \mathcal{F}_a \): \( \robabx{a}{i}{\mathbf{\nu}} \)

Transformation of the base to which the VelocityScrew is expressed. The velocity reference point is left intact

\[ \robabx{a}{i}{\mathbf{\nu}} = \left[ \begin{array}{c} \robabx{a}{i}{\mathbf{v}} \\ \robabx{a}{i}{\mathbf{\omega}} \end{array} \right] = \left[ \begin{array}{cc} \robabx{a}{b}{\mathbf{R}} & \mathbf{0}^{3x3} \\ \mathbf{0}^{3x3} & \robabx{a}{b}{\mathbf{R}} \end{array} \right] \robabx{b}{i}{\mathbf{\nu}} = \left[ \begin{array}{c} \robabx{a}{b}{\mathbf{R}} \robabx{b}{i}{\mathbf{v}} \\ \robabx{a}{b}{\mathbf{R}} \robabx{b}{i}{\mathbf{\omega}} \end{array} \right] \]

◆ operator* [2/4]

const VelocityScrew6D<T> operator* ( const rw::math::Transform3D< T > &  aTb,
const VelocityScrew6D< T > &  bV 
)
friend

Changes frame of reference and velocity referencepoint of velocityscrew: \( \robabx{b}{b}{\mathbf{\nu}}\to \robabx{a}{a}{\mathbf{\nu}} \).

The frames \( \mathcal{F}_a \) and \( \mathcal{F}_b \) are rigidly connected.

Parameters
aTb[in] the location of frame \( \mathcal{F}_b \) wrt. frame \( \mathcal{F}_a \): \( \robabx{a}{b}{\mathbf{T}} \)
bV[in] velocity screw wrt. frame \( \mathcal{F}_b \): \( \robabx{b}{b}{\mathbf{\nu}} \)
Returns
the velocity screw wrt. frame \( \mathcal{F}_a \): \( \robabx{a}{a}{\mathbf{\nu}} \)

Transformation of both the velocity reference point and of the base to which the VelocityScrew is expressed

\[ \robabx{a}{a}{\mathbf{\nu}} = \left[ \begin{array}{c} \robabx{a}{a}{\mathbf{v}} \\ \robabx{a}{a}{\mathbf{\omega}} \end{array} \right] = \left[ \begin{array}{cc} \robabx{a}{b}{\mathbf{R}} & S(\robabx{a}{b}{\mathbf{p}}) \robabx{a}{b}{\mathbf{R}} \\ \mathbf{0}^{3x3} & \robabx{a}{b}{\mathbf{R}} \end{array} \right] \robabx{b}{b}{\mathbf{\nu}} = \left[ \begin{array}{c} \robabx{a}{b}{\mathbf{R}} \robabx{b}{b}{\mathbf{v}} + \robabx{a}{b}{\mathbf{p}} \times \robabx{a}{b}{\mathbf{R}} \robabx{b}{b}{\mathbf{\omega}}\\ \robabx{a}{b}{\mathbf{R}} \robabx{b}{b}{\mathbf{\omega}} \end{array} \right] \]

◆ operator* [3/4]

const VelocityScrew6D<T> operator* ( const Vector3D< T > &  aPqTop,
const VelocityScrew6D< T > &  bV 
)
friend

Changes velocity referencepoint of velocityscrew: \( \robabx{a}{q}{\mathbf{\nu}}\to \robabx{a}{p}{\mathbf{\nu}} \).

The vector should describe a translation from the current velocity reference point q to the wanted/new velocity reference point p seen from frame \( \mathcal{F}_a \)

Parameters
aPqTop[in] the translation from point q to point p seen in frame \( \mathcal{F}_a \)
bV[in] velocity screw wrt. frame \( \mathcal{F}_a \): \( \robabx{a}{q}{\mathbf{\nu}} \)
Returns
the velocity screw wrt. frame \( \mathcal{F}_a \): \( \robabx{a}{p}{\mathbf{\nu}} \)

Transformation of the velocity reference point

\[ \robabx{a}{p}{\mathbf{\nu}} = \left[ \begin{array}{c} \robabx{a}{p}{\mathbf{v}} \\ \robabx{a}{p}{\mathbf{\omega}} \end{array} \right] = \left[ \begin{array}{cc} \robabx{a}{b}{\mathbf{R}} & S(\robabx{a}{b}{\mathbf{p}}) \robabx{a}{b}{\mathbf{R}} \\ \mathbf{0}^{3x3} & \robabx{a}{b}{\mathbf{R}} \end{array} \right] \robabx{a}{p}{\mathbf{\nu}} = \left[ \begin{array}{c} \robabx{a}{p}{\mathbf{v}} + \robabx{a}{qTop}{\mathbf{p}} \robabx{b}{b}{\mathbf{\omega}}\\ \robabx{a}{b}{\mathbf{R}} \robabx{b}{b}{\mathbf{\omega}} \end{array} \right] \]

◆ operator* [4/4]

const VelocityScrew6D<T> operator* ( s,
const VelocityScrew6D< T > &  screw 
)
friend

Scales velocity screw and returns scaled version.

Parameters
s[in] scaling value
screw[in] Screw to scale
Returns
Scales screw

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const VelocityScrew6D< T > &  screw 
)
friend

Ouputs velocity screw to stream.

Parameters
os[in/out] stream to use
screw[in] velocity screw
Returns
the resulting stream

◆ read() [1/2]

void read ( rw::math::VelocityScrew6D< double > &  sobject,
rw::common::InputArchive iarchive,
const std::string &  id 
)
related

Enable read-serialization of class T by overloading this method. Data is read from iarchive and filled into sobject.

Parameters
sobject[out] the object in which the data should be streamed into
iarchive[in] the InputArchive from which to read data.
id[in] The id of the serialized sobject.
Note
the id can be empty in which case the overloaded method should provide a default identifier. E.g. the Vector3D class defined "Vector3D" as its default id.

◆ read() [2/2]

void read ( rw::math::VelocityScrew6D< float > &  sobject,
rw::common::InputArchive iarchive,
const std::string &  id 
)
related

Enable read-serialization of class T by overloading this method. Data is read from iarchive and filled into sobject.

Parameters
sobject[out] the object in which the data should be streamed into
iarchive[in] the InputArchive from which to read data.
id[in] The id of the serialized sobject.
Note
the id can be empty in which case the overloaded method should provide a default identifier. E.g. the Vector3D class defined "Vector3D" as its default id.

◆ write() [1/2]

void write ( const rw::math::VelocityScrew6D< double > &  sobject,
rw::common::OutputArchive oarchive,
const std::string &  id 
)
related

Enable write-serialization of class T by overloading this method. Data is written to oarchive from the sobject.

Parameters
sobject[in] the object from which the data should be streamed.
oarchive[out] the OutputArchive in which data should be written.
id[in] The id of the serialized sobject.
Note
the id can be empty in which case the overloaded method should provide a default identifier. E.g. the Vector3D class defined "Vector3D" as its default id.

◆ write() [2/2]

void write ( const rw::math::VelocityScrew6D< float > &  sobject,
rw::common::OutputArchive oarchive,
const std::string &  id 
)
related

Enable write-serialization of class T by overloading this method. Data is written to oarchive from the sobject.

Parameters
sobject[in] the object from which the data should be streamed.
oarchive[out] the OutputArchive in which data should be written.
id[in] The id of the serialized sobject.
Note
the id can be empty in which case the overloaded method should provide a default identifier. E.g. the Vector3D class defined "Vector3D" as its default id.

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