chrono::industrial::TrajectoryInterpolatorOperationSpace Class Reference

Description

Interpolate a list of 3D waypoints with assigned geometric and time motion functions.

#include <TrajectoryInterpolator.h>

Inherits chrono::industrial::TrajectoryInterpolator.

Public Types

enum  PosfunType { LINE, BSPLINE2, BEZIER }
 Type of geometric position function used to define trajectory.
 
enum  RotfunType { BSPLINE1, BSPLINE2, SQUAD }
 Type of geometric rotation function used to define trajectory.
 
enum  SpacefunType {
  LINEAR, POLY345, CONSTACC, CYCLOIDAL,
  PW_LINEAR, PW_POLY345, PW_CONSTACC, PW_CYCLOIDAL
}
 Type of space function used to evaluate geometric functions. More...
 

Public Member Functions

 TrajectoryInterpolatorOperationSpace ()
 Default constructor.
 
virtual ~TrajectoryInterpolatorOperationSpace ()
 Default destructor.
 
 TrajectoryInterpolatorOperationSpace (const std::vector< ChCoordsysd > &waypoints, double motion_time_tot, PosfunType posfun_type, SpacefunType pos_spacefun_type, RotfunType rotfun_type, SpacefunType rot_spacefun_type, std::vector< double > *durations=nullptr)
 Create a trajectory interpolator from given operation-space waypoints and total motion time. More...
 
void Setup (const std::vector< ChCoordsysd > &waypoints, double motion_time_tot, PosfunType posfun_type, SpacefunType pos_spacefun_type, RotfunType rotfun_type, SpacefunType rot_spacefun_type, std::vector< double > *durations=nullptr)
 Setup interpolator internal data. More...
 
ChCoordsysd GetInterpolation (double time) const
 Get interpolation pose of trajectory, at given time.
 
virtual void SetDurations (const std::vector< double > &durations) override
 Set individual times to travel each part of the trajectory. More...
 
std::shared_ptr< ChFunctionPositionLineGetPositionFunction () const
 Get geometric position function.
 
std::shared_ptr< ChFunctionRotationGetRotationFunction () const
 Get geometric rotation function.
 
std::vector< ChVector3dGetPositions () const
 Get input waypoints positions.
 
std::vector< ChQuaterniondGetRotations () const
 Get input waypoints rotations.
 

Member Enumeration Documentation

◆ SpacefunType

Type of space function used to evaluate geometric functions.

Two categories available:

  • single shot: interpolate whole trajectory with a single function
  • piecewise: interpolate individual trajectory parts with dedicated functions

Constructor & Destructor Documentation

◆ TrajectoryInterpolatorOperationSpace()

chrono::industrial::TrajectoryInterpolatorOperationSpace::TrajectoryInterpolatorOperationSpace ( const std::vector< ChCoordsysd > &  waypoints,
double  motion_time_tot,
PosfunType  posfun_type,
SpacefunType  pos_spacefun_type,
RotfunType  rotfun_type,
SpacefunType  rot_spacefun_type,
std::vector< double > *  durations = nullptr 
)

Create a trajectory interpolator from given operation-space waypoints and total motion time.

Trajectory is defined by given geometric position and rotation functions, which are evaluated in time through provided space functions. Individual times to travel each part of the trajectory

  • can be manually defined by the user: in this case, their sum must equal total motion time parameter
  • can be skipped: in this case, durations are automatically computed as weighted average of total path length
Parameters
waypointsinput trajectory waypoints
motion_time_tottotal time to complete trajectory
posfun_typetype of geometric position function
pos_spacefun_typetype of space function used to evaluate position
rotfun_typetype of geometric rotation function
rot_spacefun_typetype of space function used to evaluate rotation
durationstimes to travel individual trajectory parts; autocompute if empty

Member Function Documentation

◆ SetDurations()

void chrono::industrial::TrajectoryInterpolatorOperationSpace::SetDurations ( const std::vector< double > &  durations)
overridevirtual

Set individual times to travel each part of the trajectory.

NB: needs manual call to Setup() to have effect.

◆ Setup()

void chrono::industrial::TrajectoryInterpolatorOperationSpace::Setup ( const std::vector< ChCoordsysd > &  waypoints,
double  motion_time_tot,
PosfunType  posfun_type,
SpacefunType  pos_spacefun_type,
RotfunType  rotfun_type,
SpacefunType  rot_spacefun_type,
std::vector< double > *  durations = nullptr 
)

Setup interpolator internal data.

NB: must to be manually called after settings are changed.

Parameters
waypointsinput trajectory waypoints
motion_time_tottotal time to complete trajectory
posfun_typetype of geometric position function
pos_spacefun_typetype of space function used to evaluate position
rotfun_typetype of geometric rotation function
rot_spacefun_typetype of space function used to evaluate rotation
durationstimes to travel individual trajectory parts; autocompute if empty

The documentation for this class was generated from the following files:
  • /builds/uwsbel/chrono/src/chrono_models/robot/industrial/TrajectoryInterpolator.h
  • /builds/uwsbel/chrono/src/chrono_models/robot/industrial/TrajectoryInterpolator.cpp