chrono::ChFunctionPosition Class Referenceabstract

Description

Interface base class for scalar->vector functions of the type:

p= f(s)

where p is a 3D vector (ex. a position) and s is a scalar (ex. time) Classes inherited from ChFunctionPosition are often used to set time-dependent positions, for example to set the imposed trajectory of a rigid body in space. Inherited classes must override at least the Get_p() method, in order to represent more complex functions.

#include <ChFunctionPosition.h>

Inheritance diagram for chrono::ChFunctionPosition:

Public Member Functions

 ChFunctionPosition (const ChFunctionPosition &other)
 
virtual ChFunctionPositionClone () const =0
 "Virtual" copy constructor.
 
virtual ChVector Get_p (double s) const =0
 Return the p value of the function, at s, as p=f(s).
 
virtual ChVector Get_p_ds (double s) const
 Return the dp/ds derivative of the function, at s. More...
 
virtual ChVector Get_p_dsds (double s) const
 Return the ddp/dsds double derivative of the function, at s. More...
 
virtual void Estimate_s_domain (double &smin, double &smax) const
 Return an estimate of the domain of the function argument. More...
 
virtual void Estimate_boundingbox (ChVector<> &pmin, ChVector<> &pmax) const
 Return an estimate of the range of the function value. More...
 
virtual void Update (const double t)
 Update could be implemented by children classes, ex. to launch callbacks.
 
virtual void ArchiveOUT (ChArchiveOut &marchive)
 Method to allow serialization of transient data to archives.
 
virtual void ArchiveIN (ChArchiveIn &marchive)
 Method to allow de-serialization of transient data from archives.
 

Member Function Documentation

◆ Estimate_boundingbox()

void chrono::ChFunctionPosition::Estimate_boundingbox ( ChVector<> &  pmin,
ChVector<> &  pmax 
) const
virtual

Return an estimate of the range of the function value.

By default it samples the function N times, but children classes migh implement a more efficient closed form solution. (ex. can be used for automatic zooming in a GUI)

◆ Estimate_s_domain()

virtual void chrono::ChFunctionPosition::Estimate_s_domain ( double &  smin,
double &  smax 
) const
inlinevirtual

Return an estimate of the domain of the function argument.

(ex. can be used for automatic zooming in a GUI, or for computing the bounding box)

Reimplemented in chrono::ChFunctionPosition_XYZfunctions.

◆ Get_p_ds()

virtual ChVector chrono::ChFunctionPosition::Get_p_ds ( double  s) const
inlinevirtual

Return the dp/ds derivative of the function, at s.

Note that inherited classes may also avoid overriding this method, because this base method already provide a general-purpose numerical differentiation to get dp/dt only from the Get_p() function. (however, if the analytical derivative is known, it may better to implement a custom method).

Reimplemented in chrono::ChFunctionPosition_setpoint, chrono::ChFunctionPosition_XYZfunctions, and chrono::ChFunctionPosition_line.

◆ Get_p_dsds()

virtual ChVector chrono::ChFunctionPosition::Get_p_dsds ( double  s) const
inlinevirtual

Return the ddp/dsds double derivative of the function, at s.

Note that inherited classes may also avoid overriding this method, because this base method already provide a general-purpose numerical differentiation to get ddp/dsds only from the Get_p() function. (however, if the analytical derivative is known, it may be better to implement a custom method).

Reimplemented in chrono::ChFunctionPosition_setpoint, chrono::ChFunctionPosition_XYZfunctions, and chrono::ChFunctionPosition_line.


The documentation for this class was generated from the following files:
  • /builds/uwsbel/chrono/src/chrono/motion_functions/ChFunctionPosition.h
  • /builds/uwsbel/chrono/src/chrono/motion_functions/ChFunctionPosition.cpp