<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">%=====================================================================
\section{The ConstantHeading Behavior}
%=====================================================================
\wikisec{grp=bhvsolo, file=BehaviorConstHeading,short=ConstHeading Behavior}
\label{bhv_constantheading}
%\index{IvP Behaviors Implemented!\var{BHV\_ConstantHeading}}
%\index{ConstantHeading Behavior}

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.  

%======================================================================
\subsection{Configuration Parameters}
\label{sec_const_hdg_params}

\input{includes/bhv_all_properties}

\begin{listing}{Configuration Parameters for the ConstantHeading Behavior}
\label{lst_bhv_const_hdg}
\small
\renewcommand{\arraystretch}{1.15}
\begin{longtable}{rp{0.76\textwidth}} 

  {\bf Parameter} &amp; {\bf Description} \\  

  \bvar{basewidth} &amp; The width of the base, in degrees, in the
  produced ZAIC-style IvP function. Section \ref{sec_const_hdg_ipf}. \\

  \bvar{complete\_thresh} &amp; The threshold in discrepancy between the
  the requested heading and present heading before the behavior
  completes.  The default is $-1$.  Section
  \ref{sec_const_hdg_complete}. \\

  \bvar{duration} &amp; Behavior duration, in seconds. Mandatory
  configuration for this behavior. Section \ref{sec_const_hdg_duration}. \\

  \bvar{heading} &amp; The desired heading of the vehicle, in degrees
  (North=0). \\

  \bvar{peakwidth} &amp; The width of the peak, in degrees, in the
  produced ZAIC-style IvP function. Section \ref{sec_const_hdg_ipf}. \\

  \bvar{summitdelta} &amp; The height of the summit delta parameter in the
  produced ZAIC-style IvP function. Section \ref{sec_const_hdg_ipf}. \\

  \bvar{heading\_mismatch\_var} &amp; Name of the MOOS variable indicating
  the present delta between the desired heading and the current
  heading. Section \ref{sec_const_hdg_pubs}.

\end{longtable}
\end{listing}
\normalsize

\vspace{0.15in}
\begin{listing}{Example Configuration Block}
\label{lst_bhv_const_hdg_ex}

\begin{fileverb}
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
               heading = 0            // default
  heading_mismatch_var = HDG_DIFF     // example
             peakwidth = 10           // default
           summitdelta = 25           // default
}
\end{fileverb}
\end{listing}



%====================================================================
\subsection{Variables Published}
\label{sec_const_hdg_pubs}

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
\bvar{heading\_mismatch\_var} parameter.  This variable will only be
published when the behavior is in the running state.

%====================================================================
\subsection{The \bvar{duration} Parameter}
\label{sec_const_hdg_duration}

The \bvar{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 \bvar{duration = no-time-limit} will
result in no time duration checks for this behavior.

%====================================================================
\subsection{Behavior Completion}
\label{sec_const_hdg_complete}

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 \bvar{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.

%====================================================================
\subsection{The ConstantHeading Objective Function}
\label{sec_const_hdg_ipf}

See Figure \ref{zaic-peak-overview-fig}.

\begin{itemize}

\item \bvar{basewidth}: The width of the base, in degrees in the
  produced objective function. The default is 170. See Figure
  \ref{zaic-peak-overview-fig} for more on the basewidth parameter
  used in the ZAIC tool for building IvP functions.

\item \bvar{peakwidth}: The width of the peak in degrees in the
  produced objective function. The default is 10.  See Figure
  \ref{zaic-peak-overview-fig} for more on the peak parameter used in
  the ZAIC tool for building IvP functions.

\item \bvar{summitdelta}: The width of the base, in meters in the
  produced objective function. The default is 25.  See Figure
  \ref{zaic-peak-overview-fig} for more on the summitdelta parameter
  used in the ZAIC tool for building IvP functions.
\end{itemize}



</pre></body></html>