chrono::vehicle::DeformableTerrain Class Reference

Description

Deformable terrain model.

This class implements a terrain with variable heightmap. Unlike RigidTerrain, the vertical coordinates of this terrain mesh can be deformed because of interaction with ground vehicles.

#include <DeformableTerrain.h>

Inheritance diagram for chrono::vehicle::DeformableTerrain:
Collaboration diagram for chrono::vehicle::DeformableTerrain:

Public Types

enum  DataPlotType {
  PLOT_NONE, PLOT_LEVEL, PLOT_LEVEL_INITIAL, PLOT_SINKAGE,
  PLOT_SINKAGE_ELASTIC, PLOT_SINKAGE_PLASTIC, PLOT_STEP_PLASTIC_FLOW, PLOT_PRESSURE,
  PLOT_PRESSURE_YELD, PLOT_SHEAR, PLOT_K_JANOSI, PLOT_IS_TOUCHED,
  PLOT_ISLAND_ID, PLOT_MASSREMAINDER
}
 

Public Member Functions

 DeformableTerrain (ChSystem *system)
 Construct a default DeformableSoil. More...
 
virtual double GetHeight (double x, double y) const override
 Get the terrain height at the specified (x,y) location.
 
virtual chrono::ChVector GetNormal (double x, double y) const override
 Get the terrain normal at the specified (x,y) location.
 
void SetColor (ChColor color)
 Set visualization color. More...
 
void SetTexture (const std::string tex_file, float tex_scale_x=1, float tex_scale_y=1)
 Set texture properties. More...
 
void SetPlane (ChCoordsys<> mplane)
 Set the plane reference. More...
 
const ChCoordsysGetPlane () const
 Get the plane reference. More...
 
const std::shared_ptr
< ChTriangleMeshShape
GetMesh () const
 Get the mesh. More...
 
void SetSoilParametersSCM (double mBekker_Kphi, double mBekker_Kc, double mBekker_n, double mMohr_cohesion, double mMohr_friction, double mJanosi_shear, double melastic_K, double mdamping_R)
 Set the properties of the SCM soild model. More...
 
void SetBulldozingFlow (bool mb)
 If true, enable the creation of soil inflation at the side of the ruts, like bulldozing the material apart. More...
 
bool GetBulldozingFlow () const
 
void SetBulldozingParameters (double mbulldozing_erosion_angle, double mbulldozing_flow_factor=1.0, int mbulldozing_erosion_n_iterations=3, int mbulldozing_erosion_n_propagations=10)
 If true, enable the creation of soil inflation at the side of the ruts, like bulldozing the material apart. More...
 
void SetAutomaticRefinement (bool mr)
 If true, enable the dynamic refinement of mesh LOD, so that additional points are added under the contact patch, up to reach the desired resolution. More...
 
bool GetAutomaticRefinement () const
 
void SetAutomaticRefinementResolution (double mr)
 Additional points are added under the contact patch, up to reach the desired resolution. More...
 
double GetAutomaticRefinementResolution () const
 
void SetTestHighOffset (double moff)
 This value says up to which vertical level the collision is tested - respect to current ground level at the sample point. More...
 
double GetTestHighOffset () const
 
void SetPlotType (DataPlotType mplot, double mmin, double mmax)
 Set the color plot type for the soil mesh. More...
 
void Initialize (double height, double sizeX, double sizeY, int divX, int divY)
 Initialize the terrain system (flat). More...
 
void Initialize (const std::string &mesh_file)
 Initialize the terrain system (mesh). More...
 
void Initialize (const std::string &heightmap_file, const std::string &mesh_name, double sizeX, double sizeY, double hMin, double hMax)
 Initialize the terrain system (height map). 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.
 

Constructor & Destructor Documentation

chrono::vehicle::DeformableTerrain::DeformableTerrain ( ChSystem system)

Construct a default DeformableSoil.

The user is responsible for calling various Set methods before Initialize.

Parameters
[in]systempointer to the containing multibody system

Member Function Documentation

const std::shared_ptr< ChTriangleMeshShape > chrono::vehicle::DeformableTerrain::GetMesh ( ) const

Get the mesh.

The soil mesh is defined by a trimesh.

const ChCoordsys & chrono::vehicle::DeformableTerrain::GetPlane ( ) const

Get the plane reference.

The soil height is on the Y axis of this plane, and X-Z axes of the coordsys are the longitude-latitude.

void chrono::vehicle::DeformableTerrain::Initialize ( double  height,
double  sizeX,
double  sizeY,
int  divX,
int  divY 
)

Initialize the terrain system (flat).

This version creates a flat array of points.

Parameters
[in]heightterrain height
[in]sizeXterrain dimension in the X direction
[in]sizeYterrain dimension in the Y direction
[in]divXnumber of divisions in the X direction
[in]divYnumber of divisions in the Y direction
void chrono::vehicle::DeformableTerrain::Initialize ( const std::string &  mesh_file)

Initialize the terrain system (mesh).

