26. Plotting and Data Acquisition

Video tutorial about plots 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

  1. Add an AGX Plot Component to your Blueprint.

Add a new Plot Component.
  1. Add one or more AGX Plot Data Series as variables in your Blueprint by selecting the (+) symbol under Variables. Set the type AGX Plot Data Series and set a meaningful label.

Add new Data Series.
  1. In the Blueprint Graph, create a plot by calling the Create Plot function on the AGX Plot Component.

Create Plot function.
  1. Write data to your AGX Plot Data Series during Simulation by calling the Write function. Below is an example of a Hinge’s angle being plotted against Simulation time.

Writing data to ``AGX Plot Data Series``.

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.

AGX Plot Component Details Planel.

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.