Configuration files
We have three levels of configuration files:
- the main config file defines meta parameters and plugins parameters. One meta parameter is the "sourceFileExperiment", which defines the path to the second configuration file, the order file.
Note : Plugins are optional assets that requires scripts to run, for instance, the plugin SteamVR allows the use virtual reality in the simulator. For more details about plugins, please refer to the Tutorial 3 - Using the simulator in a user study.
- The order file is a csv file which defines a list of paths to a third type of configuration files, the trial configuration
- A trial configuration file is a XML file that defines the list of parameters which are directly linked to what we actually call a scenario in CrowdBot.
Main configuration file
The main configuration file is a xml file similar to the following:
<?xml version="1.0" encoding="utf-8"?>
<Config xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<experience currentUser="0" startingTrial="0">please refer to the [Tutorial 3 - Using the simulator in a user study](Tutorials/Tuto3).
<sourceFileExperiment>./Scenario/Tutos/Tuto1/FileOrder.csv</sourceFileExperiment>
<userHeight>1.7</userHeight>
</experience>
<log debugLvl="1" />
<AddOns />
</Config>
The CrowdBot simulator is designed to be used with user studies, thus the main configuration file have an "experiment" element which have user related parameters (height, user ID). If you are running user studies, please refer to the Tutorial 3 - Using the simulator in a user study.
The starting trial parameter allow you to start wherever you want in the list of files in the order file (sourceFileExperiment element).
While the CrowdBot simulator is designed for user studies, it perfectly handle full simulation experiments, such as this tutorial.
Order File
The order file is a just a list of paths of trial configuration files. The experiment will run in that order.
Example of order file:
/Scenario/Tutos/Tuto1/trial0.xml
/Scenario/Tutos/Tuto1/trial1.xml
/Scenario/Tutos/Tuto1/trial2.xml
Trial configuration
The trial configuration defines the scenario itself.
The 3d models names (scenes, robots, agents) are specified here, with their initial position and rotation.
Ending conditions can be specified.
- pro-tip: for infinite simulation *
<endingConditions>
<condition parameter="time" test="less" value="0" />
</endingConditions>
This file also defines the control laws of each agents and the crowd simulators.
Absolutely everything regarding the parameters of the simulation is defined here.
<?xml version="1.0" encoding="utf-8"?>
<Trial xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<scene meshName="Hangar">
<Position x="-0" y="0" z="0" />
<Rotation x="0" y="0" z="0" />
<recordingFile>Output_{USER}_{ITT}.csv</recordingFile>
<endingConditions>
<condition parameter="time" test="greater" value="60" />
</endingConditions>
</scene>
<player>
<TrialCamPlayer mesh="CamPlayer" radius="0.33" in_sim="false">
<Position x="-17.85" y="17.04" z="8.110001" />
<Rotation x="0" y="0" z="190.802734" />
<controlLaw>
<LawCamControlEditor lookSpeedH="2" lookSpeedV="2" zoomSpeed="2" dragSpeed="3" />
</controlLaw>
</TrialCamPlayer>
</player>
<robots>
<robot>
<TrialRegularRobot mesh="Cuybot_with_sensors" radius="1">
<Position x="-0" y="0" z="0.01" />
<Rotation x="0" y="0" z="0" />
<controlLaw>
<LawFake />
</controlLaw>
</TrialRegularRobot>
</robot>
</robots>
<agents>
<agent>
<TrialRegularAgent mesh="plasticMan" radius="0.33" visualVariation="6" animationOffset="0.231219769" heightOffset="0.04586265">
<Position x="-1.484395" y="-7.49597645" z="0.02" />
<Rotation x="-0" y="0" z="238.088959" />
<controlLaw>
<LawGoals speedCurrent="0" speedDefault="1.30167484" accelerationMax="0.6115926" angularSpeed="36000" reachedDist="0.5" isLooping="true">
<Goals>
<Goal x="3.65775585" y="-0.05359173" z="0.01" />
<Goal x="3.13092232" y="-0.6060767" z="0.01" />
</Goals>
</LawGoals>
</controlLaw>
<controlSim>
<VOGConfig SimulationID="0" neighborDist="5" maxNeighbors="3" timeHorizon="5" timeHorizonObst="2" radius="0.33" maxSpeed="2">
<group groupID="-1" useFormation="true" neighbourNum="2" neighbourDist="1" neighbourDetectionDist="80" horizonTime="2" weightPrefVel="0.15" weightGroup="0.2" />
</VOGConfig>
</controlSim>
</TrialRegularAgent>
</agent>
<agent>
<TrialRegularAgent mesh="plasticMan" radius="0.33" visualVariation="1" animationOffset="0.828815937" heightOffset="-0.008128494">
<Position x="13.8124113" y="-6.52328873" z="0.02" />
<Rotation x="0" y="-0" z="61.985424" />
<controlLaw>
<LawGoals speedCurrent="0" speedDefault="1.31559587" accelerationMax="0.8204204" angularSpeed="36000" reachedDist="0.5" isLooping="true">
<Goals>
<Goal x="2.65004134" y="-5.289126" z="0.01" />
<Goal x="5.20066643" y="-2.80304718" z="0.01" />
</Goals>
</LawGoals>
</controlLaw>
<controlSim>
<VOGConfig SimulationID="0" neighborDist="5" maxNeighbors="3" timeHorizon="5" timeHorizonObst="2" radius="0.33" maxSpeed="2">
<group groupID="-1" useFormation="true" neighbourNum="2" neighbourDist="1" neighbourDetectionDist="80" horizonTime="2" weightPrefVel="0.15" weightGroup="0.2" />
</VOGConfig>
</controlSim>
</TrialRegularAgent>
</agent>
</agents>
<obstacles />
</Trial>