Control Libraries 7.4.0
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Friends | List of all members
state_representation::SpatialState Class Reference
Inheritance diagram for state_representation::SpatialState:
state_representation::State state_representation::CartesianState state_representation::DualQuaternionState state_representation::CartesianAcceleration state_representation::CartesianPose state_representation::CartesianTwist state_representation::CartesianWrench state_representation::DualQuaternionPose state_representation::DualQuaternionTwist

Public Member Functions

 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.
 

Protected Member Functions

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.
 

Friends

void swap (SpatialState &state1, SpatialState &state2)
 Swap the values of the two SpatialState.
 
std::ostream & operator<< (std::ostream &os, const SpatialState &state)
 Overload the ostream operator for printing.
 

Detailed Description

Definition at line 7 of file SpatialState.hpp.

Constructor & Destructor Documentation

◆ SpatialState() [1/3]

state_representation::SpatialState::SpatialState ( )

Empty constructor.

Definition at line 7 of file SpatialState.cpp.

◆ SpatialState() [2/3]

state_representation::SpatialState::SpatialState ( const std::string &  name,
const std::string &  reference_frame = "world" 
)
explicit

Constructor with name and reference frame specification.

Parameters
nameThe name of the state
reference_frameThe reference frame in which the state is expressed, by default world

Definition at line 11 of file SpatialState.cpp.

◆ SpatialState() [3/3]

state_representation::SpatialState::SpatialState ( const SpatialState state)

Copy constructor from another spatial state.

Definition at line 16 of file SpatialState.cpp.

Member Function Documentation

◆ get_reference_frame()

const std::string & state_representation::SpatialState::get_reference_frame ( ) const

Getter of the reference frame as const reference.

Definition at line 26 of file SpatialState.cpp.

◆ is_incompatible()

bool state_representation::SpatialState::is_incompatible ( const State state) const
overridevirtual

Check if the spatial state is incompatible for operations with the state given as argument.

Parameters
stateThe state to check compatibility with

Reimplemented from state_representation::State.

Definition at line 35 of file SpatialState.cpp.

◆ operator=()

SpatialState & state_representation::SpatialState::operator= ( const SpatialState state)

Copy assignment operator that has to be defined to the custom assignment operator.

Parameters
stateThe state with value to assign
Returns
Reference to the current state with new values

Definition at line 20 of file SpatialState.cpp.

◆ set_reference_frame()

void state_representation::SpatialState::set_reference_frame ( const std::string &  reference_frame)
virtual

Setter of the reference frame.

Definition at line 30 of file SpatialState.cpp.

◆ to_string()

std::string state_representation::SpatialState::to_string ( ) const
overrideprotectedvirtual

Convert the state to its string representation.

Reimplemented from state_representation::State.

Definition at line 50 of file SpatialState.cpp.

Friends And Related Symbol Documentation

◆ operator<<

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

Overload the ostream operator for printing.

Parameters
osThe ostream to append the string representing the state to
stateThe spatial state to print
Returns
The appended ostream

Definition at line 55 of file SpatialState.cpp.

◆ swap

void swap ( SpatialState state1,
SpatialState state2 
)
friend

Swap the values of the two SpatialState.

Parameters
state1Spatial state to be swapped with 2
state2Spatial state to be swapped with 1

Definition at line 74 of file SpatialState.hpp.


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