icub-client
Classes
World Representation

Contains classes to represent entities and relations between them. More...

+ Collaboration diagram for World Representation:

Classes

class  icubclient::Action
 Represents an action, whether composite or not. More...
 
struct  icubclient::Body
 Represent a the body of an agent. More...
 
class  icubclient::Agent
 Represent an agent. More...
 
class  icubclient::Bodypart
 Represents a body part of the robot. More...
 
class  icubclient::Entity
 Represent any entity that can be stored within the OPC. More...
 
class  icubclient::Object
 Represent any physical entity (including objects and agents) that can be stored within the OPC. More...
 
class  icubclient::Relation
 Represent a relation between two entities. More...
 

Detailed Description

Contains classes to represent entities and relations between them.

Those classes are meant to be accessed through the opcClient.

Author
Ugo Pattacini & Stéphane Lallée

Class Documentation

◆ icubclient::Action

class icubclient::Action

Represents an action, whether composite or not.

Stores as well the expected impact on the drives.

Definition at line 33 of file action.h.

+ Inheritance diagram for icubclient::Action:

Public Member Functions

 Action ()
 
 Action (const Action &b)
 
virtual bool isType (std::string _entityType) const
 Test if an entity is inheriting a given type. More...
 
void setInitialDescription (const Relation &r)
 
Relation description () const
 Return initialDescription as Relation. More...
 
Action express (const Relation &r) const
 
void append (Action &a)
 Append a subaction to create a composite one. More...
 
virtual std::list< ActionasPlan () const
 Get an unrolled plan description. More...
 
virtual std::list< ActionasPlan (const Relation &newDescription) const
 Get an unrolled plan description based on new arguments. More...
 
virtual bool isComposite ()
 Is an action composite or not? More...
 
int size ()
 Number of subactions composing this one. More...
 
virtual yarp::os::Bottle asBottle () const
 Number of subactions composing this one. More...
 
virtual bool fromBottle (const yarp::os::Bottle &b)
 Fill entity fields from a bottle representation. More...
 
virtual std::string toString () const
 Return a human readable description of the entity. More...
 
virtual void getPlanDrivesEffect (std::map< std::string, double > &driveEffects)
 Estimate the effect of this plan on a specific drive, by summing all the effects of subplans to this specific plan effect. More...
 
virtual std::string toString (const Relation &newRelation) const
 Gives the string according to a current situation. More...
 
- Public Member Functions inherited from icubclient::Entity
 Entity ()
 
 Entity (const Entity &b)
 
 Entity (yarp::os::Bottle &b)
 
virtual ~Entity ()
 
std::string name () const
 Return the name of an entity (which has to be unique within the OPC) More...
 
int opc_id () const
 Return the id of an entity (which has to be unique within the OPC) Typically, modules should employ the name() instead. More...
 
std::string properties (const std::string &p) const
 Returns the name of an entity contained in a property, returns the string "NULL" if property is not set Deprecated, do not use! More...
 
std::string entity_type () const
 Return the specific type of an entity. More...
 
bool operator== (const Entity &b) const
 
bool operator< (const Entity &b) const
 
bool operator> (const Entity &b) const
 

Public Attributes

std::map< std::string, double > estimatedDriveEffects
 Estimated effects on the drive. More...
 

Friends

class OPCClient
 

Additional Inherited Members

- Protected Member Functions inherited from icubclient::Entity
void changeName (std::string sName)
 
- Protected Attributes inherited from icubclient::Entity
std::string m_entity_type
 

Constructor & Destructor Documentation

◆ Action() [1/2]

Action::Action ( )

Definition at line 27 of file action.cpp.

◆ Action() [2/2]

Action::Action ( const Action b)

Definition at line 32 of file action.cpp.

Member Function Documentation

◆ append()

void Action::append ( Action a)

Append a subaction to create a composite one.

Parameters
aThe subaction

Definition at line 131 of file action.cpp.

◆ asBottle()

Bottle Action::asBottle ( ) const
virtual

Number of subactions composing this one.

Reimplemented from icubclient::Entity.

Definition at line 39 of file action.cpp.

◆ asPlan() [1/2]

list< Action > Action::asPlan ( ) const
virtual

Get an unrolled plan description.

Definition at line 136 of file action.cpp.

◆ asPlan() [2/2]

list< Action > Action::asPlan ( const Relation newDescription) const
virtual

Get an unrolled plan description based on new arguments.

Parameters
newDescriptionThe new arguments

Definition at line 151 of file action.cpp.

◆ description()

Relation Action::description ( ) const

Return initialDescription as Relation.

Definition at line 124 of file action.cpp.

◆ express()

Action Action::express ( const Relation r) const

Definition at line 104 of file action.cpp.

◆ fromBottle()

bool Action::fromBottle ( const yarp::os::Bottle &  b)
virtual

