This page outlines the major components used in the baseline mission.  The major sections are as follows:

uFld - new applications for configuring communication vehicle <-> shore and vehicle <-> vehicle

nsplug - an application that allows us to split MOOS configuration files into individual "meta" and "plug" files.  

Launch scripts - scripts that build the final moos file and launch your mission.

nsplug - breaking up MOOS files

nsplug is a little program that will both combine multiple smaller moos files into one big one and also fill in variables you define.  In the baseline mission there are a few "meta" moos files and many "plug" moos files.  

Meta files are the top level template and differ between platforms - vehicles, shoreside, etc.  They contain the pAntler config block, global stuff like the community name, and a number of #includes to bring in the plugs.  The shoreside meta file contains a lot more because most of its applications are unique to the shoreside.  

Plug files contain configs that are shared among multiple vehicles/platforms.  For example, the acomms driver is the same on every platform/vehicle that uses it, so there's just one plug_iAcommsDriver.moos file that is shared by all the different meta files.  If something changes in the driver configuration only the one file has to be changed.  

Of course there are some attributes, such as the name of a serial port, that are common to all vehicles but take different values on each one.  For these we can define a variable that nsplug will fill in when it generates the target moos file.  In the acomms driver it looks something like port=$(ACOMMSPORT).  Something similar is done in many other places, including the community name and MOOSDB port.  

P.S. - this all works for behavior files too.

Launch scripts

Launch scripts are where all the magic happens.  They contain variable definitions and allow you to setup options you can select with command line arguments at run time.  They might look scary if you're not familiar with shell scripting, but they're well broken down into easy to understand parts.  Each script is roughly structured as follows:

  1. Set initial variable values.  You should also modify the path here if you're going to be running any MOOSApps not on the path.  
  2. Process command line arguments.  More on the important ones later.  
  3. Check for bad arguments, usually exiting if one is found.  
  4. Call nsplug, maybe with some more variables defined.  
  5. Use pAntler to launch (in the background, so ssh disconnecting won't affect it).  
  6. Ask user what to do next - exit and leave everything running or kill everything you just started.  

There are currently three launch scripts - shore, vehicle, and simulation.  The shore and vehicle launch scripts work as you would expect to launch terra and any of the vehicles.  The simulation launch script will use the "meta_vehicle_sim.moos" file instead of "meta_vehicle_fld.moos", which replaces various nav drivers with uSimMarine.  It will launch both the shoreside and vehicles.  

Command line arguments:

  • As always, --help to get help.
  • --just_build or -j will build the target moos file but not run it, good for making sure everything looks correct.  
  • --nostromo or similarly for other vehicles specifies which vehicle you're launching when using launch_vehicle.sh.  
  • For simulations, --warp=X runs everything at X times normal speed.  Depending on your computer's speed things might start to get glitchy with warps past 10, though it's certainly possible to run in excess of warp 30.  
  • No labels