Mission XML Tag Definitions¶
Either the latitude
, longitude
, and altitude
tags must be used
together or the x
, y
, and z
tags must be used together. Do not mix
and match between the two paradigms for a single entity.
run
: Defines timing parameters for simulationattributes:
start
: The start time, should usually be set to 0.0.end
: Final time of simulation, in seconds.dt
: Change in simulation time for each time step, in seconds.time_warp
: Specifies how much slower or faster than real-time that the simulation should run. If set to 1, the simulation runs in real-time. If set to 0, the simulation runs as fast as possible. If set to x, it runs x times faster than real-time. For example, if set to 10, the simulation will run 10 times as fast as real-time. If set to 0.5, the simulation will run half as fast as real-time. It should be noted that this parameter only defines a “best effort.” The autonomy logic can and will slow down the simulation, but the simulation is guaranteed to run deterministically with respect to theseed
XML tag, even if it runs slower than real-time.enable_gui
: If set totrue
, the SCRIMMAGE gui will run in parallel with the SCRIMMAGE simulation. Iffalse
, the gui will not run during the simulation.network_gui
: If set totrue
, the SCRIMMAGE simulation controller will attempt to connect to a network-based (GRPC) SCRIMMAGE viewer. Ifnetwork_gui
is set totrue
,enable_gui
should be set tofalse
, so that the shared memory version of the SCRIMMAGE viewer isn’t initialized.start_paused
: Iftrue
, the simulation will not start until the user typesb
into the gui. This allows the user to ensure that the simulation’s initial conditions are correct before running simulation since the gui can launch after the actual simulation begins execution.motion_multiplier
set to an integer greater than or equal to 1.If not 1, scrimmage will run controller and motion plugins multiple times for each timestep.
full_screen
: Iftrue
, display the SCRIMMAGE viewer in full screen.window_width
: Iffull_screen
is false, sets the SCRIMMAGE viewer width. If not specified, defaults to 800.window_height
: Iffull_screen
is false, sets the SCRIMMAGE viewer height. If not specified, defaults to 600.
stream_port
: Whennetwork_gui
is enabled, GRPC messages of the positions and orientations of SCRIMMAGE entities will be streamed to this port.stream_ip
: Whennetwork_gui
is enabled, GRPC messages of the positions and orientations of SCRIMMAGE entities will be streamed to this network address (e.g., localhost, 192.168.1.49, etc.)seed
: Used to seed SCRIMMAGE’s random number generator. If not specified or commented out, the current computer time will be used to seed the simulation. In some cases a user will want the scenario to begin deterministically and then proceed randomly. This can be achieved by setting a seed but adding an attributereseed_time
for the time in the simulation when the seed should be set to something random. Additionally, if you want the reseed to be deterministic you can set it with thereseed
tag.end_condition
: Specifies the conditions for ending the simulation. The possible end conditions aretime
,one_team
,all_dead
, andnone
. Iftime
is set, the simulation will automatically end when the time reaches theend
attribute defined in therun
tag. Ifone_team
is set, the simulation will end when all entities remaining belong to the same team ID. Ifall_dead
is set, the simulation will end when there are no more remaining entities. Ifnone
is set, the simulation will only end when the user closes the gui or if the user “kills” the simulation by typingCTRL + c
in the terminal that launched scrimmage. The end conditions can be OR-ed together by separating the end conditions with commas. For example, if theend_condition
is set to “time, one_team” the simulation will end if theend
time is reached or if only a single team is remaining.terrain
: Defines the name of the folder that holds the terrain polygon and texture data. This is typically located at:$SCRIMMAGE_DATA_PATH/gui/terrain
.grid_spacing
: Defines the distance in meters between grid lines when not using theterrain
tag.grid_size
: Defines the length in meters of the square grid when not using theterrain
tag.background_color
: The visualization background color defined in RED, GREEN, BLUE order.gui_update_period
: The gui update period in milliseconds. Providing a small number increases the gui update rate, but can slow the simulation due to system resources.output_type
: Specifies what artifacts are generated by a simulation run. If set toframes
only the frames.bin file will be created. If set tosummary
, a CSV file of the mission metrics will be created. If set togit_commits
, a hash of the current git project will be created. If set toall
, all the possible artifacts will be created. If set to nothing no output will be created.show_plugins
: Iftrue
, SCRIMMAGE will print the plugins that were discovered on the SCRIMMAGE_PLUGIN_PATH at simulation start-up. The plugins will be grouped into similar plugin types (e.g. autonomy plugins, motion plugins, interaction plugins, sensors, controllers, etc.)log_dir
: The log directory is the folder where scrimmage will save all log information from the simulation. This includes entity trajectory data, event data, and the random seed that was used during the simulation.create_latest_dir
: Iftrue
, a symbolically linked directory namedlatest
will be created that links to the most recentlog_dir
. This tag istrue
by default. When executing parallel runs, the user should set this tofalse
, so that multiple instances of SCRIMMAGE do not try to create the samelatest
directory.latitude_origin
: This is the latitude (decimal degrees) at which the simulation’s cartesian coordinate system’s origin is centered. (e.g., 35.721025)longitude_origin
: This is the longitude (decimal degrees) at which the simulation’s cartesian coordinate system’s origin is centered. (e.g., -120.767925)altitude_origin
: This is the altitude in meters above sea level at which the simulation’s cartesian coordinate system’s origin is centered.show_origin
: If set totrue
, a three axis coordinate system will be drawn at the origin of the simulation. This is help for debugging the latitude, longitude, and altitude origin values.display_progress
: whether to show a progress bar on the command lineorigin_length
: Specifies the length of the origin axes in meters whenshow_origin
is enabled.metrics
: This tag loads metrics plugins and executes them during the mission. Metrics plugins are executed in the order in which they appear in the mission file. A metrics plugin counts “events” in the simulation and outputs the counts to the summary CSV file.entity_interaction
: This tag loads a plugin that computes interactions between entities during the simulation. For example, theSimpleCollision
entity interaction plugin computes the distance between all entities and if the distance between any two entities is below a given threshold, the entities are removed from the simulation. TheGroundCollision
entity interaction plugin removes entities from the simulation that are within a given distance from the ground. Entity interaction plugins are executed in the order in which they appear in the mission file.network
: This tag loads a plugin that simulates network communications. This can be used to simulate dropped packets. By default, every SCRIMMAGE simulation initializes a “GlobalNetwork,” which is used to transfer simulation data, such as “EntityGenerated” messages. The “LocalNetwork” only allows transmission of messages between plugins that are attached to the same entity. The “SphereNetwork” is a probabilistic transmission model that is parameterized by communication range. (perfect comms within range or probabilistic comms within a range). Multiple network tags can be specified in a single mission file.entity
: The entity tag is used to initialize a single entity or a swarm of homogeneous entities. The following XML tags should be used within theentity
tag:name
: A human-readable name for this entity block. This name can be used to reference this block later. When running SCRIMMAGE within another system, such as ROS or MOOS, this name is used to reference this entity block.id
: An optional tag that manually specifies the entity’s ID or the first ID of an entity block that generates more than a single agent. If two entity blocks specify the sameid
, the entity that is generated first is assigned the ID. If the ID is already in use by another agent, the ID is incremented until an available entity ID is found.team_id
: The team identification number for this entity group. If multiple entity tags are used to initialize a team of heterogeneous entities, as long as theteam_id
is the same, the entities will be on the same team.color
: This is a team color that affects vehicle trail colors and home base colors.count
: The number of entities to create.generate_rate
: The rate (in Hz) at which new entities will be generated. For example “1 / 2” will generate new entities every two seconds.generate_count
: The number of entities that are generated at each time interval. If set to2
, two entities will be generated every generation interval.generate_start_time
: The simulation time at which new entities should start to be generated.generate_time_variance
: This tag is used to add “noise” to the generation interval. The time between launches is modeled to be distributed according to the Gaussian Distribution. All four generate tags have to be defined, otherwise, the generate feature will not work properly. See the sasc.xml mission for an example configuration.autonomy
: This tag assigns an autonomy plugin for each entity in the entity group. Scrimmage searches the SCRIMMAGE_PLUGIN_PATH for an XML file with the autonomy tag’s name. Multiple autonomy plugins can run in serial on a single entity. Autonomy plugins are executed in the order in which they appear in the mission file.loop_rate
: This tag sets the autonomy plugin’s loop_rate in Hz. Scrimmage will attempt to step the plugin at this rate, but cannot step a plugin faster than the simulation itself. If the loop_rate is set faster than the sim, or is set to 0 or a negative number, it will step every time the simulator steps.
health
: The initial health points for this entity. The entity interaction plugin can affect the health points of each entity depending on entity messages and the world state. When the health points decrement to zero, the entity is usually removed by the entity interaction plugin.variance_x
: The first entity in an entity group is, by default, initialized at the position determined by the thex
,y
, andaltitude
tags. Since it can be tedious to specifically initialize large numbers of entities, scrimmage has the ability to randomly initialize an entity group’s starting positions. Thevariance_x
,variance_y
, andvariance_z
tags bound the possible starting locations to a cube around thex
,y
, andaltitude
tag position.variance_y
: The y-distance around the entity’s initial position for generating entities.variance_z
: The z-distance around the entity’s initial position for generating entities.use_variance_all_ents
: Defaults tofalse
. This tag, if set totrue
, causes the first entity in an entity group to be placed randomly according to the same variances and about the samex
,y
,altitude
point as the rest of the entity group.x
: The entity’s initial x-position. The first entity in the entity group is initialized at this x-position, but other entities in the same group are randomly placed around this starting position.y
: The entity’s initial y-position.z
: The entity’s initial z-position.latitude
: The entity’s initial latitude.longitude
: The entity’s initial longitude.altitude
: The entity’s initial altitude.heading
: The entity’s initial heading. Zero-degrees is in the x-axis direction. The heading angle increases in a counter-clockwise direction. This is different from GPS heading, which increases in a clockwise heading. Scrimmage has utilities for easily translating between GPS and cartesian coordinate systems.motion_model
: The motion model or “physics” model that describes the entity’s movement. Scrimmage ships with the following motion models:SimpleAircraft
: An efficient aircraft model that does not allow inverted flight.SimpleQuadrotor
: An efficient quadrotor model that does not allow inverted flight.JSBSimModel
: A high-fidelity aircraft model that allows inverted flight. This plugin ships with an autopilot defined in JSBSim that attempts to prevent inverted flight.JSBSimControl
: A high-fidelity aircraft model that allows direct control of the actuators on the aircraft. This is the model that allows for experimenting with the control of inverted aircraft with realistic physics.SimpleCar
: A simple car modelSingleIntegrator
: A single integrator model for experimenting with motion planning.
visual_model
: Loads an XML file that specifies the appearance of the entity. Examples: zephyr-blue, zephyr-red, iris, sea-angler, volkswagen.controller
: Loads a low-level controller plugin. Each entity can only have a single controller.loop_rate
: This tag sets the controller plugin’s loop_rate in Hz. See autonomy tag for details.
sensor
: Loads a sensor plugin. Multiple sensor plugins can run in serial on a single entity.loop_rate
: This tag sets the sensor plugin’s loop_rate in Hz. See autonomy tag for details.
base
: Used to define a “home base” for the entity. Only one home base per team should be specified. Entity groups that share a team ID will share a home base defined in only one entity group. Thebase
tag has the following tags:x
: The base’s x-positiony
: The base’s y-positionz
: The base’s z-positionlatitude
: The base’s latitudelongitude
: The base’s longitudealtitude
: The base’s altituderadius
: The base’s radius
entity_common
: this is a way to share parameters across entity blocks. Anentity_common
block must have aname
attribute and can have any entries that anentity
block can have. For anentity
block to use what is in theentity_common
block, the entity must have an attributeentity_common="name"
wherename
matches what is in the attribute for theentity_common
block.param_common
: plugins have their own xml files but it can be useful to override their attributes in the main mission file. For instance, one can override the parameterfoo
in the main mission file with<autonomy foo="bar">MyAutonomyPlugin</autonomy>
. Regardless of what is inMyAutonomyPlugin.xml
,foo
will have a value ofbar
when the plugin is initialized. To abstract this further, plugins can share overriden values with aparam_common
block. Aparam_common
block needs to have aname
attribute (similar toentity_common
blocks). The common block can be referenced as<autonomy param_common="vehicle">MyAutonomyPlugin</autonomy>
wherevehicle
is the value given to the attributename
in theparam_common
block.camera
: defines camera parametersattributes:
mode
:follow
,free
, oroffset
follow_id
: the entity id for the camera to followpos
: 3 entry comma separated list of where to put the camera (applicable tofree
mode only)focal_point
: 3 entry comma separated list of where to point the camera (applicable tofree
mode only)show_fps
: whether to show frames per second on the gui
enable_screenshots
: if the tag is set to true, scrimmage will save screenshots at regular intervals. This will slow down performance as the simulation loop will wait for the gui to save the screenshot before proceeding. Note thatenable_gui
must be true for this setting to be effective. Themin_period
,start
, andend
attributes are specified in seconds.min_period
: how often to save screenshotsstart
: when to start taking screenshotsend
: when to stop taking screenshots.
multi_threaded
: allows scrimmage to run in multiple threads if the tag is set to true (default=``false``). The default is for scrimmage to run in a single thread. The attributes are:num_threads
: how many threads to use (default = 1
)autonomy
: whether to enable or disable running autonomy plugins in threads (default = true
)controller
: whether to enable or disable running controller plugins in threads (default = true
)motion
: whether to enable or disable running motion plugins in threads (default = true
)sensor
: whether to enable or disable running sensor plugins in threads (default = true
)