Fill entity fields from a bottle representation.

Parameters
ba pointer to the bottle containing the entity representation

Reimplemented from icubclient::Entity.

Definition at line 68 of file action.cpp.

◆ getPlanDrivesEffect()

void Action::getPlanDrivesEffect ( std::map< std::string, double > &  driveEffects)
virtual

Estimate the effect of this plan on a specific drive, by summing all the effects of subplans to this specific plan effect.

Definition at line 158 of file action.cpp.

◆ isComposite()

virtual bool icubclient::Action::isComposite ( )
inlinevirtual

Is an action composite or not?

Definition at line 81 of file action.h.

◆ isType()

virtual bool icubclient::Action::isType ( std::string  _entityType) const
inlinevirtual

Test if an entity is inheriting a given type.

Reimplemented from icubclient::Entity.

Definition at line 49 of file action.h.

◆ setInitialDescription()

void Action::setInitialDescription ( const Relation r)

Definition at line 99 of file action.cpp.

◆ size()

int icubclient::Action::size ( )
inline

Number of subactions composing this one.

Definition at line 86 of file action.h.

◆ toString() [1/2]

string Action::toString ( ) const
virtual

Return a human readable description of the entity.

Reimplemented from icubclient::Entity.

Definition at line 172 of file action.cpp.

◆ toString() [2/2]

string Action::toString ( const Relation newRelation) const
virtual

Gives the string according to a current situation.

Parameters
newRelationThe new arguments

Definition at line 177 of file action.cpp.

Friends And Related Function Documentation

◆ OPCClient

friend class OPCClient
friend

Definition at line 35 of file action.h.

Member Data Documentation

◆ estimatedDriveEffects

std::map<std::string, double> icubclient::Action::estimatedDriveEffects

Estimated effects on the drive.

Definition at line 44 of file action.h.

◆ icubclient::Body

struct icubclient::Body

Represent a the body of an agent.

Joints are stored as a dictionnary of string, position

Definition at line 33 of file agent.h.

Public Member Functions

 Body ()
 
yarp::os::Bottle asBottle () const
 
bool fromBottle (const yarp::os::Bottle &b)
 

Public Attributes

std::map< std::string, yarp::sig::VectorOf< double > > m_parts
 

Constructor & Destructor Documentation

◆ Body()

icubclient::Body::Body ( )
inline

Definition at line 37 of file agent.h.

Member Function Documentation

◆ asBottle()

yarp::os::Bottle icubclient::Body::asBottle ( ) const
inline

Definition at line 56 of file agent.h.

◆ fromBottle()

bool icubclient::Body::fromBottle ( const yarp::os::Bottle &  b)
inline

Definition at line 73 of file agent.h.

Member Data Documentation

◆ m_parts

std::map<std::string, yarp::sig::VectorOf<double> > icubclient::Body::m_parts

Definition at line 35 of file agent.h.

◆ icubclient::Agent

class icubclient::Agent

Represent an agent.

An agent is a Object which possesses emotions and beliefs. Beliefs are encoded as a list of relations.

Definition at line 93 of file agent.h.

+ Inheritance diagram for icubclient::Agent:

Public Member Functions

 Agent ()
 
 Agent (const Agent &b)
 
virtual bool isType (std::string _entityType) const
 Test if an entity is inheriting a given type. More...
 
virtual yarp::os::Bottle asBottle () const
 Return the entity as a bottle. More...
 
virtual bool fromBottle (const yarp::os::Bottle &b)
 Fill entity fields from a bottle representation. More...
 
virtual std::string toString () const
 Return a human readable description of the entity. More...
 
bool addBelief (const Relation &r)
 Add the belief of a relation to the agent. More...
 
bool removeBelief (const Relation &r)
 Remove the belief of a relation from the agent. More...
 
bool checkBelief (const Relation &r) const
 Check if some relation is believed by an agent. More...
 
const std::list< Relation > & beliefs () const
 Get a read-only copy of the agent believes. More...
 
- Public Member Functions inherited from icubclient::Object
 Object ()
 
 Object (const Object &b)
 
yarp::sig::VectorOf< double > getSelfRelativePosition (const yarp::sig::VectorOf< double > &vInitialRoot) const
 Express a point given in the initial ego-centered reference frame in respect to the object reference frame. More...
 
std::string objectAreaAsString () const
 
double saliency () const
 Get saliency of object. More...
 
void setSaliency (double saliency)
 Set saliency of object. More...
 
double value () const
 Get value of object. More...
 
void setValue (double value)
 Set value of object. More...
 
- Public Member Functions inherited from icubclient::Entity
 Entity ()
 
 Entity (const Entity &b)
 
 Entity (yarp::os::Bottle &b)
 
virtual ~Entity ()
 
std::string name () const
 Return the name of an entity (which has to be unique within the OPC) More...
 
