The Scenario Metrics example demonstrates the following:
- How to export backend scenario metrics to a text file for later use.
- How to create callbacks on the backend to collect the scenario metrics.
Registering Callbacks
VR-Forces includes an architecture for registering callbacks on the backend( DtCgf class). This allows one to regestier pre and post tick callbacks.
This example creates a DtMetricCollector class. It registers a postTickCallback on the DtCgf class to be able to query for scenario metrics each tick.
Since this example is loaded as a plugin, it can be used in conjunction with the released VR-Forces application
How to Run the Example
Usage
In the Launcher, click the Plug-ins button to bring up the Plug-ins Selection dialog. Enable the plugin.
To view the new behavior:
-
Start VR-Forces GUI and SIM.
-
Load the scenarioMetrics.scnx scenario from the developer_toolkit_examples.
-
Run the scenario.
-
The R 1 will move around with spot reports enabled and the metric collector will collect his location and his sensor contracts.
-
A metrics.txt file will get created in the /bin64/ folder. It will contain the collected data.
-
After running the scenario for a while - open the "metrics.txt" to see the metrics collected from the scenario.
Classes
Plugin Entry Points
void tickMetricCollector()
{
}
extern "C" {
{
}
{
return true;
}
}