Description
OpenSim input file parser.
#include <ChParserOpenSim.h>
Classes | |
class | Report |
Report containing information about objects parsed from file. More... | |
Public Types | |
enum | VisType { PRIMITIVES, MESH, NONE } |
Public Member Functions | |
void | SetContactFrictionCoefficient (float friction_coefficient) |
Set coefficient of friction. More... | |
void | SetContactRestitutionCoefficient (float restitution_coefficient) |
Set coefficient of restitution. More... | |
void | SetContactMaterialProperties (float young_modulus, float poisson_ratio) |
Set contact material properties. More... | |
void | SetContactMaterialCoefficients (float kn, float gn, float kt, float gt) |
Set contact material coefficients. More... | |
void | EnableCollision (bool val) |
Enable collision between bodies in this model (default: false). | |
void | SetCollisionFamilies (int family_1=1, int family_2=2) |
Set collision families (to disable collision between a body and its parent). More... | |
void | SetVisualizationType (VisType val) |
Set body visualization type (default: NONE). | |
void | SetVerbose (bool val) |
Enable/disable verbose parsing output (default: false). | |
void | ActivateActuators (bool val) |
Activate actuators. More... | |
void | Parse (ChSystem &system, const std::string &filename) |
Parse the specified OpenSim input file and create the model in the given system. More... | |
ChSystem * | Parse (const std::string &filename, ChContactMethod contact_method=ChContactMethod::NSC) |
Parse the specified OpenSim input file and create the model in a new system. More... | |
const Report & | GetReport () const |
Get the report for this parser. More... | |
void | PrintReport () const |
Print the parser's report. | |
void | SetExcitationFunction (const std::string &name, std::shared_ptr< ChFunction > modulation) |
Set excitation function for the actuator with the specified name. More... | |
Member Function Documentation
◆ ActivateActuators()
|
inline |
Activate actuators.
By default, any actuator read in from the osim file is inactive (zero excitation). If enabled, all actuators will receive a constant excitation function with value 1. The excitation function for an actuator can be specified, after parsing, using SetExcitationFunction().
◆ GetReport()
|
inline |
Get the report for this parser.
This contains the lists of bodies, joints, and forces that were created from the input osim file.
◆ Parse() [1/2]
void chrono::parsers::ChParserOpenSim::Parse | ( | ChSystem & | system, |
const std::string & | filename | ||
) |
Parse the specified OpenSim input file and create the model in the given system.
- Parameters
-
[in] system containing Chrono system [in] filename OpenSim input file name
◆ Parse() [2/2]
ChSystem * chrono::parsers::ChParserOpenSim::Parse | ( | const std::string & | filename, |
ChContactMethod | contact_method = ChContactMethod::NSC |
||
) |
Parse the specified OpenSim input file and create the model in a new system.
Note that the created system is not deleted in the parser's destructor; rather, ownership is transferred to the caller.
- Parameters
-
[in] filename OpenSim input file name [in] contact_method contact method
◆ SetCollisionFamilies()
void chrono::parsers::ChParserOpenSim::SetCollisionFamilies | ( | int | family_1 = 1 , |
int | family_2 = 2 |
||
) |
Set collision families (to disable collision between a body and its parent).
Note: automaticaly enables collision.
- Parameters
-
[in] family_1 first collision family [in] family_2 second collision family
◆ SetContactFrictionCoefficient()
|
inline |
Set coefficient of friction.
The default value is 0.6
◆ SetContactMaterialCoefficients()
void chrono::parsers::ChParserOpenSim::SetContactMaterialCoefficients | ( | float | kn, |
float | gn, | ||
float | kt, | ||
float | gt | ||
) |
Set contact material coefficients.
These values are used directly to compute contact forces (if the containing system is so configured and if the SMC contact method is being used). The default values are: kn=2e5, gn=40, kt=2e5, gt=20
- Parameters
-
[in] kn normal contact stiffness [in] gn normal contact damping [in] kt tangential contact stiffness [in] gt tangential contact damping
◆ SetContactMaterialProperties()
void chrono::parsers::ChParserOpenSim::SetContactMaterialProperties | ( | float | young_modulus, |
float | poisson_ratio | ||
) |
Set contact material properties.
These values are used to calculate contact material coefficients (if the containing system is so configured and if the SMC contact method is being used). The default values are: Y = 2e5 and nu = 0.3
- Parameters
-
[in] young_modulus Young's modulus of elasticity [in] poisson_ratio Poisson ratio
◆ SetContactRestitutionCoefficient()
|
inline |
Set coefficient of restitution.
The default value is 0.4
◆ SetExcitationFunction()
void chrono::parsers::ChParserOpenSim::SetExcitationFunction | ( | const std::string & | name, |
std::shared_ptr< ChFunction > | modulation | ||
) |
Set excitation function for the actuator with the specified name.
This method should be invoked only after parsing an osim file.
The documentation for this class was generated from the following files:
- /builds/uwsbel/chrono/src/chrono_parsers/ChParserOpenSim.h
- /builds/uwsbel/chrono/src/chrono_parsers/ChParserOpenSim.cpp