15   The ConstantHeading Behavior


15.1 Configuration Parameters
15.2 Variables Published
15.3 The duration Parameter
15.4 Behavior Completion
15.5 The ConstantHeading Objective Function


This behavior will drive the vehicle at a specified heading. This behavior merely expresses a preference for a particular heading. If other behaviors also have a heading preference, coordination/compromise will take place through the multi-objective optimization process.

15.1   Configuration Parameters    [top]


Listing 15.1 - Configuration Parameters Common to All Behaviors.

activeflag:A MOOS variable-value pair posted when the behavior is in the active state. Section 6.5.4.
condition:Specifies a condition that must be met for the behavior to be running. Section 6.5.1.
duration:Time in behavior will remain running before declaring completion. Section 7.2.6.
duration_idle_decay:When true, duration clock is running even when in the idle state. Section 7.2.6.
duration_reset:A variable-pair such as MY_RESET=true, that will trigger a duration reset. See Section 7.2.6.
duration_status:The name of a MOOS variable to which the vehicle duration status is published. Section 7.2.6.
endflag:A MOOS variable-value pair posted when the behavior has completed. Section 6.5.4.
idleflag:A MOOS variable-value pair posted when the behavior is in the idle state. Section 6.5.4.
inactiveflag:A MOOS variable-value posted when the behavior is not in the active state. Section 6.5.4.
name:The (unique) name of the behavior. Section 7.2.2.
nostarve:Allows a behavior to assert a maximum staleness for a MOOS variable Section 7.2.9.
perpetual:If true allows the behavior to to run even after it has completed. Section 7.2.7.
post_mapping:Re-direct behavior output normally to one MOOS variable to another instead. Section 7.2.4.
priority:The priority weight of the behavior. Section 7.2.3.
pwt:Same as priority.
runflag:A MOOS variable and a value posted when a behavior has met its conditions. Section 6.5.4.
spawnflag:A MOOS variable and a value posted when a behavior is spawned. Section 6.5.4.
templating:Turns a behavior into a template for spawning behaviors dynamically. Section 7.7.
updates:A MOOS variable from which behavior parameter updates are read dynamically. Section 7.2.5.

Listing 15.2 - Configuration Parameters for the ConstantHeading Behavior.

ParameterDescription
basewidthThe width of the base, in degrees, in the produced ZAIC-style IvP function. Section 15.5.
complete_threshThe threshold in discrepancy between the the requested heading and present heading before the behavior completes. The default is -1. Section 15.4.
durationBehavior duration, in seconds. Mandatory configuration for this behavior. Section 15.3.
headingThe desired heading of the vehicle, in degrees (North=0).
peakwidthThe width of the peak, in degrees, in the produced ZAIC-style IvP function. Section 15.5.
summitdeltaThe height of the summit delta parameter in the produced ZAIC-style IvP function. Section 15.5.
heading_mismatch_varName of the MOOS variable indicating the present delta between the desired heading and the current heading. Section 15.2.

Listing 15.3 - Example Configuration Block.

 Behavior = BHV_ConstantHeading
 {
   // General Behavior Parameters
   // ---------------------------
   name         = const_hdg            // example
   pwt          = 100                  // default
   condition    = MODE==GO_STRAIGHT    // example
   updates      = CONST_HDG_UPDATES    // example

   // Parameters specific to this behavior
   // ------------------------------------
              basewidth = 10           // default
               duration = 0            // default
                  speed = 0            // default
   heading_mismatch_var = HDG_DIFF     // example
              peakwidth = 10           // default
            summitdelta = 25           // default
 }

15.2   Variables Published    [top]


The behavior may be optionally configured to publish a variable indicating the discrepancy between the requested heading and the actual observed heading. The MOOS variable is named using the heading_mismatch_var parameter. This variable will only be published when the behavior is in the running state.

15.3   The duration Parameter    [top]


The duration parameter defined for all general behaviors, but for this behavior, specification is mandatory for safety reasons. The default if not specified is 0 seconds which will result in the behavior completing immediately. If no duration limit is desired, e.g., if the behavior is tied to another behavior or event via condition variables, then setting duration = no-time-limit will result in no time duration checks for this behavior.

15.4   Behavior Completion    [top]


The behavior, by default, remains active so long as its conditions are met, just like any other behavior. If the user optionally declares a threshold via the complete_thresh parameter, the behavior will complete once the discrepancy between the observed heading and the goal heading falls below that threshold. In this case the behavior will complete, as any other helm behavior, by posting its endflags.

15.5   The ConstantHeading Objective Function    [top]


See Figure 8.1.

  • basewidth: The width of the base, in degrees in the produced objective function. The default is 170. See Figure 8.1 for more on the basewidth parameter used in the ZAIC tool for building IvP functions.
  • peakwidth: The width of the peak in degrees in the produced objective function. The default is 10. See Figure 8.1 for more on the peak parameter used in the ZAIC tool for building IvP functions.
  • summitdelta: The width of the base, in meters in the produced objective function. The default is 25. See Figure 8.1 for more on the summitdelta parameter used in the ZAIC tool for building IvP functions.

Page built from LaTeX source using the texwiki program.