int opc_id () const
 Return the id of an entity (which has to be unique within the OPC) Typically, modules should employ the name() instead. More...
 
std::string properties (const std::string &p) const
 Returns the name of an entity contained in a property, returns the string "NULL" if property is not set Deprecated, do not use! More...
 
std::string entity_type () const
 Return the specific type of an entity. More...
 
bool operator== (const Entity &b) const
 
bool operator< (const Entity &b) const
 
bool operator> (const Entity &b) const
 

Public Attributes

std::map< std::string, double > m_emotions_intrinsic
 
Body m_body
 
- Public Attributes inherited from icubclient::Object
yarp::sig::VectorOf< double > m_ego_position
 Position of the Object, in the initial ego-centered reference frame of the agent mainting the OPC (initial root of the iCub). More...
 
yarp::sig::VectorOf< double > m_ego_orientation
 Orientation of the Object, in the initial ego-centered reference frame of the agent mainting the OPC (initial root of the iCub). More...
 
yarp::sig::VectorOf< double > m_dimensions
 Dimensions of the Object, in meters. More...
 
yarp::sig::VectorOf< double > m_color
 Mean color of the object (r,g,b) used mainly for debugging/displaying purposes in the iCubGUI. More...
 
double m_present
 Is the object present in the scene A value of 1.0 means that the object currently is in the scene A value of 0.5 means that the object is likely to be in the scene, but not currently visible by the iCub A value of 0.0 means that the object is currently not in the scene. More...
 
double m_saliency
 A measurement of the object saliency [0,1]. More...
 
ObjectArea m_objectarea
 Whether the object is accessible by only the robot, only the human, both or neither agent. More...
 
double m_value
 A measurement of the object subjective value [0,1]. More...
 

Friends

class OPCClient
 

Additional Inherited Members

- Static Public Member Functions inherited from icubclient::Object
static std::string objectAreaAsString (const icubclient::ObjectArea &o)
 
static icubclient::ObjectArea stringToObjectArea (const std::string &o)
 
- Protected Member Functions inherited from icubclient::Entity
void changeName (std::string sName)
 
- Protected Attributes inherited from icubclient::Entity
std::string m_entity_type
 

Constructor & Destructor Documentation

◆ Agent() [1/2]

Agent::Agent ( )

Definition at line 28 of file agent.cpp.

◆ Agent() [2/2]

Agent::Agent ( const Agent b)

Definition at line 34 of file agent.cpp.

Member Function Documentation

◆ addBelief()

bool Agent::addBelief ( const Relation r)

Add the belief of a relation to the agent.

Parameters
ra relation that the agent will believe to be true

Definition at line 127 of file agent.cpp.

◆ asBottle()

Bottle Agent::asBottle ( ) const
virtual

Return the entity as a bottle.

Reimplemented from icubclient::Object.

Definition at line 41 of file agent.cpp.

◆ beliefs()

const std::list< Relation > & Agent::beliefs ( ) const

Get a read-only copy of the agent believes.

Definition at line 161 of file agent.cpp.

◆ checkBelief()

bool Agent::checkBelief ( const Relation r) const

Check if some relation is believed by an agent.

Parameters
ra relation to check

Definition at line 156 of file agent.cpp.

◆ fromBottle()

bool Agent::fromBottle ( const yarp::os::Bottle &  b)
virtual

Fill entity fields from a bottle representation.

Parameters
ba pointer to the bottle containing the entity representation

Reimplemented from icubclient::Object.

Definition at line 74 of file agent.cpp.

◆ isType()

virtual bool icubclient::Agent::isType ( std::string  _entityType) const
inlinevirtual

Test if an entity is inheriting a given type.

Reimplemented from icubclient::Object.

Definition at line 105 of file agent.h.

◆ removeBelief()

bool Agent::removeBelief ( const Relation r)

Remove the belief of a relation from the agent.

Parameters
ra relation that the agent will believe not to be true

Definition at line 142 of file agent.cpp.

◆ toString()

string Agent::toString ( ) const
virtual

Return a human readable description of the entity.

Reimplemented from icubclient::Object.

Definition at line 107 of file agent.cpp.

Friends And Related Function Documentation

◆ OPCClient

friend class OPCClient
friend

Definition at line 95 of file agent.h.

Member Data Documentation

◆ m_body

Body icubclient::Agent::m_body

Definition at line 103 of file agent.h.

◆ m_emotions_intrinsic

std::map<std::string, double> icubclient::Agent::m_emotions_intrinsic

Definition at line 102 of file agent.h.

◆ icubclient::Bodypart

class icubclient::Bodypart

Represents a body part of the robot.

Definition at line 29 of file bodypart.h.

+ Inheritance diagram for icubclient::Bodypart:

Public Member Functions

 Bodypart ()
 
 Bodypart (const Bodypart &b)
 
