icub-client
|
Module for quick control of default complex behaviors. More...
Classes | |
class | Behavior |
class | BehaviorManager |
class | Dummy |
class | MoveObject |
class | Pointing |
class | RecognitionOrder |
class | Tagging |
Module for quick control of default complex behaviors.
Version:1.0
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.
class Behavior |
Definition at line 13 of file behavior.h.
Public Member Functions | |
Behavior (yarp::os::Mutex *_mut, yarp::os::ResourceFinder &_rf, icubclient::ICubClient *_iCub, std::string _behaviorName) | |
Behavior ()=delete | |
No default constructor! More... | |
virtual | ~Behavior () |
void | openPorts (std::string port_name_prefix) |
openPorts open ports defined for a behavior More... | |
bool | trigger (const yarp::os::Bottle &args) |
trigger triggers this behavior and blocks the mutex More... | |
virtual void | configure ()=0 |
void | interrupt_ports () |
interrupt_ports interrupt ports defined for a behavior More... | |
void | close_ports () |
close_ports close ports defined for a behavior More... | |
Public Attributes | |
yarp::os::Port | rpc_out_port |
Port to external module. More... | |
std::string | behaviorName |
std::string | from_sensation_port_name |
std::string | external_port_name |
yarp::os::BufferedPort< yarp::os::Bottle > | sensation_port_in |
Input port from sensationManager. More... | |
Protected Member Functions | |
virtual void | run (const yarp::os::Bottle &args)=0 |
virtual void | close_extra_ports ()=0 |
Protected Attributes | |
icubclient::ICubClient * | iCub |
yarp::os::ResourceFinder & | rf |
|
inline |
Definition at line 30 of file behavior.h.
|
delete |
No default constructor!
|
inlinevirtual |
Definition at line 36 of file behavior.h.
|
protectedpure virtual |
Implemented in Dummy, RecognitionOrder, MoveObject, Pointing, and Tagging.
|
inline |
close_ports close ports defined for a behavior
Definition at line 97 of file behavior.h.
|
pure virtual |
Implemented in Dummy, MoveObject, RecognitionOrder, Pointing, and Tagging.
|
inline |
interrupt_ports interrupt ports defined for a behavior
Definition at line 88 of file behavior.h.
|
inline |
openPorts open ports defined for a behavior
port_name_prefix | unique prefix name for the port |
Definition at line 43 of file behavior.h.
|
protectedpure virtual |
Implemented in RecognitionOrder, Dummy, Tagging, Pointing, and MoveObject.
|
inline |
trigger triggers this behavior and blocks the mutex
args | bottle with arguments for this behaviours if not provided, taken from sensations or return error |
Definition at line 58 of file behavior.h.
std::string Behavior::behaviorName |
Definition at line 27 of file behavior.h.
std::string Behavior::external_port_name |
Definition at line 27 of file behavior.h.
std::string Behavior::from_sensation_port_name |
Definition at line 27 of file behavior.h.
|
protected |
Definition at line 20 of file behavior.h.
|
protected |
Definition at line 21 of file behavior.h.
yarp::os::Port Behavior::rpc_out_port |
Port to external module.
Definition at line 26 of file behavior.h.
yarp::os::BufferedPort<yarp::os::Bottle> Behavior::sensation_port_in |
Input port from sensationManager.
Definition at line 28 of file behavior.h.
class BehaviorManager |
Definition at line 12 of file behaviorManager.h.
Public Member Functions | |
BehaviorManager () | |
bool | configure (yarp::os::ResourceFinder &rf) |
bool | interruptModule () |
bool | close () |
double | getPeriod () |
bool | updateModule () |
bool | respond (const yarp::os::Bottle &cmd, yarp::os::Bottle &reply) |
|
inline |
Definition at line 28 of file behaviorManager.h.
bool BehaviorManager::close | ( | ) |
Definition at line 22 of file behaviorManager.cpp.
bool BehaviorManager::configure | ( | yarp::os::ResourceFinder & | rf | ) |
Definition at line 40 of file behaviorManager.cpp.
|
inline |
Definition at line 38 of file behaviorManager.h.
bool BehaviorManager::interruptModule | ( | ) |
Definition at line 12 of file behaviorManager.cpp.
bool BehaviorManager::respond | ( | const yarp::os::Bottle & | cmd, |
yarp::os::Bottle & | reply | ||
) |
Definition at line 122 of file behaviorManager.cpp.
bool BehaviorManager::updateModule | ( | ) |
Definition at line 116 of file behaviorManager.cpp.
class Dummy |
Public Member Functions | |
Dummy (yarp::os::Mutex *mut, yarp::os::ResourceFinder &rf, icubclient::ICubClient *iCub, std::string behaviorName) | |
void | configure () |
Public Member Functions inherited from Behavior | |
Behavior (yarp::os::Mutex *_mut, yarp::os::ResourceFinder &_rf, icubclient::ICubClient *_iCub, std::string _behaviorName) | |
Behavior ()=delete | |
No default constructor! More... | |
virtual | ~Behavior () |
void | openPorts (std::string port_name_prefix) |
openPorts open ports defined for a behavior More... | |
bool | trigger (const yarp::os::Bottle &args) |
trigger triggers this behavior and blocks the mutex More... | |
void | interrupt_ports () |
interrupt_ports interrupt ports defined for a behavior More... | |
void | close_ports () |
close_ports close ports defined for a behavior More... | |
Protected Member Functions | |
void | run (const yarp::os::Bottle &) |
void | close_extra_ports () |
Additional Inherited Members | |
Public Attributes inherited from Behavior | |
yarp::os::Port | rpc_out_port |
Port to external module. More... | |
std::string | behaviorName |
std::string | from_sensation_port_name |
std::string | external_port_name |
yarp::os::BufferedPort< yarp::os::Bottle > | sensation_port_in |
Input port from sensationManager. More... | |
Protected Attributes inherited from Behavior | |
icubclient::ICubClient * | iCub |
yarp::os::ResourceFinder & | rf |
|
inline |
|
inlineprotectedvirtual |
class MoveObject |
Definition at line 9 of file moveObject.h.
Public Member Functions | |
MoveObject (yarp::os::Mutex *mut, yarp::os::ResourceFinder &rf, icubclient::ICubClient *iCub, std::string behaviorName) | |
void | configure () |
Public Member Functions inherited from Behavior | |
Behavior (yarp::os::Mutex *_mut, yarp::os::ResourceFinder &_rf, icubclient::ICubClient *_iCub, std::string _behaviorName) | |
Behavior ()=delete | |
No default constructor! More... | |
virtual | ~Behavior () |
void | openPorts (std::string port_name_prefix) |
openPorts open ports defined for a behavior More... | |
bool | trigger (const yarp::os::Bottle &args) |
trigger triggers this behavior and blocks the mutex More... | |
void | interrupt_ports () |
interrupt_ports interrupt ports defined for a behavior More... | |
void | close_ports () |
close_ports close ports defined for a behavior More... | |
Protected Member Functions | |
void | run (const yarp::os::Bottle &args) |
void | close_extra_ports () |
Protected Attributes | |
double | target_pullback |
double | target_pushfront |
double | target_pushleft |
double | target_pushright |
Protected Attributes inherited from Behavior | |
icubclient::ICubClient * | iCub |
yarp::os::ResourceFinder & | rf |
Additional Inherited Members | |
Public Attributes inherited from Behavior | |
yarp::os::Port | rpc_out_port |
Port to external module. More... | |
std::string | behaviorName |
std::string | from_sensation_port_name |
std::string | external_port_name |
yarp::os::BufferedPort< yarp::os::Bottle > | sensation_port_in |
Input port from sensationManager. More... | |
|
inline |
Definition at line 24 of file moveObject.h.
|
inlineprotectedvirtual |
Implements Behavior.
Definition at line 19 of file moveObject.h.
|
virtual |
Implements Behavior.
Definition at line 6 of file moveObject.cpp.
|
protectedvirtual |
Implements Behavior.
Definition at line 14 of file moveObject.cpp.
|
protected |
Definition at line 14 of file moveObject.h.
|
protected |
Definition at line 15 of file moveObject.h.
|
protected |
Definition at line 16 of file moveObject.h.
|
protected |
Definition at line 17 of file moveObject.h.
class Pointing |
Definition at line 12 of file pointing.h.
Public Member Functions | |
Pointing (yarp::os::Mutex *mut, yarp::os::ResourceFinder &rf, icubclient::ICubClient *iCub, std::string behaviorName) | |
void | configure () |
Public Member Functions inherited from Behavior | |
Behavior (yarp::os::Mutex *_mut, yarp::os::ResourceFinder &_rf, icubclient::ICubClient *_iCub, std::string _behaviorName) | |
Behavior ()=delete | |
No default constructor! More... | |
virtual | ~Behavior () |
void | openPorts (std::string port_name_prefix) |
openPorts open ports defined for a behavior More... | |
bool | trigger (const yarp::os::Bottle &args) |
trigger triggers this behavior and blocks the mutex More... | |
void | interrupt_ports () |
interrupt_ports interrupt ports defined for a behavior More... | |
void | close_ports () |
close_ports close ports defined for a behavior More... | |
Protected Member Functions | |
void | run (const yarp::os::Bottle &args) |
void | close_extra_ports () |
Additional Inherited Members | |
Public Attributes inherited from Behavior | |
yarp::os::Port | rpc_out_port |
Port to external module. More... | |
std::string | behaviorName |
std::string | from_sensation_port_name |
std::string | external_port_name |
yarp::os::BufferedPort< yarp::os::Bottle > | sensation_port_in |
Input port from sensationManager. More... | |
Protected Attributes inherited from Behavior | |
icubclient::ICubClient * | iCub |
yarp::os::ResourceFinder & | rf |
|
inline |
Definition at line 22 of file pointing.h.
|
inlineprotectedvirtual |
Implements Behavior.
Definition at line 17 of file pointing.h.
|
virtual |
Implements Behavior.
Definition at line 7 of file pointing.cpp.
|
protectedvirtual |
Implements Behavior.
Definition at line 12 of file pointing.cpp.
class RecognitionOrder |
Definition at line 12 of file recognitionOrder.h.
Public Member Functions | |
RecognitionOrder (yarp::os::Mutex *mut, yarp::os::ResourceFinder &rf, icubclient::ICubClient *iCub, std::string behaviorName) | |
void | configure () |
Public Member Functions inherited from Behavior | |
Behavior (yarp::os::Mutex *_mut, yarp::os::ResourceFinder &_rf, icubclient::ICubClient *_iCub, std::string _behaviorName) | |
Behavior ()=delete | |
No default constructor! More... | |
virtual | ~Behavior () |
void | openPorts (std::string port_name_prefix) |
openPorts open ports defined for a behavior More... | |
bool | trigger (const yarp::os::Bottle &args) |
trigger triggers this behavior and blocks the mutex More... | |
void | interrupt_ports () |
interrupt_ports interrupt ports defined for a behavior More... | |
void | close_ports () |
close_ports close ports defined for a behavior More... | |
Public Attributes | |
bool | manual |
Public Attributes inherited from Behavior | |
yarp::os::Port | rpc_out_port |
Port to external module. More... | |
std::string | behaviorName |
std::string | from_sensation_port_name |
std::string | external_port_name |
yarp::os::BufferedPort< yarp::os::Bottle > | sensation_port_in |
Input port from sensationManager. More... | |
Protected Member Functions | |
void | run (const yarp::os::Bottle &args) |
void | close_extra_ports () |
Additional Inherited Members | |
Protected Attributes inherited from Behavior | |
icubclient::ICubClient * | iCub |
yarp::os::ResourceFinder & | rf |
|
inline |
Definition at line 27 of file recognitionOrder.h.
|
inlineprotectedvirtual |
Implements Behavior.
Definition at line 21 of file recognitionOrder.h.
|
virtual |
Implements Behavior.
Definition at line 6 of file recognitionOrder.cpp.
|
protectedvirtual |
Implements Behavior.
Definition at line 15 of file recognitionOrder.cpp.
bool RecognitionOrder::manual |
Definition at line 32 of file recognitionOrder.h.
class Tagging |
Public Member Functions | |
Tagging (yarp::os::Mutex *mut, yarp::os::ResourceFinder &rf, icubclient::ICubClient *iCub, std::string behaviorName) | |
void | configure () |
Public Member Functions inherited from Behavior | |
Behavior (yarp::os::Mutex *_mut, yarp::os::ResourceFinder &_rf, icubclient::ICubClient *_iCub, std::string _behaviorName) | |
Behavior ()=delete | |
No default constructor! More... | |
virtual | ~Behavior () |
void | openPorts (std::string port_name_prefix) |
openPorts open ports defined for a behavior More... | |
bool | trigger (const yarp::os::Bottle &args) |
trigger triggers this behavior and blocks the mutex More... | |
void | interrupt_ports () |
interrupt_ports interrupt ports defined for a behavior More... | |
void | close_ports () |
close_ports close ports defined for a behavior More... | |
Protected Member Functions | |
void | run (const yarp::os::Bottle &args) |
void | close_extra_ports () |
Additional Inherited Members | |
Public Attributes inherited from Behavior | |
yarp::os::Port | rpc_out_port |
Port to external module. More... | |
std::string | behaviorName |
std::string | from_sensation_port_name |
std::string | external_port_name |
yarp::os::BufferedPort< yarp::os::Bottle > | sensation_port_in |
Input port from sensationManager. More... | |
Protected Attributes inherited from Behavior | |
icubclient::ICubClient * | iCub |
yarp::os::ResourceFinder & | rf |
|
inline |
|
inlineprotectedvirtual |
|
virtual |
Implements Behavior.
Definition at line 7 of file tagging.cpp.
|
protectedvirtual |
Implements Behavior.
Definition at line 12 of file tagging.cpp.