VR-Link API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
12.2 - The f18 Program

Table of Contents

The f18 program simulates a simple HLA or DIS vehicle.

By default, that vehicle is an F/A18, flying in a circle, just off the coast of California, USA, but you can control the entity type, location and route.

f18 generates predictable HLA entity update messages (or DIS entity state PDUs), so it is a useful tool for debugging applications that receive and interpret these messages. It can also fire munitions and react to detonations.

The f18 syntax is:

f18 -h

f18 [options...]

To exit f18, press q followed by Enter or Return.

The following table summarizes f18's command-line options.

f18 Command-Line Options
Option Description
Protocol Independent Options
-a ID For DIS, sets the second component of the entity ID to ID. By default, the entity ID is 1:2:1, however if you want to run multiple f18s at once, each needs a unique entity ID.For HLA specifies an entity ID.
-d seconds Set the delay (in seconds) between the time f18 receives a detonation interaction (or PDU), and the time it broadcasts its final message and exits.
-D algorithm Specifes the dead reckoning algorithm, where algorithm can be:
  • 0 – Other
  • 1 – Static
  • 2 – Fixed rotation, positional DR, world coordinates
  • 3 – Rotational DR, positional DR, world coordinates
  • 4 – Rotational DR, velocital DR, world coordinates
  • 5 – Fixed rotation, velocital DR, world coordinates.
-h Displays a summary of command-line options, then exits.
-H degrees Specifies the initial heading of the f18, in degrees.
-l file Loads the specified MTL configuration file.
-L x,y,z Specifies the initial position, as in topographic coordinates.
-M markings Specifies the markings.
-n notify_level Specifies the notification level for warnings.
-O lat,long Specifies the reference latitude and longitude for the topographic coordinate system.
-r radius Specifies the turn radius of the f18, in meters. Setting the radius to 0.0 causes the f18 to move in a straight line.
-s mps Specifies the initial speed of the f18, in meters per second.
-T type Specifies the entity type, as a string of the form: kind:domain:country:category:subcategory:specific:extra
-W x,y,z Specifies the initial position in geocentric coordinates.
HLA Only Options
(-f | –fomMapperLib) libname
Specifies a FOM Mapper library name.
–fomMapperInitData data
Specifies FOM Mapper initialization data, if required.
–rprFomVersion version_number
Specifies the RPR FOM version. (0.5, 0.7, 0.8, 1.0, 2.0006, 2.0014, or 2.0017)
-F FED_file Specifies the FED file. Default: federation_name.fed.
-N name Specifies the HLA object name.
-n federate_name Specifies the name of the federate.
-x ex-name Sets the federation execution name. Default: .
DIS Only Options
-A address Specifies the default destination IP address for outgoing PDUs.
-I Use asynchronous IO.
-P portnum Specifies the UDP port. Default: 3000.
–recvBufferSize size Specifies the receive buffer size.
–sendBufferSize size Specifies the send buffer size.
–siteId ID Specifies the site ID.
-S address Subscribes to the specified multicast addresses. Multiple -Ss can appear on a command line. Multicast is not supported on all platforms.
–mcastTtl ttl Specifies the multicast time to live. This is the number of routers that a message can pass through.
-V version Specifies the DIS protocol version contained in outgoing PDUs, where the version can be 4, 5,6 or 6.
-x ex-name Specifies the exercise ID for DIS. Default: 1.

12.2.1 The f18 Configuration File

By default, f18 does not load the configuration file f18.mtl, instead relying on command line arguments for configurations. However, you may use the -l command line to specify a configuration from a file. For this still include f18.mtl as an example. This file sets many of the f18's default parameters, including notify level, dead-reckoning algorithm, and initial heading, position, and speed.

To change default parameters:

You can rebuild the f18 program or create a new application based on f18 that does not use a configuration file.

To write a variation of f18 that does not use a configuration file, remove the initMtl() call.

You can also specify a different configuration file in your code, at the DtcLoadLispFile() function call.

12.2.2 Firing Munitions

To cause the f18 to fire at another entity, press Enter or Return.

If other entities exist in the exercise, f18 issues a fire message directed at the closest one. Though there is no tracked munition, f18 issues a detonate message three seconds later to indicate that the target was hit.

To change the delay, edit the munitionFlightTime parameter in the f18.mtl file.

12.2.3 Reactions to Detonate Messages

The f18 reacts to detonation PDUs or RPR FOM detonation interactions. If a detonation occurs within the lethalDetonationRange, or if the detonation result is entity impact or entity proximate, the f18 is destroyed. Updates reflect a damage state of DamageDestroyed for a period of destroyedToFinalDelay seconds, at which point the entity leaves the exercise and f18 exits.

LethalDetonationRange defaults to 20 meters, and destroyedToFinalDelay defaults to zero. You can change these parameters in f18.mtl.

12.2.4 Absolute Timestamping

The value of the timeStampType flag in f18.mtl determines whether absolute or relative timestamps are used in f18's outgoing state update messages. The flag defaults to relative (0), but can be set to absolute (1). When the timeStampType is absolute, f18 dead-reckons remote entities based on their absolute timestamps, when applicable. Absolute timestamping should be used only when the local machine's clock is synchronized with the clock being used by other applications in the exercise for their absolute timestamps.

For more information about timestamps, please see 2.7.6 Timestamps.

12.2.5 Using a Modified FOM

The f18 example has a source file called config.cxx that shows how you can configure VR-Link to use a modified FOM. It shows how you can instruct VR-Link to represent position on the network as Z, Y, X, rather than X, Y, Z. For this purpose, we use a new attribute of the BaseEntity object class called ReversePosition instead of the default Position attribute, and a new parameter of the WeaponFire interaction class called ReverseFiringLocation instead of the default FiringLocation.

By default, this functionality is #ifdef'd out. But if you include the definition REVERSE=1 on your make line, when building f18, for example:

make REVERSE=1 f18

it will be compiled in. If you want to try this out, remember to modify the .fed file to reflect the expected changes before running the executable.

[<< About the Applications] [Home] [Top of Page] [Calling VR-Link from Other Languages >>]


Document ID: Generated on Tue Mar 1 02:56:17 EST 2016 from SVN revision 162687
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)