chrono::vehicle::CRGTerrain Class Reference

Description

Concrete class for a (rigid) road loaded from an OpenCRG file.

This type of terrain can be used in conjunction with tire models that perform their own collision detection (e.g. ChPacejkaTire, ChFiala, and ChLugreTire).

#include <CRGTerrain.h>

Inheritance diagram for chrono::vehicle::CRGTerrain:
Collaboration diagram for chrono::vehicle::CRGTerrain:

Public Member Functions

 CRGTerrain (ChSystem *system)
 Construct a default CRGTerrain. More...
 
void UseMeshVisualization (bool val)
 Set the road visualization mode (mesh or boundary lines). More...
 
void SetContactFrictionCoefficient (float friction_coefficient)
 Set coefficient of friction. More...
 
void Initialize (const std::string &crg_file)
 Initialize the CRGTerrain from the specified OpenCRG file. More...
 
virtual double GetHeight (double x, double y) const override
 Get the terrain height at the specified (x,y) location. More...
 
virtual ChVector GetNormal (double x, double y) const override
 Get the terrain normal at the specified (x,y) location. More...
 
virtual float GetCoefficientFriction (double x, double y) const override
 Get the terrain coefficient of friction at the specified (x,y) location. More...
 
std::shared_ptr< ChBezierCurveGetPath ()
 Get the vehicle path as ChBezierCurve. More...
 
std::shared_ptr< geometry::ChTriangleMeshConnectedGetMesh () const
 Get the road mesh.
 
bool IsPathClosed ()
 Is the road a round course (closed loop)?
 
double GetLength ()
 Get length of the road.
 
void ExportMeshWavefront (const std::string &out_dir)
 Export road mesh to Wavefront file.
 
void ExportMeshPovray (const std::string &out_dir)
 Export the patch mesh as a macro in a PovRay include file.
 
- Public Member Functions inherited from chrono::vehicle::ChTerrain
virtual void Synchronize (double time)
 Update the state of the terrain system at the specified time.
 
virtual void Advance (double step)
 Advance the state of the terrain system by the specified duration.
 
void RegisterFrictionFunctor (FrictionFunctor *functor)
 Specify the functor object to provide the coefficient of friction at given (x,y) locations.
 

Additional Inherited Members

- Protected Attributes inherited from chrono::vehicle::ChTerrain
FrictionFunctorm_friction_fun
 functor for location-dependent coefficient of friction
 

Constructor & Destructor Documentation

chrono::vehicle::CRGTerrain::CRGTerrain ( ChSystem system)

Construct a default CRGTerrain.

The user should call optional Set methods and then Initialize.

Parameters
[in]systempointer to the containing multibody system

Member Function Documentation

float chrono::vehicle::CRGTerrain::GetCoefficientFriction ( double  x,
double  y 
) const
overridevirtual

Get the terrain coefficient of friction at the specified (x,y) location.

This coefficient of friction value may be used by certain tire models to modify the tire characteristics, but it will have no effect on the interaction of the terrain with other objects (including tire models that do not explicitly use it). For CRGTerrain, this function defers to the user-provided functor object of type ChTerrain::FrictionFunctor, if one was specified. Otherwise, it returns the constant value specified at construction.

Implements chrono::vehicle::ChTerrain.

double chrono::vehicle::CRGTerrain::GetHeight ( double  x,
double  y 
) const
overridevirtual

Get the terrain height at the specified (x,y) location.

Returns the constant value passed at construction.

Implements chrono::vehicle::ChTerrain.

ChVector chrono::vehicle::CRGTerrain::GetNormal ( double  x,
double  y 
) const
overridevirtual

Get the terrain normal at the specified (x,y) location.

Returns a constant unit vector along the Z axis.

Implements chrono::vehicle::ChTerrain.

std::shared_ptr< ChBezierCurve > chrono::vehicle::CRGTerrain::GetPath ( )

Get the vehicle path as ChBezierCurve.

This function returns a path along the road's midline.

void chrono::vehicle::CRGTerrain::Initialize ( const std::string &  crg_file)

Initialize the CRGTerrain from the specified OpenCRG file.

Parameters
[in]crg_fileOpenCRG road specification file
void chrono::vehicle::CRGTerrain::SetContactFrictionCoefficient ( float  friction_coefficient)

Set coefficient of friction.

The default value is 0.8

void chrono::vehicle::CRGTerrain::UseMeshVisualization ( bool  val)

Set the road visualization mode (mesh or boundary lines).

Default: mesh.