Control Libraries 7.4.0
|
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. | |
State & | operator= (const State &state) |
Copy assignment operator that has to be defined to the custom assignment operator. | |
const StateType & | get_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. | |
Definition at line 9 of file Trajectory.hpp.
|
explicit |
Empty constructor.
Definition at line 120 of file Trajectory.hpp.
|
explicit |
Constructor with name and reference frame provided.
name the name of the state
Definition at line 127 of file Trajectory.hpp.
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.
void state_representation::Trajectory< StateT >::clear | ( | ) |
Clear trajectory.
Definition at line 217 of file Trajectory.hpp.
void state_representation::Trajectory< StateT >::delete_point | ( | ) |
Delete last point and corresponding time from trajectory.
Definition at line 206 of file Trajectory.hpp.
|
inline |
Getter of the names attribute.
Definition at line 145 of file Trajectory.hpp.
StateT & state_representation::Trajectory< StateT >::get_point | ( | unsigned int | index | ) |
Get the trajectory point at given index.
index | the index |
Definition at line 233 of file Trajectory.hpp.
const StateT & state_representation::Trajectory< StateT >::get_point | ( | unsigned int | index | ) | const |
Get the trajectory point at given index.
index | the index |
Definition at line 228 of file Trajectory.hpp.
|
inline |
Get attribute list of trajectory points.
Definition at line 223 of file Trajectory.hpp.
|
inline |
Getter of the reference frame as const reference.
Definition at line 135 of file Trajectory.hpp.
int state_representation::Trajectory< StateT >::get_size | ( | ) | const |
Get attribute number of point in trajectory.
Definition at line 243 of file Trajectory.hpp.
|
inline |
Get attribute list of trajectory times.
Definition at line 238 of file Trajectory.hpp.
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.
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.
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.
|
virtual |
Initialize trajectory.
Reimplemented from state_representation::State.
Definition at line 163 of file Trajectory.hpp.
|
inline |
Setter of the names attribute from the joints names.
Definition at line 158 of file Trajectory.hpp.
|
inline |
Setter of the names attribute from the number of joints.
Definition at line 150 of file Trajectory.hpp.
|
inlinevirtual |
Setter of the reference frame.
Definition at line 140 of file Trajectory.hpp.