chrono::ChBezierCurveTracker Class Reference

Description

Definition of a tracker on a ChBezierCurve path.

This utility class implements a tracker for a given path. It uses time coherence in order to provide an appropriate initial guess for the iterative (Newton) root finder.

#include <ChBezierCurve.h>

Public Member Functions

 ChBezierCurveTracker (std::shared_ptr< ChBezierCurve > path, bool isClosedPath=false)
 Create a tracker associated with the specified Bezier curve.
 
 ~ChBezierCurveTracker ()
 Destructor for ChBezierCurveTracker.
 
void reset (const ChVector<> &loc)
 Reset the tracker at the specified location. More...
 
int calcClosestPoint (const ChVector<> &loc, ChVector<> &point)
 Calculate the closest point on the underlying curve to the specified location. More...
 
int calcClosestPoint (const ChVector<> &loc, ChFrame<> &tnb, double &curvature)
 Calculate the closest point on the underlying curve to the specified location. More...
 
void setIsClosedPath (bool isClosedPath)
 Set if the path is treated as an open loop or a closed loop for tracking.
 

Member Function Documentation

◆ calcClosestPoint() [1/2]

int chrono::ChBezierCurveTracker::calcClosestPoint ( const ChVector<> &  loc,
ChFrame<> &  tnb,
double &  curvature 
)

Calculate the closest point on the underlying curve to the specified location.

Return the TNB (tangent-normal-binormal) frame and the curvature at the closest point. The ChFrame 'tnb' has X axis along the tangent, Y axis along the normal, and Z axis along the binormal. The frame location is the closest point on the Bezier curve. Note that the normal and binormal are not defined at points with zero curvature. In such cases, we return an orthonormal frame with X axis along the tangent.

◆ calcClosestPoint() [2/2]

int chrono::ChBezierCurveTracker::calcClosestPoint ( const ChVector<> &  loc,
ChVector<> &  point 
)

Calculate the closest point on the underlying curve to the specified location.

This function returns the closest point on the underlying path to the specified location. The return value is -1 if this point coincides with the first point of the path, +1 if it coincides with the last point of the path, and 0 otherwise. Note that, in order to provide a reasonable initial guess for the Newton iteration, we use time coherence (by keeping track of the path interval and curve parameter within that interval from the last query). As such, this function should be called with a continuous sequence of locations.

◆ reset()

void chrono::ChBezierCurveTracker::reset ( const ChVector<> &  loc)

Reset the tracker at the specified location.

This function reinitializes the pathTracker at the specified location. It calculates an appropriate initial guess for the curve segment and sets the curve parameter to 0.5.


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