Control Libraries 6.3.4
|
Abstract class to represent a state. More...
#include <State.hpp>
Public Member Functions | |
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. | |
State & | operator= (const State &state) |
Copy assignment operator that have to be defined to the custom assignment operator. More... | |
const StateType & | get_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... | |
Protected Member Functions | |
void | set_type (const StateType &type) |
Override the state type. More... | |
Friends | |
void | swap (State &state1, State &state2) |
Swap the values of the two States. More... | |
std::ostream & | operator<< (std::ostream &os, const State &state) |
Overload the ostream operator for printing. More... | |
|
explicit |
|
explicit |
|
explicit |
state_representation::State::State | ( | const State & | state | ) |
const std::string & state_representation::State::get_name | ( | ) | const |
const std::chrono::time_point< std::chrono::steady_clock > & state_representation::State::get_timestamp | ( | ) | const |
const StateType & state_representation::State::get_type | ( | ) | const |
|
virtual |
Initialize the State to a zero value.
Reimplemented in state_representation::DualQuaternionPose, state_representation::DualQuaternionState, state_representation::DualQuaternionTwist, state_representation::JointState, state_representation::Trajectory< StateT >, state_representation::CartesianState, and state_representation::Jacobian.
|
virtual |
Check if the state is compatible for operations with the state given as argument.
state | the state to check compatibility with |
Reimplemented in state_representation::JointState, state_representation::Jacobian, and state_representation::SpatialState.
|
inline |
bool state_representation::State::is_empty | ( | ) | const |
|
explicitnoexcept |
void state_representation::State::reset_timestamp | ( | ) |
|
virtual |
Set the data of the state from an Eigen matrix.
the | data vector |
Reimplemented in state_representation::Jacobian.
|
virtual |
Set the data of the state from a single Eigen vector.
the | data vector |
Reimplemented in state_representation::Ellipsoid, state_representation::CartesianAcceleration, state_representation::CartesianPose, state_representation::CartesianState, state_representation::CartesianTwist, state_representation::CartesianWrench, state_representation::JointAccelerations, state_representation::JointPositions, state_representation::JointState, state_representation::JointTorques, and state_representation::JointVelocities.
|
virtual |
Set the data of the state from a single std vector.
the | data vector |
Reimplemented in state_representation::Ellipsoid, state_representation::CartesianAcceleration, state_representation::CartesianPose, state_representation::CartesianState, state_representation::CartesianTwist, state_representation::CartesianWrench, state_representation::JointAccelerations, state_representation::JointPositions, state_representation::JointState, state_representation::JointTorques, and state_representation::JointVelocities.
void state_representation::State::set_empty | ( | bool | empty = true | ) |
void state_representation::State::set_filled | ( | ) |
|
virtual |
void state_representation::State::set_timestamp | ( | const std::chrono::time_point< std::chrono::steady_clock > & | timepoint | ) |
|
protected |
|
friend |