virtual bool isType (std::string _entityType) const
 Test if an entity is inheriting a given type. More...
 
virtual yarp::os::Bottle asBottle () const
 Return the entity as a bottle. More...
 
virtual bool fromBottle (const yarp::os::Bottle &b)
 Fill entity fields from a bottle representation. More...
 
virtual std::string toString () const
 Return a human readable description of the entity. More...
 
- Public Member Functions inherited from icubclient::Object
 Object ()
 
 Object (const Object &b)
 
yarp::sig::VectorOf< double > getSelfRelativePosition (const yarp::sig::VectorOf< double > &vInitialRoot) const
 Express a point given in the initial ego-centered reference frame in respect to the object reference frame. More...
 
std::string objectAreaAsString () const
 
double saliency () const
 Get saliency of object. More...
 
void setSaliency (double saliency)
 Set saliency of object. More...
 
double value () const
 Get value of object. More...
 
void setValue (double value)
 Set value of object. More...
 
- Public Member Functions inherited from icubclient::Entity
 Entity ()
 
 Entity (const Entity &b)
 
 Entity (yarp::os::Bottle &b)
 
virtual ~Entity ()
 
std::string name () const
 Return the name of an entity (which has to be unique within the OPC) More...
 
int opc_id () const
 Return the id of an entity (which has to be unique within the OPC) Typically, modules should employ the name() instead. More...
 
std::string properties (const std::string &p) const
 Returns the name of an entity contained in a property, returns the string "NULL" if property is not set Deprecated, do not use! More...
 
std::string entity_type () const
 Return the specific type of an entity. More...
 
bool operator== (const Entity &b) const
 
bool operator< (const Entity &b) const
 
bool operator> (const Entity &b) const
 

Public Attributes

int m_joint_number
 Joint number of the represented body part. More...
 
int m_tactile_number
 Tactile number of the represented body part. More...
 
std::string m_part
 The part itself, e.g. More...
 
std::string m_kinectNode
 The string labelling the kinect node (of a human kinematic structure, one of the ICUBCLIENT_OPC_BODY_PART_TYPE_XXX) that corresponds to the iCub's joint. More...
 
- Public Attributes inherited from icubclient::Object
yarp::sig::VectorOf< double > m_ego_position
 Position of the Object, in the initial ego-centered reference frame of the agent mainting the OPC (initial root of the iCub). More...
 
yarp::sig::VectorOf< double > m_ego_orientation
 Orientation of the Object, in the initial ego-centered reference frame of the agent mainting the OPC (initial root of the iCub). More...
 
yarp::sig::VectorOf< double > m_dimensions
 Dimensions of the Object, in meters. More...
 
yarp::sig::VectorOf< double > m_color
 Mean color of the object (r,g,b) used mainly for debugging/displaying purposes in the iCubGUI. More...
 
double m_present
 Is the object present in the scene A value of 1.0 means that the object currently is in the scene A value of 0.5 means that the object is likely to be in the scene, but not currently visible by the iCub A value of 0.0 means that the object is currently not in the scene. More...
 
double m_saliency
 A measurement of the object saliency [0,1]. More...
 
ObjectArea m_objectarea
 Whether the object is accessible by only the robot, only the human, both or neither agent. More...
 
double m_value
 A measurement of the object subjective value [0,1]. More...
 

Friends

class OPCClient
 

Additional Inherited Members

- Static Public Member Functions inherited from icubclient::Object
static std::string objectAreaAsString (const icubclient::ObjectArea &o)
 
static icubclient::ObjectArea stringToObjectArea (const std::string &o)
 
- Protected Member Functions inherited from icubclient::Entity
void changeName (std::string sName)
 
- Protected Attributes inherited from icubclient::Entity
std::string m_entity_type
 

Constructor & Destructor Documentation

◆ Bodypart() [1/2]

Bodypart::Bodypart ( )

Definition at line 25 of file bodypart.cpp.

◆ Bodypart() [2/2]

Bodypart::Bodypart ( const Bodypart b)

Definition at line 36 of file bodypart.cpp.

Member Function Documentation

◆ asBottle()

Bottle Bodypart::asBottle ( ) const
virtual

Return the entity as a bottle.

Reimplemented from icubclient::Object.

Definition at line 46 of file bodypart.cpp.

◆ fromBottle()

bool Bodypart::fromBottle ( const yarp::os::Bottle &  b)
virtual

Fill entity fields from a bottle representation.

Parameters
ba pointer to the bottle containing the entity representation

Reimplemented from icubclient::Object.

Definition at line 87 of file bodypart.cpp.

◆ isType()

virtual bool icubclient::Bodypart::isType ( std::string  _entityType) const
inlinevirtual

Test if an entity is inheriting a given type.

Reimplemented from icubclient::Object.

Definition at line 55 of file bodypart.h.

◆ toString()

string Bodypart::toString ( ) const
virtual

