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 EnableVerbose (bool val)
 Enable verbose messages from CRG (default : false).
 
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 (const ChVector<> &loc) const override
 Get the terrain height below the specified location.
 
virtual ChVector GetNormal (const ChVector<> &loc) const override
 Get the terrain normal at the point below the specified location.
 
virtual float GetCoefficientFriction (const ChVector<> &loc) const override
 Get the terrain coefficient of friction at the point below the specified 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.
 
double GetStartHeading ()
 Get start heading (in radians), can be different from zero for georeferenced roads.
 
ChCoordsys GetStartPosition ()
 Get the start position (location and orientation). More...
 
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 ( const ChVector<> &  loc) const
overridevirtual

Get the terrain coefficient of friction at the point below the specified 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.

Reimplemented from chrono::vehicle::ChTerrain.

◆ GetStartPosition()

ChCoordsys chrono::vehicle::CRGTerrain::GetStartPosition ( )

Get the start position (location and orientation).

This is the (x,y,z) road location at CRG parameters u=v=0.

◆ 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