Control Libraries 7.4.0
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
state_representation::DualQuaternionState Class Reference

Class to represent a state in Dual Quaternion space. More...

#include <DualQuaternionState.hpp>

Inheritance diagram for state_representation::DualQuaternionState:
state_representation::SpatialState state_representation::State state_representation::DualQuaternionPose state_representation::DualQuaternionTwist

Public Member Functions

 DualQuaternionState ()
 Empty constructor.
 
 DualQuaternionState (const std::string &name, const std::string &reference="world")
 Constructor with name and reference frame provided.
 
 DualQuaternionState (const DualQuaternionState &state)
 Copy constructor.
 
 DualQuaternionState (const std::string &name, const Eigen::Quaterniond &primary, const Eigen::Quaterniond &dual, const std::string &reference="world")
 Construct a DualQuaternion from two quaternions.
 
const Eigen::Quaterniond & get_primary () const
 Getter of the primary attribute.
 
const Eigen::Quaterniond & get_dual () const
 Getter of the dual attribute.
 
void set_primary (const Eigen::Quaterniond &primary)
 Setter of the primary attribute.
 
void set_dual (const Eigen::Quaterniond &dual)
 Setter of the dual attribute.
 
DualQuaternionStateoperator*= (const DualQuaternionState &q)
 Overload the *= operator.
 
const DualQuaternionState operator* (const DualQuaternionState &p) const
 Overload the * operator.
 
const DualQuaternionState conjugate () const
 compute the conjugate of the current DualQuaternion
 
virtual void initialize ()
 Initialize the DualQuaternionState to a zero value.
 
const DualQuaternionState copy () const
 Return a copy of the DualQuaternionState.
 
- Public Member Functions inherited from state_representation::SpatialState
 SpatialState ()
 Empty constructor.
 
 SpatialState (const std::string &name, const std::string &reference_frame="world")
 Constructor with name and reference frame specification.
 
 SpatialState (const SpatialState &state)
 Copy constructor from another spatial state.
 
SpatialStateoperator= (const SpatialState &state)
 Copy assignment operator that has to be defined to the custom assignment operator.
 
const std::string & get_reference_frame () const
 Getter of the reference frame as const reference.
 
virtual void set_reference_frame (const std::string &reference_frame)
 Setter of the reference frame.
 
bool is_incompatible (const State &state) const override
 Check if the spatial state is incompatible for operations with the state given as argument.
 
- Public Member Functions inherited from state_representation::State
 State ()
 Empty constructor.
 
 State (const std::string &name)
 Constructor with name specification.
 
 State (const State &state)
 Copy constructor from another state.
 
virtual ~State ()=default
 Virtual destructor.
 
Stateoperator= (const State &state)
 Copy assignment operator that has to be defined to the custom assignment operator.
 
const StateTypeget_type () const
 Getter of the type attribute.
 
const std::string & get_name () const
 Getter of the name attribute.
 
bool is_empty () const
 Getter of the empty attribute.
 
const std::chrono::time_point< std::chrono::steady_clock > & get_timestamp () const
 Getter of the timestamp attribute.
 
virtual void set_name (const std::string &name)
 Setter of the name attribute.
 
void reset_timestamp ()
 Reset the timestamp attribute to now.
 
virtual void set_data (const Eigen::VectorXd &data)
 Set the data of the state from an Eigen vector.
 
virtual void set_data (const std::vector< double > &data)
 Set the data of the state from a std vector.
 
virtual void set_data (const Eigen::MatrixXd &data)
 Set the data of the state from an Eigen matrix.
 
double get_age () const
 Get the age of the state, i.e. the time since the last modification.
 
bool is_deprecated (double time_delay) const
 Check if the state is deprecated given a certain time delay.
 
template<typename DurationT >
bool is_deprecated (const std::chrono::duration< int64_t, DurationT > &time_delay) const
 Check if the state is deprecated given a certain time delay.
 
virtual void reset ()
 Reset the object to a post-construction state.
 
 operator bool () const noexcept
 Boolean operator for the truthiness of a state.
 

Friends

const DualQuaternionState operator* (const float &lambda, const DualQuaternionState &state)
 Overload the * operator with a scalar.
 
const DualQuaternionState exp (const DualQuaternionState &state)
 overload exp function
 
std::ostream & operator<< (std::ostream &os, const DualQuaternionState &state)
 Overload the ostream operator for printing.
 

Additional Inherited Members

- Protected Member Functions inherited from state_representation::SpatialState
std::string to_string () const override
 Convert the state to its string representation.
 
- Protected Member Functions inherited from state_representation::State
void set_type (const StateType &type)
 Setter of the state type attribute.
 