Return a human readable description of the entity.

Reimplemented from icubclient::Object.

Definition at line 72 of file bodypart.cpp.

Friends And Related Function Documentation

◆ OPCClient

friend class OPCClient
friend

Definition at line 31 of file bodypart.h.

Member Data Documentation

◆ m_joint_number

int icubclient::Bodypart::m_joint_number

Joint number of the represented body part.

Definition at line 38 of file bodypart.h.

◆ m_kinectNode

std::string icubclient::Bodypart::m_kinectNode

The string labelling the kinect node (of a human kinematic structure, one of the ICUBCLIENT_OPC_BODY_PART_TYPE_XXX) that corresponds to the iCub's joint.

Definition at line 53 of file bodypart.h.

◆ m_part

std::string icubclient::Bodypart::m_part

The part itself, e.g.

left_arm, right_arm, ...

Definition at line 48 of file bodypart.h.

◆ m_tactile_number

int icubclient::Bodypart::m_tactile_number

Tactile number of the represented body part.

Definition at line 43 of file bodypart.h.

◆ icubclient::Entity

class icubclient::Entity

Represent any entity that can be stored within the OPC.

All representations derive from entities.

Definition at line 40 of file entity.h.

+ Inheritance diagram for icubclient::Entity:

Public Member Functions

 Entity ()
 
 Entity (const Entity &b)
 
 Entity (yarp::os::Bottle &b)
 
virtual ~Entity ()
 
virtual bool isType (std::string _entityType) const
 Test if an entity is inheriting a given type. More...
 
virtual yarp::os::Bottle asBottle () const
 Return the entity as a bottle. More...
 
virtual bool fromBottle (const yarp::os::Bottle &b)
 Fill entity fields from a bottle representation. More...
 
virtual std::string toString () const
 Return a human readable description of the entity. More...
 
std::string name () const
 Return the name of an entity (which has to be unique within the OPC) More...
 
int opc_id () const
 Return the id of an entity (which has to be unique within the OPC) Typically, modules should employ the name() instead. More...
 
std::string properties (const std::string &p) const
 Returns the name of an entity contained in a property, returns the string "NULL" if property is not set Deprecated, do not use! More...
 
std::string entity_type () const
 Return the specific type of an entity. More...
 
bool operator== (const Entity &b) const
 
bool operator< (const Entity &b) const
 
bool operator> (const Entity &b) const
 

Protected Member Functions

void changeName (std::string sName)
 

Protected Attributes

std::string m_entity_type
 

Friends

class OPCClient
 

Constructor & Destructor Documentation

◆ Entity() [1/3]

Entity::Entity ( )

Definition at line 31 of file entity.cpp.

◆ Entity() [2/3]

Entity::Entity ( const Entity b)

Definition at line 38 of file entity.cpp.

◆ Entity() [3/3]

Entity::Entity ( yarp::os::Bottle &  b)

Definition at line 25 of file entity.cpp.

◆ ~Entity()

virtual icubclient::Entity::~Entity ( )
inlinevirtual

Definition at line 62 of file entity.h.

Member Function Documentation

◆ asBottle()

Bottle Entity::asBottle ( ) const
virtual

Return the entity as a bottle.

Reimplemented in icubclient::Agent, icubclient::Object, icubclient::Action, and icubclient::Bodypart.

Definition at line 45 of file entity.cpp.

◆ changeName()

void Entity::changeName ( std::string  sName)
protected

Definition at line 149 of file entity.cpp.

◆ entity_type()

std::string icubclient::Entity::entity_type ( ) const
inline

Return the specific type of an entity.

Definition at line 121 of file entity.h.

◆ fromBottle()

bool Entity::fromBottle ( const yarp::os::Bottle &  b)
virtual

Fill entity fields from a bottle representation.

Parameters
ba pointer to the bottle containing the entity representation

Reimplemented in icubclient::Agent, icubclient::Object, icubclient::Action, and icubclient::Bodypart.

Definition at line 95 of file entity.cpp.

◆ isType()

virtual bool icubclient::Entity::isType ( std::string  _entityType) const
inlinevirtual

Test if an entity is inheriting a given type.

Reimplemented in icubclient::Agent, icubclient::Object, icubclient::Bodypart, and icubclient::Action.

Definition at line 67 of file entity.h.

◆ name()

std::string icubclient::Entity::name ( ) const
inline

Return the name of an entity (which has to be unique within the OPC)

Definition at line 93 of file entity.h.

◆ opc_id()

int icubclient::Entity::opc_id ( ) const
inline

Return the id of an entity (which has to be unique within the OPC) Typically, modules should employ the name() instead.

Definition at line 101 of file entity.h.

◆ operator<()

bool Entity::operator< ( const Entity b) const

Definition at line 137 of file entity.cpp.

◆ operator==()

bool Entity::operator== ( const Entity b) const

