18   The GoToDepth Behavior


18.1 Configuration Parameters
18.2 A Detailed Discussion of GoToDepth Behavior Parameters
     18.2.1 The capture_flag Parameter
     18.2.2 The capture_delta Parameter
     18.2.3 The depth Parameter
     18.2.4 The repeat Parameter
     18.2.5 The perpetual Parameter


This behavior will drive the vehicle to a sequence of specified depths and duration at each depth. This behavior merely expresses a preference for a particular depth. If other behaviors also have a depth preference, coordination/compromise will take place through the multi-objective optimization process. A log of vehicle depth similar to figure below may result.

Figure 18.1: Depth log from simulation with the depth parameters shown in Listing 18.3. The lighter, step-like line indicates the values of DESIRED_DEPTH generated by the helm, and the darker line indicates the recorded depth value of the vehicle. The depth plateaus start from the moment the vehicle achieves depth. For example, the vehicle achieved a depth of 45 meters at 119 seconds and retained that desired depth for another 60 seconds as requested in the configuration shown in Listing 18.3.

18.1   Configuration Parameters    [top]


Listing 18.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 18.2 - Configuration Parameters for the GoToDepth Behavior.

ParameterDescription
capture_deltaThe delta depth, in meters, between the current observed depth and the current target depth, below which the behavior will declare the depth to have been achieved. The default value is 1 meter. Section 18.2.2.
capture_flagThe name of a MOOS variable incremented each time a target depth level has been achieved. Section 18.2.1.
depthA colon-separated list of comma-separated pairs. Each pair contains a desired depth and a duration at that depth. Section 18.2.3.
repeatThe number of times the vehicle will traverse through the evolution of depths. Section 18.2.4.

Listing 18.3 - Example Configuration Block.

 Behavior = BHV_GoToDepth
 {
   // General Behavior Parameters
   // ---------------------------
   name         = gotodepth                 // example
   pwt          = 100                       // default
   condition    = MODE==Alpha               // example
   updates      = GOTO_DEPTH_UPDATES        // example

   // Parameters specific to this behavior
   // ------------------------------------
     capture_delta = 1                      // default (meters)
      capture_flag = DEPTH_ACHIEVED         // example
             depth = 40,60:30,45:20,45      // example
            repeat = 0                      // default
 }

18.2   A Detailed Discussion of GoToDepth Behavior Parameters    [top]


18.2.1   The capture_flag Parameter    [top]


This parameter names a MOOS variable incremented each time a target depth level has been achieved. It may be useful for logfile analysis and also allows other behaviors to be conditioned on a depth event. If this behavior is completed in perpetual mode, the counter is reset to zero. If the behavior is repeating a set of depths by setting repeat greater than zero, the counter will continue to increment through evolutions. The default value is the empty string, meaning nothing will be posted. Note the named MOOS variable will automatically have the prefix "GTD_" applied.

18.2.2   The capture_delta Parameter    [top]


When the GoToDepth behavior is running and actively influencing the depth of the vehicle to a target depth level, it monitors the discrepancy between the obvserved depth and the current target depth. The capture_delta parameter is the delta depth, in meters, below which the behavior will declare the depth to have been achieved. The default value is 1 meter.

    As an example, consider a target depth of say 100 meters, and a capture_delta of 5. When a diving vehicle reaches 95 meters, it will consider the depth achieved. However, it will continue to influence the vehicle to a depth of 100 meters for as a long as prescribed by the depth setting. The "achieving" of the depth results in two things: (a) the duration clock for time spent at that depth will begin, and (b) if there is a capture_flag set, this flag will be posted by the helm to the MOOSDB.

18.2.3   The depth Parameter    [top]


The depth parameter is a colon-separated list of comma-separated pairs. Each pair contains a desired depth and a duration at that depth. The duration applies from the point in time that the depth is first achieved. If a time duration is not provided for any pair, it defaults to zero. Thus depth=20 is a valid parameter setting.

    The duration is specified in seconds and reflects the time at depth after the vehicle has first achieved that depth, where achieving depth is defined by the capture_delta parameter. The behavior subscribes for NAV_DEPTH to examine the current vehicle depth against the target depth. If the current depth is within the delta given by capture_delta, that depth is considered to have been achieved. The behavior also stores the previous depth from the prior behavior iteration, and if the target depth is between the prior depth and current depth, the depth is considered to be achieved regardless of whether the prior or current depth is actually within the capture_delta.

18.2.4   The repeat Parameter    [top]


The number of times the vehicle will traverse through the evolution of depths, proceeding to the 1st depth after the nth depth has been hit. The default value is zero.

18.2.5   The perpetual Parameter    [top]


The perpetual parameter is defined at the superclass level, but it's worth discussing its function here. If equal to true, when the vehicle completes its evolution of depths (perhaps several evolutions if repeat is non-zero), the endflags will be posted. But rather than setting the complete variable to true and thus never receiving any further run consideration, the behavior is reset to its initial state. Presumably the user sets endflags that will cause the condition flags to be not immediately satisfied, thus putting the behavior in a state waiting again for an external event flag to be posted. The default value of this parameter is false.


Page built from LaTeX source using the texwiki program.