A Chrono YAML MBS simulation file defines the setup for a Chrono multibody simulation. It consists of the following main objects:
- [required] The Chrono version (
chrono-version) that is compatible with the YAML model specification. This is a string of the formM.m(major.minor) orM.m.p(major-minor-patch), although only the two fields are verified for compatibility. - [required] The simulation
type, which must beMBShere. - [required] The MBS
modelobject which defines YAML specification of multibody problem. - [required] The MBS
solverobject which defines YAML specification of the solver algorithms. - [optional] The
simulationobject specifying how simulation is to be performed. - [optional] The
outputobject which specifies output options from the MBS simulation. - [optional] The
visualizationobject which specifies run-time visualization settings.
MBS simulation specification
An MBS simulation must specify the multibody model to be simulated, integrator and solver settings, as well as optional output and run-time visualization settings.
Model and solver specification
The model entry (required) must specify the path (relative to the location of this YAML simulation specification file) to the YAML file with an MBS model specification (which must follow the MBS model schema).
The solver entry (required) must specify the path (relative to the location of this YAML simulation specification file) to the YAML file with an MBS solver specification (which must follow the MBS solver schema).
Simulation options
| Property | Description | Type | Available Values | Required | Default |
|---|---|---|---|---|---|
enforce_realtime | Whether to enforce real-time simulation | boolean | – | No | false |
end_time | Total simulation time in seconds | double | – | No | -1 for infinite simulation |
gravity | Gravitational acceleration vector [x, y, z] | array[3] | – | No | [0, 0, -9.8] |
num_threads | Number of threads used by the parallel components | object | – | No | – |
The num_threads key, if present, specifies the following properties:
| Property | Description | Type | Available Values | Required | Default |
|---|---|---|---|---|---|
chrono | Number of threads used by Chrono | integer | – | No | 1 |
collision | Number of threads used by the collision detection system | integer | – | No | 1 |
eigen | Number of threads used by Eigen | integer | – | No | 1 |
pardiso | Number of threads used by the PARDISO solver | integer | – | No | 1 |
The pardiso entry is used only when the solver file selects the PARDISO solver type.
Output options
If the output key is present, it must specify a YAML object with the following properties:
| Property | Description | Type | Available Values | Required | Default |
|---|---|---|---|---|---|
format | Output DB format | enum | NONE,ASCII,HDF5 | Yes | – |
mode | Output mode (one file per output frame, or a single time-series file) | enum | FRAMES,SERIES | No | FRAMES |
fps | Output frequency (FPS or Hz) | double | – | No | 100 |
Note that format is required whenever the output key is present. HDF5 output silently falls back to NONE in a build without HDF5 support.
FEA mesh nodes are included in output only if selected in the model specification file (see the output_nodes property of FEA beams). Each selected node is identified by the mesh (beam) name and its node index:
ASCIIoutput: oneFEA nodeentry per node, with its position and velocity, orientation and angular velocity (nodes with rotational coordinates), or slope (nodes with slope coordinates).HDF5output,FRAMESmode: one data setFEA Mesh <name>per mesh and output frame, with one record per selected node (fields not applicable to a node type are set to NaN).HDF5output,SERIESmode: one group/FEA_Nodes/<name>/node_<index>per selected node, with time seriespos,lin_veland, as applicable,rot,ang_vel(nodes with rotational coordinates) orslope.
Visualization options
If the visualization key is present, it must specify a YAML object with the following properties:
| Property | Description | Type | Available Values | Required | Default |
|---|---|---|---|---|---|
type | Type of body visualization shapes | enum | NONE,PRIMITIVES,MODEL_FILE,COLLISION | No | NONE |
render_fps | Rendering frequency (FPS or Hz) | double | – | No | 120 |
enable_shadows | Turn on shadow rendering | boolean | – | No | true |
camera | Camera settings | object | – | No | – |
output | Image output settings | object | – | No | – |
The camera key, if present, specifies the following properties:
| Property | Description | Type | Available Values | Required | Default |
|---|---|---|---|---|---|
vertical | Vertical direction (camera "up") | enum | Y,Z | No | Z |
location | Camera initial location | array[3] | – | No | [0,-1,0] |
target | Camera initial target ("look-at" point) | array[3] | – | No | [0,0,0] |
The output key, if present, specifies the following properties:
| Property | Description | Type | Available Values | Required | Default |
|---|---|---|---|---|---|
save_images | Whether to save rendered frames as image files | boolean | – | No | false |
image_type | Image file type, specified through the file extension | string | – | No | bmp |
Run-time visualization is enabled only if the visualization key is present and specifies a type other than NONE. In other words, omitting the visualization key and specifying type: NONE are equivalent and both result in a simulation run with no run-time visualization.
Example
Below is an example of an MBS simulation configuration:
YAML schema
The YAML MBS simulation specification file must follow the data/yaml/schema/mbs_simulation.schema.yaml provided in the Chrono data directory: