icub-client
Classes

The opcPopulator can be used to spawn new entities in simulation and control their parameters. More...

+ Collaboration diagram for opcPopulator:

Classes

class  opcPopulator
 

Detailed Description

The opcPopulator can be used to spawn new entities in simulation and control their parameters.

This allows testing new functionalities in a controlled environment, without the noise encountered when using the real robot. Version:1.0

Author
Grégoire Pointeau greg..nosp@m.poin.nosp@m.teau@.nosp@m.gmai.nosp@m.l.com, Tobias Fischer t.fis.nosp@m.cher.nosp@m.@impe.nosp@m.rial.nosp@m..ac.u.nosp@m.k

Description

Parameters

Input Ports

Output Ports

Services


Class Documentation

◆ opcPopulator

class opcPopulator

Definition at line 13 of file opcPopulator.h.

+ Inheritance diagram for opcPopulator:

Public Member Functions

bool configure (yarp::os::ResourceFinder &rf)
 
bool interruptModule ()
 
bool close ()
 
double getPeriod ()
 
bool updateModule ()
 
bool populateEntityRandom (const yarp::os::Bottle &bInput)
 populateEntityRandom populate entity from Bottle More...
 
bool populateRedBall ()
 populateRedBall populate object with name "red_ball" at location (-0.4, 0.25, 0.0); is_present=0.0; color=(250,0,0) More...
 