void set_empty (bool empty=true)
 Setter of the empty attribute.
 
void assert_not_empty () const
 Throw an exception if the state is empty.
 

Detailed Description

Class to represent a state in Dual Quaternion space.

Definition at line 10 of file DualQuaternionState.hpp.

Constructor & Destructor Documentation

◆ DualQuaternionState() [1/4]

state_representation::DualQuaternionState::DualQuaternionState ( )
explicit

Empty constructor.

Definition at line 4 of file DualQuaternionState.cpp.

◆ DualQuaternionState() [2/4]

state_representation::DualQuaternionState::DualQuaternionState ( const std::string &  name,
const std::string &  reference = "world" 
)
explicit

Constructor with name and reference frame provided.

name the name of the state

reference the name of the reference frame

Definition at line 7 of file DualQuaternionState.cpp.

◆ DualQuaternionState() [3/4]

state_representation::DualQuaternionState::DualQuaternionState ( const DualQuaternionState state)

Copy constructor.

Definition at line 12 of file DualQuaternionState.cpp.

◆ DualQuaternionState() [4/4]

state_representation::DualQuaternionState::DualQuaternionState ( const std::string &  name,
const Eigen::Quaterniond &  primary,
const Eigen::Quaterniond &  dual,
const std::string &  reference = "world" 
)
explicit

Construct a DualQuaternion from two quaternions.

Parameters
namethe name of the state
primarythe value of the primary quaternion
dualthe value of the dual quaternion

Definition at line 17 of file DualQuaternionState.cpp.

Member Function Documentation

◆ conjugate()

const DualQuaternionState state_representation::DualQuaternionState::conjugate ( ) const

compute the conjugate of the current DualQuaternion

Returns
the inverse

Definition at line 42 of file DualQuaternionState.cpp.

◆ copy()

const DualQuaternionState state_representation::DualQuaternionState::copy ( ) const

Return a copy of the DualQuaternionState.

Returns
the copy

Definition at line 78 of file DualQuaternionState.cpp.

◆ get_dual()

const Eigen::Quaterniond & state_representation::DualQuaternionState::get_dual ( ) const
inline

Getter of the dual attribute.

Definition at line 122 of file DualQuaternionState.hpp.

◆ get_primary()

const Eigen::Quaterniond & state_representation::DualQuaternionState::get_primary ( ) const
inline

Getter of the primary attribute.

Definition at line 118 of file DualQuaternionState.hpp.

◆ initialize()

void state_representation::DualQuaternionState::initialize ( )
virtual

Initialize the DualQuaternionState to a zero value.

Reimplemented in state_representation::DualQuaternionPose, and state_representation::DualQuaternionTwist.

Definition at line 49 of file DualQuaternionState.cpp.

◆ operator*()

const DualQuaternionState state_representation::DualQuaternionState::operator* ( const DualQuaternionState p) const

Overload the * operator.

Parameters
pDualQuaternionState to multiply with
Returns
the current DualQuaternionState multiply by the DualQuaternionState given in argument

Definition at line 36 of file DualQuaternionState.cpp.

◆ operator*=()

DualQuaternionState & state_representation::DualQuaternionState::operator*= ( const DualQuaternionState q)

Overload the *= operator.

Parameters
qDualQuaternion to multiply with
Returns
the current DualQuaternion multiply by the DualQuaternion given in argument

Definition at line 26 of file DualQuaternionState.cpp.

◆ set_dual()

void state_representation::DualQuaternionState::set_dual ( const Eigen::Quaterniond &  dual)
inline

Setter of the dual attribute.

Definition at line 131 of file DualQuaternionState.hpp.

◆ set_primary()

void state_representation::DualQuaternionState::set_primary ( const Eigen::Quaterniond &  primary)
inline

Setter of the primary attribute.

Definition at line 126 of file DualQuaternionState.hpp.

Friends And Related Symbol Documentation

◆ exp

const DualQuaternionState exp ( const DualQuaternionState state)
friend

overload exp function

Parameters
statethe DualQuaternion to operate on
Returns
the exponential of the DualQuaternion provided

Definition at line 62 of file DualQuaternionState.cpp.

◆ operator*

const DualQuaternionState operator* ( const float &  lambda,
const DualQuaternionState state 
)
friend

Overload the * operator with a scalar.

Parameters
lambdathe scalar to multiply with
Returns
the DualQuaternionState provided multiply by lambda

Definition at line 55 of file DualQuaternionState.cpp.

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const DualQuaternionState state 
)
friend

Overload the ostream operator for printing.

Parameters
osthe ostream to happend the string representing the state to
statethe state to print
Returns
the appended ostream

Definition at line 83 of file DualQuaternionState.cpp.


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