25. OpenPLX for AGX Dynamics¶
OpenPLX is a high-level modeling language designed to work seamlessly with AGX Dynamics. It provides a structured approach to defining physics simulations, allowing users to create and configure rigid bodies, constraints, motors, friction models, and more in a human-readable format.
By leveraging AGX Dynamics, OpenPLX enables the simulation of complex mechanical systems, vehicles, robotics, and deformable terrains with minimal effort.
This page explains how OpenPLX interacts with AGX Dynamics and provides a structured way to define physics simulations. For a complete overview of OpenPLX Syntax and Bundles, consult the OpenPLX Documentation.
25.1. How OpenPLX Works with AGX Dynamics¶
OpenPLX acts as an interface layer for AGX Dynamics, converting structured OpenPLX definitions into AGX simulation components. When you load an OpenPLX file, it is transformed into an AGX Dynamics simulation tree, allowing for efficient physics-based interactions.
This means:
OpenPLX describes the physics setup and the scene.
The AGX Dynamics engine executes the simulation.
Users can interact with the scene through OpenPLX files.
Python controllers interact by sending or receiving OpenPLX signals.
25.2. Simulating an OpenPLX File in AGX Viewer¶
To simulate an .openplx file with AGX Dynamics, pass it to agxViewer like you would with an .agx file:
agxViewer myModel.openplx
25.3. Importing an AGX File in OpenPLX¶
AGX .agx files contain pre-defined physics models. OpenPLX supports seamless integration of AGX models into simulation systems.
The AGX Model describes the basic physics setup, including rigid bodies, constraints, collision geometries and visuals.
OpenPLX imports the AGX model and augments it with additional components, such as tracks and a drivetrain.
OpenPLX describes the complete simulation scene.
Controller scripts (python/C++) connects the OpenPLX model to the desired control systems.
The AGX Dynamics engine executes the simulation.
25.3.1. Syntax for Importing an AGX File¶
To import an .agx file into OpenPLX, use the following OpenPLX syntax:
import @"model.agx" as AGXModel
Scene is Physics3D.System:
my_model is AGXModel
The imported AGX model (AGXModel) can now be referenced within OpenPLX.
To load the OpenPLX scene and view the AGX model, use:
agxViewer scene.openplx -p
25.3.2. Viewing an AGX File as an OpenPLX Model¶
You can open an AGX file to find the components you need to reference using the anytoopenplx command:
python -m agxPythonModules.openplx.anytoopenplx model.agx > model_reference.openplx
Use this file to identify signals and components to reference when augmenting your model with additional OpenPLX components.
Note
At the moment, the models generated OpenPLX file will duplicate the content of the agx file, creating a conflict when running the simulation. To accomodate this, change the file extension of the new .openplx file to .txt, or place it outside the root folder of your OpenPLX bundle.
25.4. OpenPLX Tutorials¶
Explore the OpenPLX Tutorials to get started with OpenPLX for AGX Dynamics.
25.5. AGX Annotations¶
Annotation |
Description |
Type |
---|---|---|
agx_relaxation_time |
Directly set the AGX Dampling. |
Real |
agx_solve_type |
Set the AGX Solve type for a constraint. |
String |
agx_friction_solve_type |
Sets the AGX Solve type for the fricion model. |
String |
agx_approximate_cone_friction |
Enables AGX approximate cone friction. |
Bool |
agx_terrain_material |
Sets an AGX terrain material preset. |
String |
agx_actuator_internal_inertia |
Sets the internal inertia of the input shaft of a agxPowerLine::RotationalActuator
or the internal mass of the input rod of a agxPowerLine::TranslationalActuator. |
Real |
agx_observer_frame |
Maps a |
Bool |
agx_debug_render_frame |
Renders the axes of a |
Bool |
25.6. AGX Track Annotations¶
The following annotations can be applied to a Vehicles.Tracks.System to set AGX internal track properties.
Annotation |
Description |
Type |
---|---|---|
agx_track_node_wheel_overlap |
Real |
|
agx_track_on_initialize_merge_nodes_ |
Bool |
|
agx_track_on_initialize_transform_nodes_ |
Bool |
|
agx_track_hinge_range_lower, agx_track_hinge_range_upper |
Real |
|
agx_track_hinge_compliance |
Real |
|
agx_track_hinge_relaxation_time |
Real |
|
agx_track_stabilizing_friction_parameter |
Real |
|
agx_track_min_stabilizing_normal_force |
Real |
|
agx_track_node_wheel_merge_threshold |
Real |
|
agx_track_node_wheel_split_threshold |
Real |
|
agx_track_num_nodes_in_average_direction |
Int |
|
agx_set_enable_merge |
Bool |
|
agx_set_contact_reduction |
setContactReduction |
String |
agx_set_enable_lock_to_reach_merge_ |
Bool |
|
agx_set_lock_to_reach_merge_condition_ |
Real |
|
agx_set_lock_to_reach_merge_condition_ |
Real |
|
agx_set_num_nodes_per_merge_segment |
Int |
25.7. AGX Plugin Annotations¶
When importing a .agx file there are a few annotations that change the import behavior.
Annotation |
Description |
Type |
---|---|---|
discard_rigid_body_positions |
Discards all position information for rigid bodies if set to |
Bool |
regenerate_shape_uuids |
Setting this to |
Bool |
material_naming_rule |
Controls how imported materials will be named. This can be necessary to avoid collisions since materials are always put in a global scope. |
String |