icub-client
Classes | Enumerations
allostaticController

Drive scheduler for the reactiveLayer Version:1.0 More...

+ Collaboration diagram for allostaticController:

Classes

struct  DriveOutCZ
 
class  AllostaticDrive
 
class  AllostaticController
 

Enumerations

enum  OutCZ {
  UNDER,
  OVER,
  UNDEFINED
}
 
enum  DriveUpdateMode {
  SENSATION_ON,
  SENSATION_OFF
}
 

Detailed Description

Drive scheduler for the reactiveLayer Version:1.0

Author
Jordi-Ysard Puigbò jordi.nosp@m.ysar.nosp@m.d@gma.nosp@m.il.c.nosp@m.om, Clément Moulin-Frier cleme.nosp@m.nt.m.nosp@m.oulin.nosp@m.-fri.nosp@m.er@up.nosp@m.f.ed.nosp@m.u, Stéphane Lallée steph.nosp@m.ane..nosp@m.lalle.nosp@m.e@gm.nosp@m.ail.c.nosp@m.om

Description

On top of the homeostasis module, the allostatic controller monitors all needs in homeostasis and triggers corresponding behaviors in function of which need requires to be addressed sooner. We call this pre-defined sensory-motor association a drive. This module creates needs in homeostasis from a config file or RPC command, and provides an interface to freeze them and change their parameters depending on their internal values. This module is strongly dependent on sensationManager, homeostasis and behaviorManager and is the core of the reactiveLayer. See the default.ini config file to see an example on how to define a new drive.

Parameters

Input Ports

Output Ports

Services


Class Documentation

◆ DriveOutCZ

struct DriveOutCZ

Definition at line 28 of file allostaticController.h.

Class Members
OutCZ level
string name

◆ AllostaticDrive

class AllostaticDrive

Definition at line 42 of file allostaticController.h.

Public Member Functions

 AllostaticDrive ()
 
bool interrupt_ports ()
 Interrupt ports of the drive. More...
 
bool close_ports ()
 Close ports of the drive. More...
 
Bottle update (DriveUpdateMode mode)
 
void triggerBehavior (OutCZ mode)
 triggers a behavior if needs are out of threshold More...
 

Public Attributes

string name
 Name of the drive. More...
 
bool active
 
bool manualMode
 
Port * behaviorUnderPort
 Port to be used when drive falls below homeostatic level. More...
 
Port * behaviorOverPort
 Port to be used when drive hits upper threshold of homeostatic level. More...
 
Port * homeoPort
 Port to homeostasis module. More...
 
BufferedPort< Bottle > * inputSensationPort
 Port from sensationManager. More...
 
Bottle behaviorUnderCmd
 Command to be send to behaviorUnderPort when drive falls below homeostatic level. More...
 
Bottle behaviorOverCmd
 Command to be send to behaviorOverPort when drive hits upper threshold of homeostatic level. More...
 
Bottle sensationOnCmd
 
Bottle sensationOffCmd
 
Bottle beforeTriggerCmd
 
Bottle afterTriggerCmd
 

Constructor & Destructor Documentation

◆ AllostaticDrive()

AllostaticDrive::AllostaticDrive ( )
inline

Definition at line 55 of file allostaticController.h.

Member Function Documentation

◆ close_ports()

bool AllostaticDrive::close_ports ( )

Close ports of the drive.

Definition at line 440 of file allostaticController.cpp.

◆ interrupt_ports()

bool AllostaticDrive::interrupt_ports ( )

Interrupt ports of the drive.

Definition at line 427 of file allostaticController.cpp.

◆ triggerBehavior()

void AllostaticDrive::triggerBehavior ( OutCZ  mode)

triggers a behavior if needs are out of threshold

Parameters
modeunder or below threshold

Definition at line 489 of file allostaticController.cpp.

◆ update()

Bottle AllostaticDrive::update ( DriveUpdateMode  mode)

Definition at line 462 of file allostaticController.cpp.

Member Data Documentation

◆ active

bool AllostaticDrive::active

Definition at line 46 of file allostaticController.h.

◆ afterTriggerCmd

Bottle AllostaticDrive::afterTriggerCmd

Definition at line 53 of file allostaticController.h.

◆ beforeTriggerCmd

Bottle AllostaticDrive::beforeTriggerCmd

Definition at line 53 of file allostaticController.h.

