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< ChBezierCurveGetRoadCenterLine ()
 Get the road center line as a Bezier curve.
 
std::shared_ptr< ChBezierCurveGetRoadBoundaryLeft () const
 Get the road left boundary as a Bezier curve.
 
std::shared_ptr< ChBezierCurveGetRoadBoundaryRight () const
 Get the road right boundary as a Bezier curve.
 
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.
 
double GetWidth ()
 Get width 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 POV-Ray include file.
 
void ExportCurvesPovray (const std::string &out_dir)
 Export the road boundary curves as a macro in a POV-Ray include file. More...
 
- 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

◆ CRGTerrain()

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

◆ ExportCurvesPovray()

void chrono::vehicle::CRGTerrain::ExportCurvesPovray ( const std::string &  out_dir)

Export the road boundary curves as a macro in a POV-Ray include file.

This function does nothing if using mesh visualization for the road.

◆ GetCoefficientFriction()

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.

◆ GetHeight()

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.

◆ GetNormal()

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.

◆ Initialize()

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

◆ SetContactFrictionCoefficient()

void chrono::vehicle::CRGTerrain::SetContactFrictionCoefficient ( float  friction_coefficient)
inline

Set coefficient of friction.

The default value is 0.8

◆ UseMeshVisualization()

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

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

Default: mesh.


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