XML#

This expdef plugin can be selected via --expdef=expdef.xml.

This is the default expdef type which SIERRA will use to read input files. This plugin does not currently support flattening/nested configuration files.

Important

If multiple matches for a given xpath string are found, only the first one is modified. This may be changed in a future version of the plugin.

Requirements#

  • __CONTROLLER__ - Tag used when as a placeholder for selecting which controller present in an input file (if there are multiple) a user wants to use for a specific Experiment. Can appear in XML attributes. This makes auto-population of the controller name based on the --controller argument and the contents of controllers.yaml (see Project YAML Configuration for details) in template input files possible.

  • __UUID__ - XPath substitution optionally used when a ROS1 engine is selected in controllers.yaml (see Project YAML Configuration) when adding XML tags to force addition of the tag once for every robot in the experiment, with __UUID__ replaced with the configured robot prefix concatenated with its numeric ID (0-based). Can appear in XML attributes.

  • sierra - Used when the ROS1+Gazebo engine is selected. Should not appear in XML tags or attributes.

XML-based Engine Examples#

Examples of the structure/required content of the XML file passed to SIERRA via --expdef-template for each built-in XML-based Engine are below. Use them as a starting point/in tandem with jharwell/sierra-sample-project.git to create your own conforming input files. Note that the contents shown is what is passed to SIERRA; i.e., prior to any processing.

For the purposes of illustration we will use --expdef-template=sample.argos and a controller MyController:

 <argos-configuration>
    ...
    <controllers>
       <__CONTROLLER__>
          ...
          <params>
             <task_alloc>
                <mymethod threshold="17"/>
             </task_alloc>
          </params>
       </__CONTROLLER__>
    </controllers>
    ...
<argos-configuration>

See Special Tokens for usage/description of the __CONTROLLER__ tag in XML files.

This applies to the following ROS1-based engines:

For the purposes of illustration we will use --expdef-template=sample.launch:

 <ros-configuration>
    <master>
       ...
       <param name="metrics/directory" value="/path/to/dir"/>
       ...
    </master>
    <robot>
       ...
       <param name="task_alloc/mymethod/threshold" value="17"/>
       <param name="motion/random_walk" value="0.1"/>
       ...
    </robot>
<ros-configuration>

This applies to the following ROS-based engines:

For the purposes of illustration we will use --expdef-template=sample.launch:

<ros-configuration>
   <master>
      ...
   </master>
   <robot>
      ...
   </robot>
   <params>
      <metrics directory="/path/to/dir"/>
      <task_alloc>
         <mymethod threshold="17"/>
      </task_alloc>
      <motion>
         <random_walk prob="0.1"/>
      </motion>
   </params>
</ros-configuration>

SIERRA may insert additional elements and split the processed template input file into multiple template files, depending on the engine. The results of this processing are shown below for each supported Engine. No additional modifications beyond those necessary to use the engine with SIERRA are shown (i.e., no Batch Criteria modifications).

Any of the following may be inserted:

  • A new element for the configured random seed.

  • A new element for the configured experiment length in seconds.

  • A new element for the configured # robots.

  • A new element for the controller rate (ticks per second).

  • A new element for the path to a second file containing all controller configuration.

The provided --expdef-template will look like this when populated within Runtime Directory Tree:

<argos-configuration>
   ...
   <controllers>
      <MyController>
         ...
         <params>
            <task_alloc>
               <mymethod threshold="17"/>
            </task_alloc>
         </params>
      </MyController>
   </controllers>
   ...
<argos-configuration>

No tags are inserted by SIERRA, and the file is not further split by SIERRA.

Input sample.launch file is split into multiple files within the Runtime Directory Tree:

  • sample_runX_robotY.launch containing the <robot> tag in the original input file, which is changed to <launch>. This has all nodes and configuration which is robot-specific and/or will be launched on each robot Y for each run X.

  • sample_master_runX.launch containing the <master> tag in the original input file, which is changed to <launch>. This has all the nodes and configuration which is ROS master-specific and will be launched on the SIERRA host machine (which where the ROS master will be set to) for each run X.

sample_run0_robot0.launch file:

<launch>
   ...
   <param name="task_alloc/mymethod/threshold" value="17"/>
   <param name="motion/random_walk" value="0.1"/>
   ...
   <group ns='sierra'>
      <param name="experiment/length" value="1234"/>
      <param name="experiment/random_seed" value="5678"/>
      <param name="experiment/param_file" value="/path/to/file"/>
      <param name="experiment/n_agents" value="123"/>
      <param name="experiment/ticks_per_sec" value="5"/>
   </group>
   ...
</launch>

sample_master_run0.launch file:

<launch>
   ...
   <param name="metrics/directory" value="/path/to/dir"/>
   ...
   <group ns='sierra'>
      <node
         name="sierra_timekeeper"
         pkg="sierra_rosbridge"
         type="sierra_timekeeper.py"
         required="true"
         output="screen"/>
      <param name="experiment/length" value="1234"/>
      <param name="experiment/random_seed" value="5678"/>
      <param name="experiment/param_file" value="/path/to/file"/>
      <param name="experiment/n_agents" value="123"/>
      <param name="experiment/ticks_per_sec" value="5"/>
   </group>
   ...
</launch>

Input sample.launch file is split into multiple files within the Runtime Directory Tree:

  • sample_runX_robotY.launch containing the <robot> tag in the original input file, which is changed to <launch>. This has all nodes and configuration which is robot-specific and/or will be launched on each robot Y for each run X.

  • sample_master_runX.launch containing the <master> tag in the original input file, which is changed to <launch>. This has all the nodes and configuration which is ROS master-specific and will be launched on the SIERRA host machine (which where the ROS master will be set to) for each run X.

  • sample_runX.params containing the <params> tag in the original input file, which is written out as a common file to use to share parameters between the robots and the ROS master for each run X.

Processed sample_run0_robot0.launch file:

<launch>
   ...
   <group ns='sierra'>
      <param name="experiment/length" value="1234"/>
      <param name="experiment/random_seed" value="5678"/>
      <param name="experiment/param_file" value="/path/to/file"/>
      <param name="experiment/n_agents" value="123"/>
      <param name="experiment/ticks_per_sec" value="5"/>
   </group>
   ...
</launch>

Processed sample_run0_master.launch file:

<launch>
   ...
   <group ns='sierra'>
      <node
        name="sierra_timekeeper"
        pkg="sierra_rosbridge"
        type="sierra_timekeeper.py"
        required="true"
        output="screen"/>
      <param name="experiment/length" value="1234"/>
      <param name="experiment/random_seed" value="5678"/>
      <param name="experiment/param_file" value="/path/to/file"/>
      <param name="experiment/n_agents" value="123"/>
      <param name="experiment/ticks_per_sec" value="5"/>
   </group>
   ...
</launch>

Processed sample_run0.params file:

<params>
   <metrics directory="/path/to/dir"/>
   <motion>
      <random_walk prob="0.1"/>
   </motion>
   <task_alloc>
      <mymethod threshold="17"/>
   </task_alloc>
</params>