base
|
Holds a time-series of JointStates for multiple joints. More...
#include <JointsTrajectory.hpp>
Classes | |
struct | InvalidTimeStep |
Public Member Functions | |
bool | isValid () const |
void | resize (int num_joints, int num_samples) |
void | resize (int num_joints) |
void | getJointsAtTimeStep (size_t time_step, base::samples::Joints &joints) |
Extracts the base::samples::Joints structure at a given time step. More... | |
bool | isTimed () const |
size_t | getTimeSteps () const |
size_t | getNumberOfJoints () const |
base::Time | getDuration () const |
![]() | |
bool | hasNames () const |
const JointTrajectory & | getElementByName (std::string name) const |
const JointTrajectory & | operator[] (std::string name) const |
JointTrajectory & | operator[] (std::string name) |
const JointTrajectory & | operator[] (size_t index) const |
JointTrajectory & | operator[] (size_t index) |
void | resize (size_t size) |
size_t | size () const |
bool | empty () const |
void | clear () |
size_t | mapNameToIndex (std::string const &name) const |
Public Attributes | |
std::vector< base::Time > | times |
optional array of time values corresponding to the samples of the JointState More... | |
![]() | |
std::vector< std::string > | names |
std::vector< JointTrajectory > | elements |
Holds a time-series of JointStates for multiple joints.
This structure holds a time-series in the form of std::vector of JointState, for multiple optionally named joints.
The time series can have optional time information attached to each sample in the series through the times member.
For the data-type to be valid, the length of each time series needs to be the same for all joints. The times vector needs to be either empty or also of that size
How to access the state of a joint at a given sample: elements[joint_index][sample_number] The first index corresponds to the indices in the name vector. Second index to the time step.
Time base::JointsTrajectory::getDuration | ( | ) | const |
void base::JointsTrajectory::getJointsAtTimeStep | ( | size_t | time_step, |
base::samples::Joints & | joints | ||
) |
Extracts the base::samples::Joints structure at a given time step.
joints | extracted base::samples::Joints will be stored here |
InvalidTimeStep | if the given time_step does not exist in the trajectory. |
size_t base::JointsTrajectory::getNumberOfJoints | ( | ) | const |
size_t base::JointsTrajectory::getTimeSteps | ( | ) | const |
bool base::JointsTrajectory::isTimed | ( | ) | const |
bool base::JointsTrajectory::isValid | ( | ) | const |
void base::JointsTrajectory::resize | ( | int | num_joints, |
int | num_samples | ||
) |
void base::JointsTrajectory::resize | ( | int | num_joints | ) |
std::vector<base::Time> base::JointsTrajectory::times |
optional array of time values corresponding to the samples of the JointState
This vector needs to be either empty or the same size as each of the std::vector<JointState> in the elements vector.