bool populateSpecific ()
 populateSpecific populate four objects ("bottom_left", "bottom_right", according to X_obj, Y_obj, Z_obj, and "top_left", "top_right" according to X_ag, Y_ag, Z_ag More...
 
bool populateTwoUnknowns ()
 populateTwoUnknowns populate two objects: "unknown_1" at (-0.4, 0.25, 0.0) and "unknown_2" at (-0.4, -0.25, 0.0), both present and randomly colored More...
 
bool addUnknownEntity (const yarp::os::Bottle &bInput)
 addUnknownEntity populate object / agent at pseudo-random location, pseudo-randomly colored More...
 
bool setAttributeEntity (const yarp::os::Bottle &bInput, std::function< void(icubclient::Object *, double)> f_setter)
 setAttributeEntity set an attribute of an object More...
 
bool respond (const yarp::os::Bottle &cmd, yarp::os::Bottle &reply)
 

Protected Attributes

icubclient::ICubClientiCub
 
double period
 
yarp::os::Port rpc
 
double X_obj
 X coordinate of object used within populateSpecific() for bottom_left and bottom_right. More...
 
double Y_obj
 Y coordinate of object used within populateSpecific() for bottom_left (inverted) and bottom_right. More...
 
double Z_obj
 Z coordinate of object used within populateSpecific() for bottom_left and bottom_right. More...
 
double X_ag
 X coordinate of object used within populateSpecific() for top_left and top_right. More...
 
double Y_ag
 Y coordinate of object used within populateSpecific() for top_left (inverted) and top_right. More...
 
double Z_ag
 Z coordinate of object used within populateSpecific() for top_left and top_right. More...
 
double noise
 (Gaussian) noise to be added to X_obj, Y_obj, Z_obj, X_ag, Y_ag, Z_ag in populateSpecific() More...
 

Member Function Documentation

◆ addUnknownEntity()

bool opcPopulator::addUnknownEntity ( const yarp::os::Bottle &  bInput)

addUnknownEntity populate object / agent at pseudo-random location, pseudo-randomly colored

Parameters
bInput"addUnknownEntity type" where type is "agent" or "object"
Returns
true if successful

Definition at line 178 of file opcPopulator.cpp.

◆ close()

bool opcPopulator::close ( )

Definition at line 57 of file opcPopulator.cpp.

◆ configure()

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

Definition at line 10 of file opcPopulator.cpp.

◆ getPeriod()

double opcPopulator::getPeriod ( )
inline

Definition at line 38 of file opcPopulator.h.

◆ interruptModule()

bool opcPopulator::interruptModule ( )
inline

Definition at line 31 of file opcPopulator.h.

◆ populateEntityRandom()

bool opcPopulator::populateEntityRandom ( const yarp::os::Bottle &  bInput)

populateEntityRandom populate entity from Bottle

Parameters
bInputBottle containing type "populateEntityRandom type name" where type is "agent" or "object" and name is the name of the new entity
Returns
true if successful

Definition at line 133 of file opcPopulator.cpp.

◆ populateRedBall()

bool opcPopulator::populateRedBall ( )

populateRedBall populate object with name "red_ball" at location (-0.4, 0.25, 0.0); is_present=0.0; color=(250,0,0)

Returns
true if successful

Definition at line 325 of file opcPopulator.cpp.

◆ populateSpecific()

bool opcPopulator::populateSpecific ( )

populateSpecific populate four objects ("bottom_left", "bottom_right", according to X_obj, Y_obj, Z_obj, and "top_left", "top_right" according to X_ag, Y_ag, Z_ag

Returns
true if successful

Definition at line 249 of file opcPopulator.cpp.

◆ populateTwoUnknowns()

bool opcPopulator::populateTwoUnknowns ( )

populateTwoUnknowns populate two objects: "unknown_1" at (-0.4, 0.25, 0.0) and "unknown_2" at (-0.4, -0.25, 0.0), both present and randomly colored

Returns
true if successful

Definition at line 298 of file opcPopulator.cpp.

◆ respond()

bool opcPopulator::respond ( const yarp::os::Bottle &  cmd,
yarp::os::Bottle &  reply 
)

Definition at line 65 of file opcPopulator.cpp.

◆ setAttributeEntity()

bool opcPopulator::setAttributeEntity ( const yarp::os::Bottle &  bInput,
std::function< void(icubclient::Object *, double)>  f_setter 
)

setAttributeEntity set an attribute of an object

Parameters
bInputBottle with format "setAttributeEntity name targetValue" where name defines the object and targetValue defines the new value
f_setterfunction pointer to function to be called, e.g. to icubclient::Object::setSaliency()
Returns
true if successful

Definition at line 224 of file opcPopulator.cpp.

◆ updateModule()

bool opcPopulator::updateModule ( )

Definition at line 129 of file opcPopulator.cpp.

Member Data Documentation

◆ iCub

icubclient::ICubClient* opcPopulator::iCub
protected

Definition at line 16 of file opcPopulator.h.

◆ noise

double opcPopulator::noise
protected

(Gaussian) noise to be added to X_obj, Y_obj, Z_obj, X_ag, Y_ag, Z_ag in populateSpecific()

Definition at line 26 of file opcPopulator.h.

◆ period

double opcPopulator::period
protected

Definition at line 17 of file opcPopulator.h.

◆ rpc

yarp::os::Port opcPopulator::rpc
protected

Definition at line 18 of file opcPopulator.h.

◆ X_ag

double opcPopulator::X_ag
protected

X coordinate of object used within populateSpecific() for top_left and top_right.

Definition at line 23 of file opcPopulator.h.

◆ X_obj

double opcPopulator::X_obj
protected

X coordinate of object used within populateSpecific() for bottom_left and bottom_right.

Definition at line 20 of file opcPopulator.h.

◆ Y_ag

double opcPopulator::Y_ag
protected

Y coordinate of object used within populateSpecific() for top_left (inverted) and top_right.

Definition at line 24 of file opcPopulator.h.

◆ Y_obj

double opcPopulator::Y_obj
protected

Y coordinate of object used within populateSpecific() for bottom_left (inverted) and bottom_right.

Definition at line 21 of file opcPopulator.h.

◆ Z_ag

double opcPopulator::Z_ag
protected

Z coordinate of object used within populateSpecific() for top_left and top_right.

Definition at line 25 of file opcPopulator.h.

◆ Z_obj

double opcPopulator::Z_obj
protected

Z coordinate of object used within populateSpecific() for bottom_left and bottom_right.

Definition at line 22 of file opcPopulator.h.