Definition at line 131 of file entity.cpp.

◆ operator>()

bool Entity::operator> ( const Entity b) const

Definition at line 143 of file entity.cpp.

◆ properties()

std::string icubclient::Entity::properties ( const std::string &  p) const
inline

Returns the name of an entity contained in a property, returns the string "NULL" if property is not set Deprecated, do not use!

Definition at line 109 of file entity.h.

◆ toString()

string Entity::toString ( ) const
virtual

Return a human readable description of the entity.

Reimplemented in icubclient::Agent, icubclient::Object, icubclient::Action, and icubclient::Bodypart.

Definition at line 116 of file entity.cpp.

Friends And Related Function Documentation

◆ OPCClient

friend class OPCClient
friend

Definition at line 42 of file entity.h.

Member Data Documentation

◆ m_entity_type

std::string icubclient::Entity::m_entity_type
protected

Definition at line 55 of file entity.h.

◆ icubclient::Object

class icubclient::Object

Represent any physical entity (including objects and agents) that can be stored within the OPC.

Definition at line 35 of file object.h.

+ Inheritance diagram for icubclient::Object:

Public Member Functions

 Object ()
 
 Object (const Object &b)
 
virtual bool isType (std::string _entityType) const
 Test if an entity is inheriting a given type. More...
 
virtual yarp::os::Bottle asBottle () const
 Return the entity as a bottle. More...
 
virtual bool fromBottle (const yarp::os::Bottle &b)
 Fill entity fields from a bottle representation. More...
 
virtual std::string toString () const
 Return a human readable description of the entity. More...
 
yarp::sig::VectorOf< double > getSelfRelativePosition (const yarp::sig::VectorOf< double > &vInitialRoot) const
 Express a point given in the initial ego-centered reference frame in respect to the object reference frame. More...
 
std::string objectAreaAsString () const
 
double saliency () const
 Get saliency of object. More...
 
void setSaliency (double saliency)
 Set saliency of object. More...
 
double value () const
 Get value of object. More...
 
void setValue (double value)
 Set value of object. More...
 
- Public Member Functions inherited from icubclient::Entity
 Entity ()
 
 Entity (const Entity &b)
 
 Entity (yarp::os::Bottle &b)
 
virtual ~Entity ()
 
std::string name () const
 Return the name of an entity (which has to be unique within the OPC) More...
 
int opc_id () const
 Return the id of an entity (which has to be unique within the OPC) Typically, modules should employ the name() instead. More...
 
std::string properties (const std::string &p) const
 Returns the name of an entity contained in a property, returns the string "NULL" if property is not set Deprecated, do not use! More...
 
std::string entity_type () const
 Return the specific type of an entity. More...
 
bool operator== (const Entity &b) const
 
bool operator< (const Entity &b) const
 
bool operator> (const Entity &b) const
 

Static Public Member Functions

static std::string objectAreaAsString (const icubclient::ObjectArea &o)
 
static icubclient::ObjectArea stringToObjectArea (const std::string &o)
 

Public Attributes

yarp::sig::VectorOf< double > m_ego_position
 Position of the Object, in the initial ego-centered reference frame of the agent mainting the OPC (initial root of the iCub). More...
 
yarp::sig::VectorOf< double > m_ego_orientation
 Orientation of the Object, in the initial ego-centered reference frame of the agent mainting the OPC (initial root of the iCub). More...
 
yarp::sig::VectorOf< double > m_dimensions
 Dimensions of the Object, in meters. More...
 
yarp::sig::VectorOf< double > m_color
 Mean color of the object (r,g,b) used mainly for debugging/displaying purposes in the iCubGUI. More...
 
double m_present
 Is the object present in the scene A value of 1.0 means that the object currently is in the scene A value of 0.5 means that the object is likely to be in the scene, but not currently visible by the iCub A value of 0.0 means that the object is currently not in the scene. More...
 
double m_saliency
 A measurement of the object saliency [0,1]. More...
 
ObjectArea m_objectarea
 Whether the object is accessible by only the robot, only the human, both or neither agent. More...
 
double m_value
 A measurement of the object subjective value [0,1]. More...
 

Friends

class OPCClient
 

Additional Inherited Members

- Protected Member Functions inherited from icubclient::Entity
void changeName (std::string sName)
 
- Protected Attributes inherited from icubclient::Entity
std::string m_entity_type
 

Constructor & Destructor Documentation

◆ Object() [1/2]

Object::Object ( )

Definition at line 28 of file object.cpp.

◆ Object() [2/2]

Object::Object ( const Object b)

Definition at line 45 of file object.cpp.

Member Function Documentation

◆ asBottle()

Bottle Object::asBottle ( ) const
virtual

Return the entity as a bottle.

Reimplemented from icubclient::Entity.

Reimplemented in icubclient::Agent, and icubclient::Bodypart.

