The PeriodicSurface Behavior


Maintained by: mikerb@mit.edu         Get PDF


src: project-pavlab/bhvdocs/bhv_periodic_surface


1  The PeriodicSurface Behavior
     1.1 Configuration Parameters
     1.2 Detailed Discussions of Behavior Parameters
          1.2.1 The period Parameter
          1.2.2 The mark_variable Parameter
          1.2.3 The pending_status_var Parameter
          1.2.4 The atsurface_status_var Parameter
          1.2.5 The ascent_speed Parameter
          1.2.6 The ascent_grade Parameter
          1.2.7 The zero_speed_depth Parameter
          1.2.8 The max_time_at_surface Parameter
     1.3 Internal States of Periodic Surface Behavior

1   The PeriodicSurface Behavior


This behavior will periodically influence the depth and speed of the vehicle while remaining neutral at other times. The purpose is to bring the vehicle to the surface periodically to achieve some event specified by the user, typically the receipt of a GPS fix. Once this event is achieved, the behavior resets its internal clock to a given period length and will remain idle until a clock time-out occurs.

1.1   Configuration Parameters    [top]


Listing 1.1 - Configuration Parameters Common to All Behaviors.

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

Listing 1.2 - Configuration Parameters for the PeriodicSurface Behavior.

ParameterDescription
acomms_mark_variableThe incoming MOOS variable for resetting the acomms period clock.
ascent_gradeManner in which desired speed approaches zero on the approach to the surface. The default is linear. Section 1.2.6.
ascent_speedDesired speed of the vehicle during the ascent mode. Section 1.2.5.
atsurface_status_varMOOS variable indicating number of seconds at the surface. Section 1.2.4.
mark_variableThe incoming MOOS variable for resetting the period clock. Section 1.2.2.
max_time_at_surfaceThe maximum time, in seconds, the vehicle will wait at the surface. Section 1.2.8.
pending_status_varMOOS variable written to with remaining time on idle clock. Section 1.2.3.
periodDuration of the WAITING mode. Section 1.2.1.
zero_speed_depthThe depth, in meters, at which the desired speed becomes zero on ascent. Section 1.2.7.

Listing 1.3 - Example Configuration Block.

 Behavior = BHV_PeriodicSurface
 {
   // General Behavior Parameters
   // ---------------------------
   name         = periodic_surface   // example
   pwt          = 100                // default
   condition    = MODE==TRANSITING   // example
   updates      = PSURFACE_UPDATES   // example

   // Parameters specific to this behavior
   // ------------------------------------
   acomms_mark_variable = ACOMMS_RECEIVED       // example
           ascent_grade = linear                // default
           ascent_speed = -1                    // default
   atsurface_status_var = TIME_AT_SURFACE       // default
          mark_variable = GPS_UPDATE_RECEIVED   // default
    max_time_at_surface = 300                   // default
     pending_status_var = PENDING_SURFACE       // default
                 period = TIME_AT_SURFACE       // default
       zero_speed_depth = 0                     // default
 }

1.2   Detailed Discussions of Behavior Parameters    [top]


1.2.1   The period Parameter    [top]


The period parameter sets the duration of the period, in seconds, during which the behavior will remain in the IDLE_WAITING state.

1.2.2   The mark_variable Parameter    [top]


The mark_variable names a variable used for indicating when the behavior witnesses the event that would reset the period clock. On each iteration, the variable is checked against its last known value and if different, the clock is reset. The default value for this parameter is GPS_UPDATE_RECEIVED. If this variable is populated by another process with a value indicating the time a GPS fix is obtained, then the mark will occur on each GPS fix. Since the value of this argument names a MOOS variable, it is case sensitive.

1.2.3   The pending_status_var Parameter    [top]


The pending_status_var names a variable to be written to with the value of the remaining time on the idle clock, rounded to integer seconds. The default value is PENDING_SURFACE. Since the value of this argument names a MOOS variable, it is case sensitive.

1.2.4   The atsurface_status_var Parameter    [top]


The atsurface_status_var parameter names a variable to be written to with the number of seconds that the vehicle has been waiting at the surface (for the event indicated by the MOOS variable specified in the mark_variable parameter). The number of seconds is rounded to the nearest integer and will be zero when the vehicle is not at the surface. The default value is time_at_surface. Since the value of this parameter names a MOOS variable, it is case sensitive.

1.2.5   The ascent_speed Parameter    [top]


The ascent_speed parameter indicates the desired speed (m/s) of the vehicle during the ascent state. If left unspecified, the ascent speed will be equal to the current noted speed at moment it transitions into the ascent state.

1.2.6   The ascent_grade Parameter    [top]


The ascent_grade parameter indicates the manner in which the ascent speed approaches zero as the vehicle progresses toward the zero_speed_depth. It has four legal values: fullspeed, linear, quadratic, and quasi. The default is linear. In all four cases, the initial speed is determined by the parameter ascent_speed, and the desired speed will be zero once the zero_speed_depth has been achieved. The four settings determine the manner of slowing to zero speed during the ascent. The fullspeed setting indicates that desired speed should remain constant through the ascent right up to the instant the vehicle achieves zero_speed_depth. For the other three settings the speed reduction is relative to the starting depth (the depth noted at the outset of the ascent state) and the zero_speed_depth. With the linear setting, the speed reduction is linear. With the quadratic setting, the speed reduction is quadratic (quicker initial speed reduction). With the quasi setting the speed reduction is between linear and quadratic. The value passed to this parameter is not case sensitive.

1.2.7   The zero_speed_depth Parameter    [top]


The zero_speed_depth parameter sets the depth (in meters) during the ascent state at which the desired speed becomes zero, and presumably further ascent is achieved through positive buoyancy.

1.2.8   The max_time_at_surface Parameter    [top]


The max_time_at_surface parameter sets the maximum time (in seconds) spent in the AT_SURFACE state, waiting for the event indicated by the mvar_variable, before the behavior transitions into the IDLE state.

1.3   Internal States of Periodic Surface Behavior    [top]


The behavior can be in one of four states as described in Figure 1.1 below.

Figure 1.1: Possible modes of the PeriodicSurface behavior.

In the WAITING state the behavior is simply waiting for its clock to wind down to zero. The duration is given by the period parameter listed below. The clock is active despite any other run conditions that may apply to the behavior. It is started when the behavior is first instantiated and also when the desired event occurs at the surface. The ASCENDING_BLOCKED state indicates that the behavior timer has reached zero, but another run condition has not been met. This is to prevent the behavior from trying to surface the vehicle when other circumstances override the need to surface. In the ASCENDING state, the behavior will produce an objective function over depth and speed to bring the vehicle to the surface. A couple parameters described below can determine the trajectory of the vehicle during ascent. This state can transition back to the ASCENDING_BLOCKED state if run conditions become no longer satisfied prior to the vehicle reaching the surface. In the AT_SURFACE state the vehicle is at the surface waiting for a specified event.


Document Maintained by: mikerb@mit.edu        
Page built from LaTeX source using texwiki, developed at MIT. Errata to issues@moos-ivp.org. Get PDF