The opcPopulator can be used to spawn new entities in simulation and control their parameters.
More...
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
- Copyright
- Released under the terms of the GNU GPL v2.0
Description
Parameters
Input Ports
Output Ports
Services
◆ opcPopulator
Definition at line 13 of file opcPopulator.h.
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::ICubClient * | iCub |
|
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...
|
|
◆ 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 |
( |
| ) |
|
◆ configure()
bool opcPopulator::configure |
( |
yarp::os::ResourceFinder & |
rf | ) |
|
◆ getPeriod()
double opcPopulator::getPeriod |
( |
| ) |
|
|
inline |
◆ interruptModule()
bool opcPopulator::interruptModule |
( |
| ) |
|
|
inline |
◆ populateEntityRandom()
bool opcPopulator::populateEntityRandom |
( |
const yarp::os::Bottle & |
bInput | ) |
|
populateEntityRandom populate entity from Bottle
- Parameters
-
bInput | Bottle 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 |
|
) |
| |
◆ 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
-
bInput | Bottle with format "setAttributeEntity name targetValue" where name defines the object and targetValue defines the new value |
f_setter | function 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 |
( |
| ) |
|
◆ iCub
◆ noise
double opcPopulator::noise |
|
protected |
◆ period
double opcPopulator::period |
|
protected |
◆ rpc
yarp::os::Port opcPopulator::rpc |
|
protected |
◆ X_ag
double opcPopulator::X_ag |
|
protected |
◆ X_obj
double opcPopulator::X_obj |
|
protected |
◆ Y_ag
double opcPopulator::Y_ag |
|
protected |
◆ Y_obj
double opcPopulator::Y_obj |
|
protected |
◆ Z_ag
double opcPopulator::Z_ag |
|
protected |
◆ Z_obj
double opcPopulator::Z_obj |
|
protected |