Module for quick control of default complex behaviors.
More...
Module for quick control of default complex behaviors.
Version:1.0
- Author
- Clément Moulin-Frier cleme.nosp@m.nt.m.nosp@m.oulin.nosp@m.frie.nosp@m.r@gma.nosp@m.il.c.nosp@m.om, Jordi-Ysard Puigbò jordi.nosp@m.ysar.nosp@m.d.pui.nosp@m.gbo@.nosp@m.upf.e.nosp@m.du
- Copyright
- Released under the terms of the GNU GPL v2.0
Description
This module contains an interface to easily schedule behaviors. The interface allows the creation of default complex behaviors (e.g. asking for the name of an object while pointing to it and looking to a human partner). It allows to easily define this behaviors through calls to the icub-client library or other modules. This behaviours can receive arguments with additional metadata (e.g. internal ID of the object to ask for) or obtain this information from sensationManager. The behaviours are scheduled in order to avoid conflicts, only allowing one behaviour to run at the same time. Moreover, all drives can be called by an RPC command with the name and the corresponding arguments. Additionally, through a config file, the user can select which drives will be available at every execution. In the context of the reactiveLayer, behaviorManager exists to execute behaviors triggered by the drives in the allostaticController.
Find an example of a behavior in behaviorManager/src/tagging.cpp.
All necessary ports must be defined at the behavior creation and are connected automatically at the start of the behaviorManager instance.
Parameters
- – name : name of the module
- – period : change the update rate of this module
Input Ports
- /BehaviorManager/trigger:i [Bottle] [default carrier:tcp]: Response port. Supported commands:
- help
- ['behavior_name'] [arguments]: Triggers a behavior
- ['is_available'] : Replies behaviorManager availability
- ['names'] : Returns a list of all available behaviors
Output Ports
Services
◆ Behavior
Definition at line 13 of file behavior.h.
◆ Behavior() [1/2]
Behavior::Behavior |
( |
yarp::os::Mutex * |
_mut, |
|
|
yarp::os::ResourceFinder & |
_rf, |
|
|
icubclient::ICubClient * |
_iCub, |
|
|
std::string |
_behaviorName |
|
) |
| |
|
inline |
◆ Behavior() [2/2]
◆ ~Behavior()
virtual Behavior::~Behavior |
( |
| ) |
|
|
inlinevirtual |
◆ close_extra_ports()
virtual void Behavior::close_extra_ports |
( |
| ) |
|
|
protectedpure virtual |
◆ close_ports()
void Behavior::close_ports |
( |
| ) |
|
|
inline |
close_ports close ports defined for a behavior
Definition at line 97 of file behavior.h.
◆ configure()
virtual void Behavior::configure |
( |
| ) |
|
|
pure virtual |
◆ interrupt_ports()
void Behavior::interrupt_ports |
( |
| ) |
|
|
inline |
interrupt_ports interrupt ports defined for a behavior
Definition at line 88 of file behavior.h.
◆ openPorts()
void Behavior::openPorts |
( |
std::string |
port_name_prefix | ) |
|
|
inline |
openPorts open ports defined for a behavior
- Parameters
-
port_name_prefix | unique prefix name for the port |
- Returns
- void
Definition at line 43 of file behavior.h.
◆ run()
virtual void Behavior::run |
( |
const yarp::os::Bottle & |
args | ) |
|
|
protectedpure virtual |
◆ trigger()
bool Behavior::trigger |
( |
const yarp::os::Bottle & |
args | ) |
|
|
inline |
trigger triggers this behavior and blocks the mutex
- Parameters
-
args | bottle with arguments for this behaviours if not provided, taken from sensations or return error |
- Returns
- bool false if not triggered because of mutex blocked
Definition at line 58 of file behavior.h.
◆ behaviorName
std::string Behavior::behaviorName |
◆ external_port_name
std::string Behavior::external_port_name |
◆ from_sensation_port_name
std::string Behavior::from_sensation_port_name |
◆ iCub
◆ rf
yarp::os::ResourceFinder& Behavior::rf |
|
protected |
◆ rpc_out_port
yarp::os::Port Behavior::rpc_out_port |
Port to external module.
Definition at line 26 of file behavior.h.
◆ sensation_port_in
yarp::os::BufferedPort<yarp::os::Bottle> Behavior::sensation_port_in |
Input port from sensationManager.
Definition at line 28 of file behavior.h.
◆ BehaviorManager
Definition at line 12 of file behaviorManager.h.
◆ BehaviorManager()
BehaviorManager::BehaviorManager |
( |
| ) |
|
|
inline |
◆ close()
bool BehaviorManager::close |
( |
| ) |
|
◆ configure()
bool BehaviorManager::configure |
( |
yarp::os::ResourceFinder & |
rf | ) |
|
◆ getPeriod()
double BehaviorManager::getPeriod |
( |
| ) |
|
|
inline |
◆ interruptModule()
bool BehaviorManager::interruptModule |
( |
| ) |
|
◆ respond()
bool BehaviorManager::respond |
( |
const yarp::os::Bottle & |
cmd, |
|
|
yarp::os::Bottle & |
reply |
|
) |
| |
◆ updateModule()
bool BehaviorManager::updateModule |
( |
| ) |
|
◆ Dummy
Definition at line 12 of file dummy.h.
◆ Dummy()
Dummy::Dummy |
( |
yarp::os::Mutex * |
mut, |
|
|
yarp::os::ResourceFinder & |
rf, |
|
|
icubclient::ICubClient * |
iCub, |
|
|
std::string |
behaviorName |
|
) |
| |
|
inline |
◆ close_extra_ports()
void Dummy::close_extra_ports |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ configure()
void Dummy::configure |
( |
| ) |
|
|
inlinevirtual |
◆ run()
void Dummy::run |
( |
const yarp::os::Bottle & |
| ) |
|
|
inlineprotectedvirtual |
◆ MoveObject
Definition at line 9 of file moveObject.h.
◆ MoveObject()
MoveObject::MoveObject |
( |
yarp::os::Mutex * |
mut, |
|
|
yarp::os::ResourceFinder & |
rf, |
|
|
icubclient::ICubClient * |
iCub, |
|
|
std::string |
behaviorName |
|
) |
| |
|
inline |
◆ close_extra_ports()
void MoveObject::close_extra_ports |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ configure()
void MoveObject::configure |
( |
| ) |
|
|
virtual |
◆ run()
void MoveObject::run |
( |
const yarp::os::Bottle & |
args | ) |
|
|
protectedvirtual |
◆ target_pullback
double MoveObject::target_pullback |
|
protected |
◆ target_pushfront
double MoveObject::target_pushfront |
|
protected |
◆ target_pushleft
double MoveObject::target_pushleft |
|
protected |
◆ target_pushright
double MoveObject::target_pushright |
|
protected |
◆ Pointing
Definition at line 12 of file pointing.h.
◆ Pointing()
Pointing::Pointing |
( |
yarp::os::Mutex * |
mut, |
|
|
yarp::os::ResourceFinder & |
rf, |
|
|
icubclient::ICubClient * |
iCub, |
|
|
std::string |
behaviorName |
|
) |
| |
|
inline |
◆ close_extra_ports()
void Pointing::close_extra_ports |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ configure()
void Pointing::configure |
( |
| ) |
|
|
virtual |
◆ run()
void Pointing::run |
( |
const yarp::os::Bottle & |
args | ) |
|
|
protectedvirtual |
◆ RecognitionOrder
Definition at line 12 of file recognitionOrder.h.
◆ RecognitionOrder()
RecognitionOrder::RecognitionOrder |
( |
yarp::os::Mutex * |
mut, |
|
|
yarp::os::ResourceFinder & |
rf, |
|
|
icubclient::ICubClient * |
iCub, |
|
|
std::string |
behaviorName |
|
) |
| |
|
inline |
◆ close_extra_ports()
void RecognitionOrder::close_extra_ports |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ configure()
void RecognitionOrder::configure |
( |
| ) |
|
|
virtual |
◆ run()
void RecognitionOrder::run |
( |
const yarp::os::Bottle & |
args | ) |
|
|
protectedvirtual |
◆ manual
bool RecognitionOrder::manual |
◆ Tagging
Definition at line 13 of file tagging.h.
◆ Tagging()
Tagging::Tagging |
( |
yarp::os::Mutex * |
mut, |
|
|
yarp::os::ResourceFinder & |
rf, |
|
|
icubclient::ICubClient * |
iCub, |
|
|
std::string |
behaviorName |
|
) |
| |
|
inline |
◆ close_extra_ports()
void Tagging::close_extra_ports |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ configure()
void Tagging::configure |
( |
| ) |
|
|
virtual |
◆ run()
void Tagging::run |
( |
const yarp::os::Bottle & |
args | ) |
|
|
protectedvirtual |