Definition at line 78 of file object.cpp.

◆ fromBottle()

bool Object::fromBottle ( const yarp::os::Bottle &  b)
virtual

Fill entity fields from a bottle representation.

Parameters
ba pointer to the bottle containing the entity representation

Reimplemented from icubclient::Entity.

Reimplemented in icubclient::Agent, and icubclient::Bodypart.

Definition at line 169 of file object.cpp.

◆ getSelfRelativePosition()

Vector Object::getSelfRelativePosition ( const yarp::sig::VectorOf< double > &  vInitialRoot) const

Express a point given in the initial ego-centered reference frame in respect to the object reference frame.

Parameters
vInitialRootthe point to transform
Returns
The transformed vector (x y z)

Definition at line 236 of file object.cpp.

◆ isType()

virtual bool icubclient::Object::isType ( std::string  _entityType) const
inlinevirtual

Test if an entity is inheriting a given type.

Reimplemented from icubclient::Entity.

Reimplemented in icubclient::Agent, and icubclient::Bodypart.

Definition at line 86 of file object.h.

◆ objectAreaAsString() [1/2]

std::string icubclient::Object::objectAreaAsString ( ) const
inline

Definition at line 106 of file object.h.

◆ objectAreaAsString() [2/2]

std::string Object::objectAreaAsString ( const icubclient::ObjectArea o)
static

Definition at line 254 of file object.cpp.

◆ saliency()

double Object::saliency ( ) const

Get saliency of object.

Returns
saliency of object

Definition at line 67 of file object.cpp.

◆ setSaliency()

void Object::setSaliency ( double  saliency)

Set saliency of object.

Parameters
saliency- New saliency value

Definition at line 72 of file object.cpp.

◆ setValue()

void Object::setValue ( double  value)

Set value of object.

Parameters
value- New value

Definition at line 62 of file object.cpp.

◆ stringToObjectArea()

ObjectArea Object::stringToObjectArea ( const std::string &  o)
static

Definition at line 269 of file object.cpp.

◆ toString()

string Object::toString ( ) const
virtual

Return a human readable description of the entity.

Reimplemented from icubclient::Entity.

Reimplemented in icubclient::Agent, and icubclient::Bodypart.

Definition at line 213 of file object.cpp.

◆ value()

double Object::value ( ) const

Get value of object.

Returns
value of object

Definition at line 57 of file object.cpp.

Friends And Related Function Documentation

◆ OPCClient

friend class OPCClient
friend

Definition at line 37 of file object.h.

Member Data Documentation

◆ m_color

yarp::sig::VectorOf<double> icubclient::Object::m_color

Mean color of the object (r,g,b) used mainly for debugging/displaying purposes in the iCubGUI.

Definition at line 61 of file object.h.

◆ m_dimensions

yarp::sig::VectorOf<double> icubclient::Object::m_dimensions

Dimensions of the Object, in meters.

Definition at line 56 of file object.h.

◆ m_ego_orientation

yarp::sig::VectorOf<double> icubclient::Object::m_ego_orientation

Orientation of the Object, in the initial ego-centered reference frame of the agent mainting the OPC (initial root of the iCub).

Definition at line 51 of file object.h.

◆ m_ego_position

yarp::sig::VectorOf<double> icubclient::Object::m_ego_position

Position of the Object, in the initial ego-centered reference frame of the agent mainting the OPC (initial root of the iCub).

Definition at line 46 of file object.h.

◆ m_objectarea

ObjectArea icubclient::Object::m_objectarea

Whether the object is accessible by only the robot, only the human, both or neither agent.

Definition at line 79 of file object.h.

◆ m_present

double icubclient::Object::m_present

Is the object present in the scene A value of 1.0 means that the object currently is in the scene A value of 0.5 means that the object is likely to be in the scene, but not currently visible by the iCub A value of 0.0 means that the object is currently not in the scene.

Definition at line 69 of file object.h.

◆ m_saliency

double icubclient::Object::m_saliency

A measurement of the object saliency [0,1].

Definition at line 74 of file object.h.

◆ m_value

double icubclient::Object::m_value

A measurement of the object subjective value [0,1].

Definition at line 84 of file object.h.

◆ icubclient::Relation

class icubclient::Relation

Represent a relation between two entities.

Definition at line 31 of file relation.h.

Public Member Functions

 Relation ()
 
 Relation (yarp::os::Bottle &b)
 
 Relation (std::string subject, std::string verb, std::string object="none", std::string complement_place="none", std::string complement_time="none", std::string complement_manner="none")
 
 Relation (Entity *subject, Entity *verb, Entity *object=nullptr, Entity *complement_place=nullptr, Entity *complement_time=nullptr, Entity *complement_manner=nullptr)
 
virtual ~Relation ()
 
yarp::os::Bottle asBottle (bool ignoreID=false) const
 
