chrono::parsers::ChParserVehicleYAML Class Reference

Description

Parser for YAML specification file for Chrono::Vehicle models.

Supports both wheeled and tracked vehicles (defined through JSON specification files).

#include <ChParserVehicleYAML.h>

Inheritance diagram for chrono::parsers::ChParserVehicleYAML:
Collaboration diagram for chrono::parsers::ChParserVehicleYAML:

Public Types

enum  VehicleType { WHEELED, TRACKED }
 
- Public Types inherited from chrono::parsers::ChParserYAML
enum  YamlFileType {
  MBS, SPH, TDPF, FSI,
  VEHICLE, CUSTOM
}
 Type of a Chrono YAML specification file, as declared by its type key. More...
 

Public Member Functions

 ChParserVehicleYAML (const std::string &yaml_filename, bool verbose=false)
 
bool HasModelData () const
 Return true if a YAML model file has been loaded.
 
virtual void LoadFile (const std::string &yaml_filename) override
 Load the specified MBS simulation input YAML file.
 
virtual void LoadModelData (const YAML::Node &yaml) override
 Load the vehicle model from the specified YAML node.
 
void CreateVehicle (ChSystem &sys)
 Populate the given system with the cached Chrono::Vehicle model.
 
VehicleType GetVehicleType () const
 Get vehicle type (from specified vehicleJSON file).
 
std::string GetVehicleTypeAsString () const
 Get vehicle type as a string.
 
std::shared_ptr< vehicle::ChVehicle > GetVehicle () const
 Return the underlying vehicle model.
 
std::shared_ptr< vehicle::RigidTerrain > GetTerrain () const
 Return the underlying rigid terrain (may be null).
 
const ChVector3d & GetChassisPoint () const
 
double GetChaseDistance () const
 
double GetChaseHeight () const
 
- Public Member Functions inherited from chrono::parsers::ChParserMbsYAML
 ChParserMbsYAML (bool verbose=false)
 
 ChParserMbsYAML (const std::string &yaml_filename, bool verbose=false)
 
bool HasSolverData () const
 Return true if a YAML solver file has been loaded.
 
bool HasModelData () const
 Return true if a YAML model file has been loaded.
 
virtual void LoadSimData (const YAML::Node &yaml) override
 Load the simulation, output, and visualization settings from the specified YAML node.
 
virtual void LoadSolverData (const YAML::Node &yaml)
 Load the solver parameters from the specified YAML node.
 
std::shared_ptr< ChSystem > CreateSystem ()
 Create and return a Chrono system configured from cached simulation parameters. More...
 
void SetSimulationParameters (ChSystem &sys)
 Set solver and integrator settings from cached values. More...
 
double GetTimestep () const
 
double GetEndtime () const
 
bool EnforceRealtime () const
 
int Populate (ChSystem &sys, const ChFramed &model_frame=ChFramed(), const std::string &model_prefix="")
 Populate the given system with the cached Chrono components. More...
 
void Depopulate (ChSystem &sys, int instance_index)
 Remove from the specified system the Chrono objects from the specified instance.
 
int GetNumInstances () const
 Return the number of instances created from the YAML model file.
 
std::shared_ptr< ChBodyAuxRef > FindBodyByName (const std::string &name) const
 Find and return the body with specified name, in the current model instance.
 
std::shared_ptr< ChBodyAuxRef > FindBodyByName (const std::string &name, int model_instance) const
 Find and return the body with specified name, in the given model instance.
 
std::vector< std::shared_ptr< ChBodyAuxRef > > FindBodiesByName (const std::string &name) const
 Find and return bodies with given base name from all model instances.
 
std::shared_ptr< ChLinkMotor > FindMotorByName (const std::string &name) const
 Find and return the motor with specified name, in the current model instance.
 
std::shared_ptr< ChLinkMotor > FindMotorByName (const std::string &name, int model_instance) const
 Find and return the motor with specified name, in the given model instance.
 
std::vector< std::shared_ptr< ChLinkMotor > > FindMotorsByName (const std::string &name) const
 Find and return motors with given base name from all model instances.
 
void AttachLoadController (std::shared_ptr< ChLoadController > controller, const std::string &name, int model_instance)
 Attach the external controller for the load controller with given name. More...
 
void AttachMotorController (std::shared_ptr< ChMotorController > controller, const std::string &name, int model_instance)
 Attach the external controller for the motor controller with given name. More...
 
void DoStepDynamics ()
 Advance dynamics of the multibody system. More...
 
void ApplyLoadControllerLoads (const LoadControllerLoads &controller_loads)
 Apply loads generated by the load controllers in the given list. More...
 
void ApplyMotorControllerActuations (const MotorControllerActuations &controller_loads)
 Apply actuations generated by the motor controllers in the given list. More...
 
virtual void WriteOutput (int frame, double time) override
 Write simulation output results at the current time.
 
- Public Member Functions inherited from chrono::parsers::ChParserYAML
void SetVerbose (bool verbose)
 Set verbose terminal output (default: false).
 
virtual void SetOutputDir (const std::string &out_dir)
 Set root output directory (default: "."). More...
 
const std::string & GetName () const
 Return the name of the YAML model.
 
virtual bool OutputEnabled () const
 Return true if generating output.
 
const ChOutput::Settings & GetOutputSettings () const
 Return all output settings.
 
ChOutput::Format GetOutputFormat () const
 Return the output type.
 
ChOutput::Mode GetOutputMode () const
 Return the output mode.
 
virtual double GetOutputFPS () const
 Return the output frequency.
 
virtual bool VisualizationEnabled () const
 Return true if visualization is enabled.
 
const ChVisualSystem::Settings & GetVisualizationSettings () const
 Return all visualization settings.
 
double GetRenderFPS () const
 
CameraVerticalDir GetCameraVerticalDir () const
 
const ChVector3d & GetCameraLocation () const
 
const ChVector3d & GetCameraTarget () const
 
bool EnableShadows () const
 
bool WriteImages () const
 
const std::string & GetImageDir () const
 
virtual void Output (double time)
 Generate output at the current frame. More...
 
virtual bool Render (ChVisualSystem &vis, double time)
 Render the current frame using the specified visual system if run-time visualization is available and enabled. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from chrono::parsers::ChParserYAML
static YamlFileType ReadYamlFileType (const std::string &yaml_filename)
 Peek in the specified YAML file and read the declared file type. More...
 
- Static Protected Member Functions inherited from chrono::parsers::ChParserYAML
static YamlFileType ReadYamlFileType (const YAML::Node &a)
 Read the YAML file type from the given node. More...
 
- Protected Attributes inherited from chrono::parsers::ChParserYAML
std::string m_name
 name of the YAML model
 
bool m_verbose
 verbose terminal output (default: false)
 
bool m_use_degrees
 all angles given in degrees (default: true)
 
ChVisualSystem::Settings m_vis_settings
 visualization settings
 
ChOutput::Settings m_output_settings
 output settings
 
std::string m_output_dir
 root output directory
 
std::shared_ptr< ChOutput > m_output_db
 output database
 
ChYamlFileHandler m_file_handler
 handler for data file paths
 

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