26. Plotting and Data Acquisition
To create plots in AGX Dynamics for Unreal, the AGX Plot Component
can be used together with one or more AGX Data Series
that hold the plot data.
The AGX Plot Component
can also be used to write data to a (.csv) file on disk for later analysis.
26.1. Creating a Plot
Add an
AGX Plot Component
to your Blueprint.
Add one or more
AGX Plot Data Series
as variables in your Blueprint by selecting the (+) symbol underVariables
. Set the typeAGX Plot Data Series
and set a meaningful label.
In the Blueprint Graph, create a plot by calling the
Create Plot
function on theAGX Plot Component
.
Write data to your
AGX Plot Data Series
during Simulation by calling theWrite
function. Below is an example of a Hinge’s angle being plotted against Simulation time.
Note that here we are using a custom Event bound to Simulation PreStepForward to ensure we write data from each Simulation step.
It can also be done from the regular Tick
event but in that case it is not guaranteed that we get data from all Simulation steps.
This is explained further in Simulation Stepping Mode.
Also, see Events and Delegates for more information about events and delegates.
By default, the plot window is automatically opened in your default browser on Play.
This behavior can be controlled through the Auto Open Plot Window
property in the AGX Plot Component
Details Panel.
Opening the plot window during Play can also be done by clicking the Open Plot Window
button from the Details Panel or by calling the function OpenPlotWindow
on the AGX Plot Component
.
26.2. Writing Data to File
The AGX Plot Component
can automatically write data to a (.csv) file on disk.
This is controlled through the Write To File
property in the AGX Plot Component
Details Panel.
If set to true, a file with name given by the File Output Name
property will be created in the project root.
26.3. Limitations
Currently, AGX Data Series
that are part of a Blueprint of Component type is not supported.