Control Libraries 6.3.4
Loading...
Searching...
No Matches
Public 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. More...
 
 SpatialState (const StateType &type)
 Empty constructor with a specific state type. More...
 
 SpatialState (const StateType &type, const std::string &name, const std::string &reference_frame="world", const bool &empty=true)
 Constructor with name and reference frame specification. More...
 
 SpatialState (const SpatialState &state)=default
 Copy constructor from another SpatialState.
 
SpatialStateoperator= (const SpatialState &state)
 Copy assignment operator that have to be defined to the custom assignment operator. More...
 
const std::string & get_reference_frame () const
 Getter of the reference frame as const reference. More...
 
virtual void set_reference_frame (const std::string &reference_frame)
 Setter of the reference frame. More...
 
virtual bool is_compatible (const State &state) const override
 Check if the state is compatible for operations with the state given as argument. More...
 
- Public Member Functions inherited from state_representation::State
 State ()
 Empty constructor. More...
 
 State (const StateType &type)
 Constructor only specifying the type of the state from the StateType enumeration. More...
 
 State (const StateType &type, const std::string &name, const bool &empty=true)
 Constructor with name specification. More...
 
 State (const State &state)
 Copy constructor from another State. More...
 
virtual ~State ()=default
 Virtual destructor.
 
Stateoperator= (const State &state)
 Copy assignment operator that have to be defined to the custom assignment operator. More...
 
const StateTypeget_type () const
 Getter of the type attribute. More...
 
bool is_empty () const
 Getter of the empty attribute. More...
 
void set_empty (bool empty=true)
 Setter of the empty attribute. More...
 
void set_filled ()
 Setter of the empty attribute to false and also reset the timestamp. More...
 
const std::chrono::time_point< std::chrono::steady_clock > & get_timestamp () const
 Getter of the timestamp attribute. More...
 
void set_timestamp (const std::chrono::time_point< std::chrono::steady_clock > &timepoint)
 Setter of the timestamp attribute. More...
 
void reset_timestamp ()
 Reset the timestamp attribute to now. More...
 
const std::string & get_name () const
 Getter of the name as const reference. More...
 
virtual void set_name (const std::string &name)
 Setter of the name. More...
 
template<typename DurationT >
bool is_deprecated (const std::chrono::duration< int64_t, DurationT > &time_delay)
 Check if the state is deprecated given a certain time delay. More...
 
virtual bool is_compatible (const State &state) const
 Check if the state is compatible for operations with the state given as argument. More...
 
virtual void initialize ()
 Initialize the State to a zero value. More...
 
virtual void set_data (const Eigen::VectorXd &data)
 Set the data of the state from a single Eigen vector. More...
 
virtual void set_data (const std::vector< double > &data)
 Set the data of the state from a single std vector. More...
 
virtual void set_data (const Eigen::MatrixXd &data)
 Set the data of the state from an Eigen matrix. More...
 
 operator bool () const noexcept
 Boolean operator for the truthiness of a state. More...
 

Friends

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

Additional Inherited Members

- Protected Member Functions inherited from state_representation::State
void set_type (const StateType &type)
 Override the state type. More...
 

Detailed Description

Definition at line 6 of file SpatialState.hpp.

Constructor & Destructor Documentation

◆ SpatialState() [1/3]

state_representation::SpatialState::SpatialState ( )

Empty constructor.

Definition at line 5 of file SpatialState.cpp.

◆ SpatialState() [2/3]

state_representation::SpatialState::SpatialState ( const StateType type)
explicit

Empty constructor with a specific state type.

Parameters
typeThe type of the State

Definition at line 8 of file SpatialState.cpp.

◆ SpatialState() [3/3]

state_representation::SpatialState::SpatialState ( const StateType type,
const std::string &  name,
const std::string &  reference_frame = "world",
const bool &  empty = true 
)
explicit

Constructor with name and reference frame specification.

Parameters
typeThe type of the State
nameThe name of the State
reference_frameThe reference frame in which the state is expressed, by default world
emptySpecify if the state is initialized as empty, default true

Definition at line 11 of file SpatialState.cpp.

Member Function Documentation

◆ get_reference_frame()

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

Getter of the reference frame as const reference.

Returns
The name of the reference frame

Definition at line 91 of file SpatialState.hpp.

◆ is_compatible()

bool state_representation::SpatialState::is_compatible ( const State state) const
inlineoverridevirtual

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

Parameters
stateThe state to check compatibility with

Reimplemented from state_representation::State.

Definition at line 99 of file SpatialState.hpp.

◆ operator=()

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

Copy assignment operator that have 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 85 of file SpatialState.hpp.

◆ set_reference_frame()

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

Setter of the reference frame.

Parameters
reference_frameThe reference frame

Definition at line 95 of file SpatialState.hpp.

Friends And Related Function 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 SpatialState to
stateThe SpatialState to print
Returns
The appended ostream

Definition at line 17 of file SpatialState.cpp.

◆ swap

void swap ( SpatialState state1,
SpatialState state2 
)
friend

Swap the values of the two SpatialState.

Parameters
state1SpatialState to be swapped with 2
state2SpatialState to be swapped with 1

Definition at line 80 of file SpatialState.hpp.


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