yarp::os::Bottle asLightBottle () const
 Return the relation as a bottle without the argument to "none". More...
 
void fromBottle (const yarp::os::Bottle &b)
 Create a Relation from a Bottle. More...
 
virtual std::string toString () const
 Return string representation of this Relation. More...
 
int ID () const
 Get the opc ID of the relation. More...
 
std::string subject () const
 Get the name of the relation's subject. More...
 
std::string object () const
 Get the name of the relation's object. More...
 
std::string verb () const
 Get the type of the relation. More...
 
std::string complement_place () const
 Get the complement of place of the relation. More...
 
std::string complement_time () const
 Get the complement of time of the relation. More...
 
std::string complement_manner () const
 Get the complement of manner of the relation. More...
 
bool operator== (const Relation &b) const
 
bool operator< (const Relation &b) const
 
bool operator> (const Relation &b) const
 

Public Attributes

std::string m_verb
 
std::string m_subject
 
std::string m_object
 
std::string m_complement_place
 
std::string m_complement_time
 
std::string m_complement_manner
 

Friends

class OPCClient
 

Constructor & Destructor Documentation

◆ Relation() [1/4]

icubclient::Relation::Relation ( )
inline

Definition at line 46 of file relation.h.

◆ Relation() [2/4]

Relation::Relation ( yarp::os::Bottle &  b)

Definition at line 85 of file relation.cpp.

◆ Relation() [3/4]

Relation::Relation ( std::string  subject,
std::string  verb,
std::string  object = "none",
std::string  complement_place = "none",
std::string  complement_time = "none",
std::string  complement_manner = "none" 
)

Definition at line 27 of file relation.cpp.

◆ Relation() [4/4]

Relation::Relation ( Entity subject,
Entity verb,
Entity object = nullptr,
Entity complement_place = nullptr,
Entity complement_time = nullptr,
Entity complement_manner = nullptr 
)

Definition at line 44 of file relation.cpp.

◆ ~Relation()

virtual icubclient::Relation::~Relation ( )
inlinevirtual

Definition at line 67 of file relation.h.

Member Function Documentation

◆ asBottle()

Bottle Relation::asBottle ( bool  ignoreID = false) const

Definition at line 90 of file relation.cpp.

◆ asLightBottle()

Bottle Relation::asLightBottle ( ) const

Return the relation as a bottle without the argument to "none".

Definition at line 132 of file relation.cpp.

◆ complement_manner()

string Relation::complement_manner ( ) const

Get the complement of manner of the relation.

Definition at line 236 of file relation.cpp.

◆ complement_place()

string Relation::complement_place ( ) const

Get the complement of place of the relation.

Definition at line 226 of file relation.cpp.

◆ complement_time()

string Relation::complement_time ( ) const

Get the complement of time of the relation.

Definition at line 231 of file relation.cpp.

◆ fromBottle()

void Relation::fromBottle ( const yarp::os::Bottle &  b)

Create a Relation from a Bottle.

Parameters
bThe Bottle representation of a Relation

Definition at line 179 of file relation.cpp.

◆ ID()

int Relation::ID ( ) const

Get the opc ID of the relation.

Definition at line 206 of file relation.cpp.

◆ object()

string Relation::object ( ) const

Get the name of the relation's object.

Definition at line 216 of file relation.cpp.

◆ operator<()

bool Relation::operator< ( const Relation b) const

Definition at line 275 of file relation.cpp.

◆ operator==()

bool Relation::operator== ( const Relation b) const

Definition at line 280 of file relation.cpp.

◆ operator>()

bool Relation::operator> ( const Relation b) const

Definition at line 241 of file relation.cpp.

◆ subject()

string Relation::subject ( ) const

Get the name of the relation's subject.

Definition at line 211 of file relation.cpp.

◆ toString()

string Relation::toString ( ) const
virtual

Return string representation of this Relation.

Definition at line 190 of file relation.cpp.

◆ verb()

string Relation::verb ( ) const

Get the type of the relation.

Definition at line 221 of file relation.cpp.

Friends And Related Function Documentation

◆ OPCClient

friend class OPCClient
friend

Definition at line 33 of file relation.h.

Member Data Documentation

◆ m_complement_manner

std::string icubclient::Relation::m_complement_manner

Definition at line 44 of file relation.h.

◆ m_complement_place

std::string icubclient::Relation::m_complement_place

Definition at line 42 of file relation.h.

◆ m_complement_time

std::string icubclient::Relation::m_complement_time

Definition at line 43 of file relation.h.

◆ m_object

std::string icubclient::Relation::m_object

Definition at line 41 of file relation.h.

◆ m_subject

std::string icubclient::Relation::m_subject

Definition at line 40 of file relation.h.

◆ m_verb

std::string icubclient::Relation::m_verb

Definition at line 39 of file relation.h.