Plugin / XML File Discovery
This tutorial assumes you have completed the section
Installation. Let’s start with the command we ran to run the
straight.xml mission:
$ cd ~/scrimmage/scrimmage
$ scrimmage ./missions/straight.xml
When executing this line, scrimmage first reads in the mission file
straight.xml. This file allows for quite a few customizations such as how
to visualize terrain and entities (aircraft in this case), how long we want the
simulation to run, where it takes place, and quite a few other items. For our
purposes though, the entity block is the one of interest. In the scenario,
we have 2 teams each with fixed-wing aircraft. Thus, we have two entity blocks.
The team is set with the team_id block and the entity type is set with the
autonomy block. [1] When scrimmage sees the autonomy block
pointing to Straight it does the following:
Looks for the file
Straight.xmlin yourSCRIMMAGE_PLUGIN_PATHand loads it.Looks for the
paramsxml tag inStraight.xml.It loads the custom autonomy specified by the
librarytag (we will discuss how to create these libraries below)It saves all other items in the
paramsblock and passes these variables to theinitmethod of thelibraryas a map of strings pointing to strings (we will discuss this below as well).
Later tutorials will discuss how to implement custom autonomy plugins.
Finding Plugins
A command line utility called scrimmage-plugin can be used to find a plugin
and print its properties. For example, to find the Straight autonomy
plugin, type the following:
$ scrimmage-plugin Straight
This utility is useful for debugging file path problems.