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.
Note
OpenPLX is a work in progress. This draft version will evolve with user feedback and experience. We welcome your input and collaboration.
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.
Note
This version of AGX (2.41.0.0) is built with OpenPLX version 0.20.1. OpenPLX release log.
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 Track Wheel Annotations
The following annotations can be applied to a Vehicles.Tracks.RoadWheel to set AGX Track Wheel properties.
Annotation |
Description |
Type |
|---|---|---|
agx_track_wheel_split_segments |
Bool |
25.8. 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 |
ignore_disabled_secondary_constraints |
Secondary constraints that are disabled are not imported if this is set to |
Bool |
26. OpenPLX → AGX: Mapping Guide
26.1. Scope
A guide showing how each OpenPLX types and attributes end up in AGX.
26.2. Core object / ID / transform mapping
OpenPLX |
AGX |
Notes |
|---|---|---|
|
|
The name of an object in AGX is generally the full OpenPLX name including all namespaces with dot separation. |
|
|
A .uuid: annotation in an OpenPLX object mapped to AGX will enforce that to the created AGX object. If no annotation exist AGX will generate a new uuid. |
|
|
|
|
|
The OpenPLX system tree maps to an assembly tree in AGX. Systems include bodies and geometries. Bodies include geometries. |
|
|
Pose computed from main axis/normal/position; observer frames preserved for AGX-imported connectors. |
26.3. Bodies & mass properties
OpenPLX |
AGX |
Notes |
|---|---|---|
|
Kinematics declaration for rigid bodies. Container of velocities and transforms. |
|
|
Inertia declaration for rigid bodies. Contains scalar mass and inertia tensor. |
|
|
|
is_dynamic: True → DYNAMICS; otherwise KINEMATICS. |
|
|
Negative mass → error. Auto-generate if not given. |
|
|
CM rotation applied to tensor; SPD validation. |
|
|
Local transform relative owning system. |
|
|
Local CM transform relative the local transform. In AGX the rotation must match model frame. Keep identity rotation! |
|
|
The local OpenPLX velocities will be transformed to world in AGX. |
26.4. Geometry (contact shapes & attributes)
OpenPLX |
Attributes |
AGX mapping |
Notes |
|---|---|---|---|
|
|
|
An OpenPLX ContactGeometry maps to an agx::Geometry with a single shape. |
|
|
|
Size mapped with 0.5 factor per axis for half-extents. |
|
|
|
The Y axis is the default cylinder axis in AGX. |
|
|
|
The Y axis is the default capsule axis in AGX. |
|
|
|
|
|
|
|
Built via |
|
|
|
Built via |
|
|
|
Path must be absolute; scale → diagonal of |
26.5. Materials & surface contact
OpenPLX |
AGX |
Notes |
|---|---|---|
|
|
Name/UUID; density → |
|
|
A material model that models Young’s modulus. |
OpenPLX |
Alternatives |
AGX mapping |
Notes |
|---|---|---|---|
|
Configurable with attributes listed below. |
|
Created/uniqued per material pair in AGX. , |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Clearance also maps to slack in a SlackHinge, SlackPrismatic. |
|
A non zero scalar value. |
|
Restitution in the direction of a contact normal. |
|
A non zero scalar value. |
|
Restitution orthogonal to the contact normal. Not mapped to support a different restitution in the secondary direction. |
26.6. Interactions & constraints
- An
agx::Constraintis created using frames computed from its mate connectors and their respectiveagx::RigidBody. Each DOF’s compliance and damping (relaxation time) is set from the corresponding OpenPLX flexibility/dissipation component (see section below). Friction controllers on supported constarints are configured from PLX friction. frictionmay becomeDefaultDryFriction,AsymmetricLimitFrictionorConstantLimitFriction.AsymmetricLimitFrictionandConstantLimitFrictionwill both setagx::FrictionController::setMinimumStaticFrictionForceRange.Names/UUIDs always propagated.
OpenPLX |
Notes on Attributes |
AGX mapping |
DOFs & extras |
|---|---|---|---|
|
Slack variant if |
|
Free to rotate around the |
|
Slack if |
|
Free to move along the |
|
|
Slack variant if |
Free to move along and rotate around the |
|
No slack version. No mapping of ranges implemented. |
|
Free to rotate around all axes. |
|
Slack variant if |
|
Slack if |
|
No slack version. No mapping of distance range or distance motor implemented. |
|
Constrained to keep the distance between the mate connectors, otherwise free to move. |
|
Add all rigid bodies you like to merge to the |
|
Bodies merged via |
26.7. Regularization parameters
Most OpenPLX interactions, including mates and surface contact models,
have attributes for flexibility and dissipation which will map to compliance and damping in AGX.
The OpenPLX models are designed so that if the attributes does not become anything, the parameters will get the default AGX values.
The attributes are unique for each mate, listing one parameter for each degree of freedom (DOF).
Generally the local axes of a mate use the naming convention of the mate connectors, which are main, normal and cross.
Each regularization parameter is defined either around or along one of these axes.
flexibility alternatives:
Rigid→complianceset to machine-epsilon (nearly rigid).LinearElastic(stiffness)→compliance = 1/stiffness.stiffness == 0→ kill DOF (force range0).
dissipation alternatives:
ConstraintRelaxationTimeDamping→ maps directly to the AGX Spook damping parameter.agx::Constraint::setDamping.MechanicalDamping(damping)which requiresflexibilityto beLinearElastic(stiffness)→spook_damping = damping/stiffness.
26.8. Controllers: motors, ranges, springs (1-DOF controller constraints)
OpenPLX interactions also include springs, motors and ranges. These map to AGX controller constraints. Each controlling one degree of freedom with the possibility to declare regularization parameters.
OpenPLX |
AGX |
Notes |
|---|---|---|
|
|
|
|
Maps to |
Controlled in runtime by updating the force range with required_effort = min = max. |
|
|
Range |
|
|
Position/angle set; force range; enable; |
Annotation |
Reuse existing AGX constraint’s motor/range/lock |
Present when importing an .agx file, looks up constraint by UUID and attaches controller to the correct DOF. |
Annotation |
|
|
26.9. Environment, collisions & signals
OpenPLX |
AGX |
Notes |
|---|---|---|
|
|
Vector or center+magnitude mapped. |
|
Geometry/group assignment |
Adds all bodies/geometries/systems to AGX groups; respects nested systems. |
|
|
Applied recursively in |
|
|
Ensures frames exist for source and relative connectors (world excluded). |
26.10. Friction on constraints (non-contacts)
OpenPLX |
AGX |
Notes |
|---|---|---|
|
|
Dry/limit frictions converted to coefficient or static force ranges; controller disabled if unsupported in PLX side. |
26.11. Annotations reference
Controller reuse:
agx_imported_controller_constraint(UUID of an AGX constraint to attach to).Constraint solve:
agx_solve_type(DIRECT,DIRECT_AND_ITERATIVE,ITERATIVE).Friction solve:
agx_friction_solve_type(DIRECT,SPLIT,DIRECT_AND_ITERATIVE,ITERATIVE) +agx_approximate_cone_friction(boolean).Oriented friction:
reference_body/reference_geometry+primary_direction (Vec3).Terrain material:
agx_terrain_material(string).Observer frames:
agx_observer_frame_annotation/agx_debug_frame_annotationon MateConnectors.Track-specific:
agx_track_*,agx_set_*(see Tracks table).
26.12. Notes on error handling (high-level)
Invalid/duplicate material pairs, bad inertia tensors, negative mass, missing connected bodies, misplaced connectors, invalid OBJ/Trimesh, invalid friction frame, etc., are reported via the provided ErrorReporter and guarded with warnings/fallbacks.