◆ behaviorOverCmd

Bottle AllostaticDrive::behaviorOverCmd

Command to be send to behaviorOverPort when drive hits upper threshold of homeostatic level.

Definition at line 52 of file allostaticController.h.

◆ behaviorOverPort

Port* AllostaticDrive::behaviorOverPort

Port to be used when drive hits upper threshold of homeostatic level.

Definition at line 48 of file allostaticController.h.

◆ behaviorUnderCmd

Bottle AllostaticDrive::behaviorUnderCmd

Command to be send to behaviorUnderPort when drive falls below homeostatic level.

Definition at line 51 of file allostaticController.h.

◆ behaviorUnderPort

Port* AllostaticDrive::behaviorUnderPort

Port to be used when drive falls below homeostatic level.

Definition at line 47 of file allostaticController.h.

◆ homeoPort

Port* AllostaticDrive::homeoPort

Port to homeostasis module.

Definition at line 49 of file allostaticController.h.

◆ inputSensationPort

BufferedPort<Bottle>* AllostaticDrive::inputSensationPort

Port from sensationManager.

Definition at line 50 of file allostaticController.h.

◆ manualMode

bool AllostaticDrive::manualMode

Definition at line 46 of file allostaticController.h.

◆ name

string AllostaticDrive::name

Name of the drive.

Definition at line 45 of file allostaticController.h.

◆ sensationOffCmd

Bottle AllostaticDrive::sensationOffCmd

Definition at line 53 of file allostaticController.h.

◆ sensationOnCmd

Bottle AllostaticDrive::sensationOnCmd

Definition at line 53 of file allostaticController.h.

◆ AllostaticController

class AllostaticController

Definition at line 86 of file allostaticController.h.

+ Inheritance diagram for AllostaticController:

Public Member Functions

 AllostaticController ()
 
bool configure (yarp::os::ResourceFinder &rf)
 
bool interruptModule ()
 
bool close ()
 
double getPeriod ()
 
bool updateModule ()
 
bool updateAllostatic ()
 updateAllostatic Update the drives accordingly to the stimuli More...
 
bool Normalize (vector< double > &vec)
 Normalize normalize drive priorities. More...
 
DriveOutCZ chooseDrive ()
 chooseDrive Choose a drive out of CZ, according to drive priorities More...
 
bool respond (const Bottle &cmd, Bottle &reply)
 

Constructor & Destructor Documentation

◆ AllostaticController()

AllostaticController::AllostaticController ( )
inline

Definition at line 120 of file allostaticController.h.

Member Function Documentation

◆ chooseDrive()

DriveOutCZ AllostaticController::chooseDrive ( )

chooseDrive Choose a drive out of CZ, according to drive priorities

Returns
bool success

Definition at line 312 of file allostaticController.cpp.

◆ close()

bool AllostaticController::close ( )

Definition at line 30 of file allostaticController.cpp.

◆ configure()

bool AllostaticController::configure ( yarp::os::ResourceFinder &  rf)

Definition at line 117 of file allostaticController.cpp.

◆ getPeriod()

double AllostaticController::getPeriod ( )
inline

Definition at line 129 of file allostaticController.h.

◆ interruptModule()

bool AllostaticController::interruptModule ( )

Definition at line 3 of file allostaticController.cpp.

◆ Normalize()

bool AllostaticController::Normalize ( vector< double > &  vec)

Normalize normalize drive priorities.

Parameters
veclist of priorities for each drive
Returns
bool false if no priority, true otherwise

Definition at line 273 of file allostaticController.cpp.

◆ respond()

bool AllostaticController::respond ( const Bottle &  cmd,
Bottle &  reply 
)

Definition at line 390 of file allostaticController.cpp.

◆ updateAllostatic()

bool AllostaticController::updateAllostatic ( )

updateAllostatic Update the drives accordingly to the stimuli

Returns
bool success

Definition at line 363 of file allostaticController.cpp.

◆ updateModule()

bool AllostaticController::updateModule ( )

Definition at line 284 of file allostaticController.cpp.

Enumeration Type Documentation

◆ DriveUpdateMode

Enumerator
SENSATION_ON 
SENSATION_OFF 

Definition at line 37 of file allostaticController.h.

◆ OutCZ

enum OutCZ
Enumerator
UNDER 
OVER 
UNDEFINED 

Definition at line 23 of file allostaticController.h.