Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
hebi::trajectory::Trajectory Class Referencefinal

Represents a smooth trajectory through a set of waypoints. More...

#include <trajectory.hpp>

Public Member Functions

double getDuration () const
 The time (in seconds) between the start and end of this trajectory. More...
 
double getEndTime () const
 Get the time (in seconds) at which the defined trajectory ends. More...
 
size_t getJointCount () const
 The number of independent position trajectories over the same time domain that are managed by this object. More...
 
double getStartTime () const
 Get the time (in seconds) at which the defined trajectory begins. More...
 
bool getState (double time, VectorXd *position, VectorXd *velocity, VectorXd *acceleration) const
 Returns the position, velocity, and acceleration for a given point in time along the trajectory. More...
 
size_t getWaypointCount () const
 The number of fixed waypoints that each joint is moving through. More...
 
 ~Trajectory () noexcept
 Destructor cleans up resources for trajectory. More...
 

Static Public Member Functions

static std::shared_ptr< TrajectorycreateUnconstrainedQp (const VectorXd &time_vector, const MatrixXd &positions, const MatrixXd *velocities=nullptr, const MatrixXd *accelerations=nullptr)
 Creates a smooth trajectory through a set of waypoints (position velocity and accelerations defined at particular times). This trajectory wrapper object can create multi-dimensional trajectories (i.e., multiple joints moving together using the same time reference). More...
 

Private Member Functions

 Trajectory (std::vector< HebiTrajectoryPtr > trajectories, size_t number_of_waypoints, double start_time, double end_time)
 

Private Attributes

const double end_time_
 
const size_t number_of_joints_
 
const size_t number_of_waypoints_
 
const double start_time_
 
std::vector< HebiTrajectoryPtrtrajectories_
 

Detailed Description

Represents a smooth trajectory through a set of waypoints.

Definition at line 17 of file trajectory.hpp.

Constructor & Destructor Documentation

hebi::trajectory::Trajectory::Trajectory ( std::vector< HebiTrajectoryPtr trajectories,
size_t  number_of_waypoints,
double  start_time,
double  end_time 
)
private

Creates a Trajectory from a list of the underlying C-style objects.

Definition at line 6 of file trajectory.cpp.

hebi::trajectory::Trajectory::~Trajectory ( )
noexcept

Destructor cleans up resources for trajectory.

Definition at line 116 of file trajectory.cpp.

Member Function Documentation

std::shared_ptr< Trajectory > hebi::trajectory::Trajectory::createUnconstrainedQp ( const VectorXd &  time_vector,
const MatrixXd &  positions,
const MatrixXd *  velocities = nullptr,
const MatrixXd *  accelerations = nullptr 
)
static

Creates a smooth trajectory through a set of waypoints (position velocity and accelerations defined at particular times). This trajectory wrapper object can create multi-dimensional trajectories (i.e., multiple joints moving together using the same time reference).

Parameters
time_vectorA vector of desired times at which to reach each waypoint; this must be defined (and not NAN for any element).
positionsA matrix of waypoint joint positions (in SI units). The number of rows should be equal to the number of joints, and the number of columns equal to the number of waypoints. Any elements that are NAN will be considered free parameters when solving for a trajectory. Values of +/-infinity are not allowed.
velocitiesAn optional matrix of velocity constraints at the corresponding waypoints; should either be nullptr or matching the size of the positions matrix. Any elements that are NAN will be considered free parameters when solving for a trajectory. Values of +/-infinity are not allowed.
accelerationsAn optional matrix of acceleration constraints at the corresponding waypoints; should either be nullptr or matching the size of the positions matrix. Any elements that are NAN will be considered free parameters when solving for a trajectory. Values of +/-infinity are not allowed.
Returns
A HebiTrajectory object if there were no errors, and the trajectory has been created. An empty shared_ptr indicates that there was an error in creating the trajectory.

Definition at line 15 of file trajectory.cpp.

double hebi::trajectory::Trajectory::getDuration ( ) const

The time (in seconds) between the start and end of this trajectory.

Definition at line 122 of file trajectory.cpp.

double hebi::trajectory::Trajectory::getEndTime ( ) const
inline

Get the time (in seconds) at which the defined trajectory ends.

Definition at line 110 of file trajectory.hpp.

size_t hebi::trajectory::Trajectory::getJointCount ( ) const
inline

The number of independent position trajectories over the same time domain that are managed by this object.

Definition at line 95 of file trajectory.hpp.

double hebi::trajectory::Trajectory::getStartTime ( ) const
inline

Get the time (in seconds) at which the defined trajectory begins.

Definition at line 105 of file trajectory.hpp.

bool hebi::trajectory::Trajectory::getState ( double  time,
VectorXd *  position,
VectorXd *  velocity,
VectorXd *  acceleration 
) const

Returns the position, velocity, and acceleration for a given point in time along the trajectory.

Parameters
timeThe time for which the trajectory state is being queried. This should be between the start and end of the trajectory.
positionIf not nullptr, this vector is filled in with the position along the trajectory for each joint at the given time.
velocityIf not nullptr, this vector is filled in with the velocity along the trajectory for each joint at the given time.
accelerationIf not nullptr, this vector is filled in with the acceleration along the trajectory for each joint at the given time.

Definition at line 128 of file trajectory.cpp.

size_t hebi::trajectory::Trajectory::getWaypointCount ( ) const
inline

The number of fixed waypoints that each joint is moving through.

Definition at line 100 of file trajectory.hpp.

Member Data Documentation

const double hebi::trajectory::Trajectory::end_time_
private

The time at which the trajectory ends (seconds).

Definition at line 43 of file trajectory.hpp.

const size_t hebi::trajectory::Trajectory::number_of_joints_
private

The number of modules controlled by this trajectory.

Definition at line 28 of file trajectory.hpp.

const size_t hebi::trajectory::Trajectory::number_of_waypoints_
private

The number of waypoints in this trajectory.

Definition at line 33 of file trajectory.hpp.

const double hebi::trajectory::Trajectory::start_time_
private

The time at which the trajectory starts (seconds).

Definition at line 38 of file trajectory.hpp.

std::vector<HebiTrajectoryPtr> hebi::trajectory::Trajectory::trajectories_
private

C-style trajectory objects (one for each module)

Definition at line 23 of file trajectory.hpp.


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


hebiros
Author(s): Xavier Artache , Matthew Tesch
autogenerated on Thu Sep 3 2020 04:11:00