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< ChFunctionPositionLine > | GetPositionFunction () const |
Get geometric position function. | |
std::shared_ptr< ChFunctionRotation > | GetRotationFunction () const |
Get geometric rotation function. | |
std::shared_ptr< ChFunctionSequence > | GetPositionSpaceFunction () const |
Get position evaluation function. | |
std::shared_ptr< ChFunctionSequence > | GetRotationSpaceFunction () const |
Get rotation evaluation function. | |
std::vector< ChVector3d > | GetPositions () const |
Get input waypoints positions. | |
std::vector< ChQuaterniond > | GetRotations () 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
-
waypoints input trajectory waypoints motion_time_tot total time to complete trajectory posfun_type type of geometric position function pos_spacefun_type type of space function used to evaluate position rotfun_type type of geometric rotation function rot_spacefun_type type of space function used to evaluate rotation durations times to travel individual trajectory parts; autocompute if empty
Member Function Documentation
◆ SetDurations()
|
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
-
waypoints input trajectory waypoints motion_time_tot total time to complete trajectory posfun_type type of geometric position function pos_spacefun_type type of space function used to evaluate position rotfun_type type of geometric rotation function rot_spacefun_type type of space function used to evaluate rotation durations times 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