The initial undeformed mesh is provided via a Wavefront .obj file.

Parameters
[in]mesh_filefilename of the input mesh (.OBJ file in Wavefront format)
void chrono::vehicle::DeformableTerrain::Initialize ( const std::string &  heightmap_file,
const std::string &  mesh_name,
double  sizeX,
double  sizeY,
double  hMin,
double  hMax 
)

Initialize the terrain system (height map).

The initial undeformed mesh is provided via the specified BMP file as a height map

Parameters
[in]heightmap_filefilename for the height map (BMP)
[in]mesh_namename of the mesh asset
[in]sizeXterrain dimension in the X direction
[in]sizeYterrain dimension in the Y direction
[in]hMinminimum height (black level)
[in]hMaxmaximum height (white level)
void chrono::vehicle::DeformableTerrain::SetAutomaticRefinement ( bool  mr)

If true, enable the dynamic refinement of mesh LOD, so that additional points are added under the contact patch, up to reach the desired resolution.

void chrono::vehicle::DeformableTerrain::SetAutomaticRefinementResolution ( double  mr)

Additional points are added under the contact patch, up to reach the desired resolution.

Using smaller resolution value (in meters) means that triangles in the mesh are subdivided up to when the largest side is equal or less than the resolution. Triangles out of the contact patch are not refined. Note, you must turn on automatic refinement via SetAutomaticRefinement(true)!

void chrono::vehicle::DeformableTerrain::SetBulldozingFlow ( bool  mb)

If true, enable the creation of soil inflation at the side of the ruts, like bulldozing the material apart.

void chrono::vehicle::DeformableTerrain::SetBulldozingParameters ( double  mbulldozing_erosion_angle,
double  mbulldozing_flow_factor = 1.0,
int  mbulldozing_erosion_n_iterations = 3,
int  mbulldozing_erosion_n_propagations = 10 
)

If true, enable the creation of soil inflation at the side of the ruts, like bulldozing the material apart.

Remember to enable SetBulldozingFlow(true).

Parameters
mbulldozing_erosion_angleangle of erosion of the displaced material (in degrees!)
mbulldozing_flow_factorgrowth of lateral volume respect to pressed volume
mbulldozing_erosion_n_iterationsnumber of erosion refinements per timestep
mbulldozing_erosion_n_propagationsnumber of concentric vertex selections subject to erosion
void chrono::vehicle::DeformableTerrain::SetColor ( ChColor  color)

Set visualization color.

Parameters
[in]colorcolor of the visualization material
void chrono::vehicle::DeformableTerrain::SetPlane ( ChCoordsys<>  mplane)

Set the plane reference.

The soil height is on the Y axis of this plane, and X-Z axes of the coordsys are the longitude-latitude. To set as Z up, do SetPlane(ChCoordys(VNULL, Q_from_AngAxis(VECT_X,-CH_C_PI_2)));

void chrono::vehicle::DeformableTerrain::SetPlotType ( DataPlotType  mplot,
double  mmin,
double  mmax 
)

Set the color plot type for the soil mesh.

Also, when a scalar plot is used, also define which is the max-min range in the falsecolor colormap.

void chrono::vehicle::DeformableTerrain::SetSoilParametersSCM ( double  mBekker_Kphi,
double  mBekker_Kc,
double  mBekker_n,
double  mMohr_cohesion,
double  mMohr_friction,
double  mJanosi_shear,
double  melastic_K,
double  mdamping_R 
)

Set the properties of the SCM soild model.

The meaning of these parameters is described in the paper:

Parameters
mBekker_KphiKphi, frictional modulus in Bekker model
mBekker_KcKc, cohesive modulus in Bekker model
mBekker_nn, exponent of sinkage in Bekker model (usually 0.6...1.8)
mMohr_cohesionCohesion in, Pa, for shear failure
mMohr_frictionFriction angle (in degrees!), for shear failure
mJanosi_shearJ , shear parameter, in meters, in Janosi-Hanamoto formula (usually few mm or cm)
melastic_Kelastic stiffness K, per unit area, [Pa/m] (must be > Kphi; very high values gives the original SCM model)
mdamping_Rvertical damping R, per unit area [Pa s/m] (proportional to vertical negative speed, it is zero in original SCM model)
void chrono::vehicle::DeformableTerrain::SetTestHighOffset ( double  moff)

This value says up to which vertical level the collision is tested - respect to current ground level at the sample point.

Since the contact is unilateral, this could be zero. However when computing bulldozing flow, if enabled, one might also need to know if in the surrounding there is some potential future contact: so it might be better to use a positive value (but not higher than the max. expected height of the bulldozed rubble, to avoid slowdown of collision tests).

void chrono::vehicle::DeformableTerrain::SetTexture ( const std::string  tex_file,
float  tex_scale_x = 1,
float  tex_scale_y = 1 
)

Set texture properties.

Parameters
[in]tex_filetexture filename
[in]tex_scale_xtexture scale in X
[in]tex_scale_ytexture scale in Y