A class extending MjbotsControlLoop to compose a kodlab::BehaviorManager object and wrap some of the BehaviorManager's functions. This is intended to be extended by the user and act as the main control loop.
Provides an MjbotsBehaviorLoop class in the kodlab::mjbots namespace that holds a kodlab::BehaviorManager object.
This object extends MjbotsControlLoop and maintains the same template and intended implementation.
The MjbotsControlLoopUpdate method is overridden to call the BehaviorManagerUpdate, which itself calls the Update's of the selected behavior (as well as handling their Begin and Stop methods).
Provides wrappers for the AddBehavior and SetDefaultbehavior functions of the composed BehaviorManager which automatically include the shared pointer to the RobotBase-derived robot.
Provides an example of a user-implemented behavior loop which maintains several custom behaviors and demonstrates switching between them via LCM input.
This implementation has been tested with the behavior_robot_example.cpp example provided, which uses the various example behaviors provided in #39.
Note that this PR is 3/3 in the behavior implementation series and depends on the Behavior class introduced in #39 and the BehaviorManager class introduced in #40.
A class extending
MjbotsControlLoop
to compose akodlab::BehaviorManager
object and wrap some of theBehaviorManager
's functions. This is intended to be extended by the user and act as the main control loop.MjbotsBehaviorLoop
class in thekodlab::mjbots
namespace that holds akodlab::BehaviorManager
object.MjbotsControlLoop
and maintains the same template and intended implementation.MjbotsControlLoop
Update
method is overridden to call theBehaviorManager
Update
, which itself calls theUpdate
's of the selected behavior (as well as handling theirBegin
andStop
methods).AddBehavior
andSetDefaultbehavior
functions of the composedBehaviorManager
which automatically include the shared pointer to theRobotBase
-derived robot.This implementation has been tested with the
behavior_robot_example.cpp
example provided, which uses the various example behaviors provided in #39.Note that this PR is 3/3 in the behavior implementation series and depends on the
Behavior
class introduced in #39 and theBehaviorManager
class introduced in #40.