Behavior Group#
#include "navground/core/behavior_group.h"
Behavior group holds a list of behaviors for which they compute control commands at once.
Public Functions
Gets the members of the group.
- Returns:
The behaviors.
Returns the size of the group.
- Returns:
The number of behaviors
Protected Functions
Calculates the commands for all behaviors at once.
Commands should (but not strictly required) be feasible.
This method is called each time the behavior at the first index requires a command.
Users must override this method to define a BehaviorGroup.
- Parameters:
time_step – [in] The time step
- Returns:
The commands.
Members of a behavior group delegate the computation of their control commands to the group.
Warning
Users must call Behavior::prepare before the first call to Behavior::compute_cmd to setup the group and call Behavior::close after the last call to tear it down.
Public Types
A map of groups indexed by an integer key, which may be computed using hashing.
Public Functions
Gets the group.
- Returns:
The group.
Protected Functions
Makes a group.
Users must specialize this method when defining a new group/member pair.
- Returns:
The new group
Gets the key associated to the group.
Users can specialize this method when defining a new group/member pair. The default implementation returns 0, i.e., it groups all behaviors together.
- Returns:
The hash key.
Returns all groups.
Users must specialize this method when defining a new group/member pair.
- Returns:
All groups.