base
Classes | Public Member Functions | Public Attributes | List of all members
base::JointsTrajectory Struct Reference

Holds a time-series of JointStates for multiple joints. More...

#include <JointsTrajectory.hpp>

Inheritance diagram for base::JointsTrajectory:
base::NamedVector< JointTrajectory >

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
 
- Public Member Functions inherited from base::NamedVector< JointTrajectory >
bool hasNames () const
 
const JointTrajectorygetElementByName (std::string name) const
 
const JointTrajectoryoperator[] (std::string name) const
 
JointTrajectoryoperator[] (std::string name)
 
const JointTrajectoryoperator[] (size_t index) const
 
JointTrajectoryoperator[] (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::Timetimes
 optional array of time values corresponding to the samples of the JointState More...
 
- Public Attributes inherited from base::NamedVector< JointTrajectory >
std::vector< std::string > names
 
std::vector< JointTrajectoryelements
 

Detailed Description

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.

Member Function Documentation

◆ getDuration()

Time base::JointsTrajectory::getDuration ( ) const
Returns
the total duration of the time series if time information is available

◆ getJointsAtTimeStep()

void base::JointsTrajectory::getJointsAtTimeStep ( size_t  time_step,
base::samples::Joints joints 
)

Extracts the base::samples::Joints structure at a given time step.

Parameters
jointsextracted base::samples::Joints will be stored here
Exceptions
InvalidTimeStepif the given time_step does not exist in the trajectory.

◆ getNumberOfJoints()

size_t base::JointsTrajectory::getNumberOfJoints ( ) const
Returns
the number of joints in the trajectory

◆ getTimeSteps()

size_t base::JointsTrajectory::getTimeSteps ( ) const
Returns
the number of time steps in the trajectory

◆ isTimed()

bool base::JointsTrajectory::isTimed ( ) const
Returns
true if the JointState series has timing information

◆ isValid()

bool base::JointsTrajectory::isValid ( ) const
Returns
true if the structure is valid

◆ resize() [1/2]

void base::JointsTrajectory::resize ( int  num_joints,
int  num_samples 
)

◆ resize() [2/2]

void base::JointsTrajectory::resize ( int  num_joints)

Member Data Documentation

◆ times

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.


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