Skip to content

Commit

Permalink
Fix #45 (rename opcPopulater to opcPopulator)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias-Fischer committed Jan 4, 2018
1 parent c74b6d9 commit d33a614
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion app/tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if(ICUB_USE_IPOPT)
add_subdirectory(referenceFrameHandler)
endif()

add_subdirectory(opcPopulater)
add_subdirectory(opcPopulator)
add_subdirectory(actionRecogDataDumper)
add_subdirectory(touchDetector)

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Authors: Grégoire Pointeau
# CopyPolicy: Released under the terms of the GNU GPL v2.0.

set(appname opcPopulater)
set(appname opcPopulator)
file(GLOB ini ${CMAKE_CURRENT_SOURCE_DIR}/conf/*.*)
file(GLOB template ${CMAKE_CURRENT_SOURCE_DIR}/scripts/*.template)

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/modules/tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if(ICUB_USE_IPOPT)
endif()

add_subdirectory(guiUpdater)
add_subdirectory(opcPopulater)
add_subdirectory(opcPopulator)
add_subdirectory(actionRecogDataDumper)
add_subdirectory(touchDetector)

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Authors: Grégoire Pointeau
# CopyPolicy: Released under the terms of the GNU GPL v2.0.

project(opcPopulater)
project(opcPopulator)

file(GLOB folder_source src/*.cpp src/*.cc src/*.c)
file(GLOB folder_header include/*.h )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ namespace icubclient {
}

/**
* \ingroup opcPopulater
* \ingroup opcPopulator
*/
class opcPopulater : public yarp::os::RFModule {
class opcPopulator : public yarp::os::RFModule {
protected:

icubclient::ICubClient *iCub;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

<module>

<name>opcPopulater</name>
<name>opcPopulator</name>
<doxygen-group>icubclient_modules</doxygen-group>
<description>The %opcPopulater 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.</description>
<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.</description>
<copypolicy>Released under the terms of the GNU GPL v2.0</copypolicy>
<version>1.0</version>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@



#include "opcPopulater.h"
#include "opcPopulator.h"

using namespace std;
using namespace yarp::os;
Expand All @@ -30,11 +30,11 @@ int main(int argc, char * argv[])
yError()<<"YARP network seems unavailable!";
return 1;
}
opcPopulater mod;
opcPopulator mod;
ResourceFinder rf;
rf.setVerbose(true);
rf.setDefaultContext("opcPopulater");
rf.setDefaultConfigFile("opcPopulater.ini");
rf.setDefaultContext("opcPopulator");
rf.setDefaultConfigFile("opcPopulator.ini");
rf.configure(argc, argv);
return mod.runModule(rf);
}
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
#include <functional>
#include "opcPopulater.h"
#include "opcPopulator.h"
#include "icubclient/clients/icubClient.h"
#include "icubclient/subsystems/subSystem_ARE.h"

using namespace std;
using namespace yarp::os;
using namespace icubclient;

bool opcPopulater::configure(yarp::os::ResourceFinder &rf)
bool opcPopulator::configure(yarp::os::ResourceFinder &rf)
{
string moduleName = rf.check("name", Value("opcPopulater")).asString().c_str();
string moduleName = rf.check("name", Value("opcPopulator")).asString().c_str();
setName(moduleName.c_str());

yInfo() << moduleName << " : finding configuration files...";
period = rf.check("period", Value(0.1)).asDouble();

//Create an iCub Client and check that all dependencies are here before starting
bool isRFVerbose = false;
iCub = new ICubClient(moduleName, "opcPopulater", "client.ini", isRFVerbose);
iCub = new ICubClient(moduleName, "opcPopulator", "client.ini", isRFVerbose);
iCub->opc->isVerbose = false;
if (!iCub->connect())
{
Expand Down Expand Up @@ -54,15 +54,15 @@ bool opcPopulater::configure(yarp::os::ResourceFinder &rf)
}


bool opcPopulater::close() {
bool opcPopulator::close() {
iCub->close();
delete iCub;

return true;
}


bool opcPopulater::respond(const Bottle& command, Bottle& reply) {
bool opcPopulator::respond(const Bottle& command, Bottle& reply) {
string helpMessage = string(getName().c_str()) +
" commands are: \n" +
"help \n" +
Expand Down Expand Up @@ -126,15 +126,15 @@ bool opcPopulater::respond(const Bottle& command, Bottle& reply) {
}

/* Called periodically every getPeriod() seconds */
bool opcPopulater::updateModule() {
bool opcPopulator::updateModule() {
return true;
}

bool opcPopulater::populateEntityRandom(const Bottle& bInput){
bool opcPopulator::populateEntityRandom(const Bottle& bInput){

if (bInput.size() != 3)
{
yWarning() << " in opcPopulater::populateEntityRandom | wrong number of input";
yWarning() << " in opcPopulator::populateEntityRandom | wrong number of input";
return false;
}
string sName = bInput.get(2).toString();
Expand Down Expand Up @@ -175,11 +175,11 @@ bool opcPopulater::populateEntityRandom(const Bottle& bInput){
}


bool opcPopulater::addUnknownEntity(const Bottle &bInput){
bool opcPopulator::addUnknownEntity(const Bottle &bInput){

if (bInput.size() != 2)
{
yWarning() << " in opcPopulater::addUnknownEntity | wrong number of input";
yWarning() << " in opcPopulator::addUnknownEntity | wrong number of input";
return false;
}

Expand Down Expand Up @@ -221,10 +221,10 @@ bool opcPopulater::addUnknownEntity(const Bottle &bInput){
return true;
}

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

if (bInput.size() != 3) {
yWarning() << " in opcPopulater::setAttributeEntity| wrong number of input";
yWarning() << " in opcPopulator::setAttributeEntity| wrong number of input";
return false;
}

Expand All @@ -246,7 +246,7 @@ bool opcPopulater::setAttributeEntity(const Bottle& bInput, std::function<void(O
}


bool opcPopulater::populateSpecific() {
bool opcPopulator::populateSpecific() {
iCub->opc->clear();

double errorMargin = noise;
Expand Down Expand Up @@ -295,7 +295,7 @@ bool opcPopulater::populateSpecific() {
}


bool opcPopulater::populateTwoUnknowns() {
bool opcPopulator::populateTwoUnknowns() {
iCub->opc->clear();

Object* obj1 = iCub->opc->addOrRetrieveEntity<Object>("unknown_1");
Expand All @@ -322,7 +322,7 @@ bool opcPopulater::populateTwoUnknowns() {
}


bool opcPopulater::populateRedBall(){
bool opcPopulator::populateRedBall(){

Object* obj1 = iCub->opc->addOrRetrieveEntity<Object>("red_ball");
obj1->m_ego_position[0] = -0.4;
Expand Down

0 comments on commit d33a614

Please sign in to comment.