Control Libraries 7.4.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
state_representation::Trajectory< StateT > Class Template Reference
Inheritance diagram for state_representation::Trajectory< StateT >:
state_representation::State

Public Member Functions

 Trajectory ()
 Empty constructor.
 
 Trajectory (const std::string &name)
 Constructor with name and reference frame provided.
 
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.
 
const std::vector< std::string > & get_joint_names () const
 Getter of the names attribute.
 
void set_joint_names (unsigned int nb_joints)
 Setter of the names attribute from the number of joints.
 
void set_joint_names (const std::vector< std::string > &joint_names)
 Setter of the names attribute from the joints names.
 
void reset ()
 Initialize trajectory.
 
template<typename DurationT >
void add_point (const StateT &new_point, const std::chrono::duration< int64_t, DurationT > &new_time)
 Add new point and corresponding time to trajectory.
 
template<typename DurationT >
void insert_point (const StateT &new_point, const std::chrono::duration< int64_t, DurationT > &new_time, int pos)
 Insert new point and corresponding time to trajectory between two already existing points.
 
void delete_point ()
 Delete last point and corresponding time from trajectory.
 
void clear ()
 Clear trajectory.
 
const std::deque< StateT > & get_points () const
 Get attribute list of trajectory points.
 
const StateT & get_point (unsigned int index) const
 Get the trajectory point at given index.
 
StateT & get_point (unsigned int index)
 Get the trajectory point at given index.
 
const std::deque< std::chrono::nanoseconds > & get_times () const
 Get attribute list of trajectory times.
 
int get_size () const
 Get attribute number of point in trajectory.
 
const std::pair< StateT, std::chrono::nanoseconds > operator[] (unsigned int idx) const
 Operator overload for returning a single trajectory point and corresponding time.
 
std::pair< StateT, std::chrono::nanoseconds > operator[] (unsigned int idx)
 Operator overload for returning a single trajectory point and corresponding time.
 
- 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.
 
virtual bool is_incompatible (const State &state) const
 Check if the state is incompatible for operations with the state given as argument.
 
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.
 
 operator bool () const noexcept
 Boolean operator for the truthiness of a state.
 

Additional Inherited Members

- 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.
 
virtual std::string to_string () const
 Convert the state to its string representation.
 

Detailed Description

template<class StateT>
class state_representation::Trajectory< StateT >

Definition at line 9 of file Trajectory.hpp.

Constructor & Destructor Documentation

◆ Trajectory() [1/2]

template<class StateT >
state_representation::Trajectory< StateT >::Trajectory ( )
explicit

Empty constructor.

Definition at line 120 of file Trajectory.hpp.

◆ Trajectory() [2/2]

template<class StateT >
state_representation::Trajectory< StateT >::Trajectory ( const std::string &  name)
explicit

Constructor with name and reference frame provided.

name the name of the state

Definition at line 127 of file Trajectory.hpp.

Member Function Documentation

◆ add_point()

template<class StateT >
template<typename DurationT >
void state_representation::Trajectory< StateT >::add_point ( const StateT &  new_point,
const std::chrono::duration< int64_t, DurationT > &  new_time 
)

Add new point and corresponding time to trajectory.

Definition at line 171 of file Trajectory.hpp.

◆ clear()

template<class StateT >
void state_representation::Trajectory< StateT >::clear ( )

Clear trajectory.

Definition at line 217 of file Trajectory.hpp.

◆ delete_point()

template<class StateT >
void state_representation::Trajectory< StateT >::delete_point ( )

Delete last point and corresponding time from trajectory.

Definition at line 206 of file Trajectory.hpp.

◆ get_joint_names()

template<class StateT >
const std::vector< std::string > & state_representation::Trajectory< StateT >::get_joint_names ( ) const
inline

Getter of the names attribute.

Definition at line 145 of file Trajectory.hpp.

◆ get_point() [1/2]

template<class StateT >
StateT & state_representation::Trajectory< StateT >::get_point ( unsigned int  index)

Get the trajectory point at given index.

Parameters
indexthe index

Definition at line 233 of file Trajectory.hpp.

◆ get_point() [2/2]

template<class StateT >
const StateT & state_representation::Trajectory< StateT >::get_point ( unsigned int  index) const

Get the trajectory point at given index.

Parameters
indexthe index

Definition at line 228 of file Trajectory.hpp.

◆ get_points()

template<class StateT >
const std::deque< StateT > & state_representation::Trajectory< StateT >::get_points ( ) const
inline

Get attribute list of trajectory points.

Definition at line 223 of file Trajectory.hpp.

◆ get_reference_frame()

template<class StateT >
const std::string state_representation::Trajectory< StateT >::get_reference_frame ( ) const
inline

Getter of the reference frame as const reference.

Definition at line 135 of file Trajectory.hpp.

◆ get_size()

template<class StateT >
int state_representation::Trajectory< StateT >::get_size ( ) const

Get attribute number of point in trajectory.

Definition at line 243 of file Trajectory.hpp.

◆ get_times()

template<class StateT >
const std::deque< std::chrono::nanoseconds > & state_representation::Trajectory< StateT >::get_times ( ) const
inline

Get attribute list of trajectory times.

Definition at line 238 of file Trajectory.hpp.

◆ insert_point()

template<class StateT >
template<typename DurationT >
void state_representation::Trajectory< StateT >::insert_point ( const StateT &  new_point,
const std::chrono::duration< int64_t, DurationT > &  new_time,
int  pos 
)

Insert new point and corresponding time to trajectory between two already existing points.

Definition at line 185 of file Trajectory.hpp.

◆ operator[]() [1/2]

template<class StateT >
std::pair< StateT, std::chrono::nanoseconds > state_representation::Trajectory< StateT >::operator[] ( unsigned int  idx)

Operator overload for returning a single trajectory point and corresponding time.

Definition at line 253 of file Trajectory.hpp.

◆ operator[]() [2/2]

template<class StateT >
const std::pair< StateT, std::chrono::nanoseconds > state_representation::Trajectory< StateT >::operator[] ( unsigned int  idx) const

Operator overload for returning a single trajectory point and corresponding time.

Definition at line 248 of file Trajectory.hpp.

◆ reset()

template<class StateT >
void state_representation::Trajectory< StateT >::reset ( )
virtual

Initialize trajectory.

Reimplemented from state_representation::State.

Definition at line 163 of file Trajectory.hpp.

◆ set_joint_names() [1/2]

template<class StateT >
void state_representation::Trajectory< StateT >::set_joint_names ( const std::vector< std::string > &  joint_names)
inline

Setter of the names attribute from the joints names.

Definition at line 158 of file Trajectory.hpp.

◆ set_joint_names() [2/2]

template<class StateT >
void state_representation::Trajectory< StateT >::set_joint_names ( unsigned int  nb_joints)
inline

Setter of the names attribute from the number of joints.

Definition at line 150 of file Trajectory.hpp.

◆ set_reference_frame()

template<class StateT >
void state_representation::Trajectory< StateT >::set_reference_frame ( const std::string &  reference_frame)
inlinevirtual

Setter of the reference frame.

Definition at line 140 of file Trajectory.hpp.


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