Skip to content

Commit

Permalink
upgrade to yarp-3.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
pattacini committed Nov 24, 2021
1 parent c4b925a commit d020e54
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 73 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED 11)

find_package(ICUBcontrib REQUIRED)
find_package(YARP 3.3.0 REQUIRED COMPONENTS os sig dev math gsl idl_tools)
find_package(YARP 3.5.1 REQUIRED COMPONENTS os sig dev math gsl idl_tools)
list(APPEND CMAKE_MODULE_PATH ${ICUBCONTRIB_MODULE_PATH})

include(ICUBcontribHelpers)
Expand Down
24 changes: 12 additions & 12 deletions modules/funnyPostures/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ class PosturesModule : public RFModule
return true;

Bottle cmd,reply;
cmd.addVocab(Vocab::encode("status"));
cmd.addVocab32("status");
if (iolPortStatus.write(cmd,reply))
{
if (reply.size()>1)
Expand All @@ -561,7 +561,7 @@ class PosturesModule : public RFModule
(reply.get(1).asString()=="idle"))
{
cmd.clear();
cmd.addVocab(Vocab::encode("attention"));
cmd.addVocab32("attention");
cmd.addString("stop");
printf("sending: %s\n",cmd.toString().c_str());
bool ok=iolPortHuman.write(cmd,reply);
Expand All @@ -582,7 +582,7 @@ class PosturesModule : public RFModule
return true;

Bottle cmd,reply;
cmd.addVocab(Vocab::encode("attention"));
cmd.addVocab32("attention");
cmd.addString("start");
printf("sending: %s\n",cmd.toString().c_str());
bool ok=iolPortHuman.write(cmd,reply);
Expand All @@ -599,7 +599,7 @@ class PosturesModule : public RFModule
if (iolPortHuman.getOutputCount()>0)
{
Bottle cmd,reply;
cmd.addVocab(Vocab::encode("say"));
cmd.addVocab32("say");
cmd.addString(sentence.c_str());
if (iolPortHuman.write(cmd,reply))
return (reply.get(0).asString()=="ack");
Expand Down Expand Up @@ -635,7 +635,7 @@ class PosturesModule : public RFModule
/*********************************************/
void configureEmotions(ResourceFinder &rf)
{
int numEmotions=rf.check("num_emotions",Value(0)).asInt();
int numEmotions=rf.check("num_emotions",Value(0)).asInt32();
for (int i=0; i<numEmotions; i++)
{
ostringstream tag;
Expand Down Expand Up @@ -735,8 +735,8 @@ class PosturesModule : public RFModule
/*********************************************/
bool respond(const Bottle &cmd, Bottle &reply)
{
int ack=Vocab::encode("ack");
int nack=Vocab::encode("nack");
int ack=Vocab32::encode("ack");
int nack=Vocab32::encode("nack");

Value item=cmd.get(0);
if (item.isString())
Expand All @@ -747,10 +747,10 @@ class PosturesModule : public RFModule
{
posture("foo","home");
giveGrant();
reply.addVocab(ack);
reply.addVocab32(ack);
}
else
reply.addVocab(nack);
reply.addVocab32(nack);

return true;
}
Expand All @@ -768,7 +768,7 @@ class PosturesModule : public RFModule
if (cmd.size()>1)
if (Bottle *where=cmd.get(1).asList())
for (int i=0; i<where->size(); i++)
x[i]=where->get(i).asDouble();
x[i]=where->get(i).asFloat64();

if (getGrant())
{
Expand All @@ -782,11 +782,11 @@ class PosturesModule : public RFModule

Bottle rep;
if (ans==ack)
reply.addVocab(ack);
reply.addVocab32(ack);
else if (RFModule::respond(cmd,rep))
reply=rep;
else
reply.addVocab(nack);
reply.addVocab32(nack);

return true;
}
Expand Down
26 changes: 13 additions & 13 deletions modules/iCubBlinker/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,17 +325,17 @@ class Blinker: public RFModule, public iCubBlinker_IDL
bool retrieveInteractionMode_params(Bottle &int_mode)
{
// If the parameters are not found, it will default to the idle mode
blinkper_nrm = int_mode.check("blinkper_nrm",Value(5.2)).asDouble();
blinkper_sgm = int_mode.check("blinkper_sgm",Value(3.7)).asDouble();
blinkper_nrm = int_mode.check("blinkper_nrm",Value(5.2)).asFloat64();
blinkper_sgm = int_mode.check("blinkper_sgm",Value(3.7)).asFloat64();

closure_nrm = int_mode.check("closure_nrm",Value(0.111)).asDouble();
closure_sgm = int_mode.check("closure_sgm",Value(0.031)).asDouble();
closure_nrm = int_mode.check("closure_nrm",Value(0.111)).asFloat64();
closure_sgm = int_mode.check("closure_sgm",Value(0.031)).asFloat64();

sustain_nrm = int_mode.check("sustain_nrm",Value(0.020)).asDouble();
sustain_sgm = int_mode.check("sustain_sgm",Value(0.005)).asDouble();
sustain_nrm = int_mode.check("sustain_nrm",Value(0.020)).asFloat64();
sustain_sgm = int_mode.check("sustain_sgm",Value(0.005)).asFloat64();

opening_nrm = int_mode.check("opening_nrm",Value(0.300)).asDouble();
opening_sgm = int_mode.check("opening_sgm",Value(0.123)).asDouble();
opening_nrm = int_mode.check("opening_nrm",Value(0.300)).asFloat64();
opening_sgm = int_mode.check("opening_sgm",Value(0.123)).asFloat64();

return true;
}
Expand Down Expand Up @@ -393,7 +393,7 @@ class Blinker: public RFModule, public iCubBlinker_IDL
robot=rf->check("robot",Value("icub")).asString().c_str();
blinkingBehavior=rf->check("blinkingBehavior",Value("fast")).asString().c_str();
blinkingPeriod=rf->check("blinkingPeriod",Value("fixed")).asString().c_str();
fixed_blinkper=rf->check("fixedBlinkPer",Value(5.0)).asDouble();
fixed_blinkper=rf->check("fixedBlinkPer",Value(5.0)).asFloat64();

isBlinking=rf->check("autoStart");

Expand Down Expand Up @@ -451,8 +451,8 @@ class Blinker: public RFModule, public iCubBlinker_IDL

if (calib.size() > 0)
{
sMin = calib.check("sMin",Value(00)).asInt();
sMax = calib.check("sMax",Value(70)).asInt();
sMin = calib.check("sMin",Value(00)).asInt32();
sMax = calib.check("sMax",Value(70)).asInt32();

yInfo("[iCubBlinker] Eyelid calibs loaded: (%i %i)", sMin, sMax);
}
Expand Down Expand Up @@ -605,8 +605,8 @@ class Blinker: public RFModule, public iCubBlinker_IDL

if (calib.size() > 0)
{
sMin = calib.check("sMin",Value(00)).asInt();
sMax = calib.check("sMax",Value(70)).asInt();
sMin = calib.check("sMin",Value(00)).asInt32();
sMax = calib.check("sMax",Value(70)).asInt32();

yInfo("[iCubBlinker::load] Eyelid calibs loaded: (%i %i)", sMin, sMax);

Expand Down
36 changes: 18 additions & 18 deletions modules/iCubBreather/iCubBreatherModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,37 +112,37 @@ class iCubBreather: public RFModule

bool respond(const Bottle &command, Bottle &reply)
{
int ack =Vocab::encode("ack");
int nack=Vocab::encode("nack");
int ack =Vocab32::encode("ack");
int nack=Vocab32::encode("nack");

if (command.size()>0)
{
switch (command.get(0).asVocab())
switch (command.get(0).asVocab32())
{
case createVocab('s','t','a','r'):
case createVocab32('s','t','a','r'):
{
int res=Vocab::encode("started");
int res=Vocab32::encode("started");
if (iCubBreatherThrd -> startBreathing())
{
reply.addVocab(ack);
reply.addVocab32(ack);
}
else
reply.addVocab(nack);
reply.addVocab32(nack);

reply.addVocab(res);
reply.addVocab32(res);
return true;
}
case createVocab('s','t','o','p'):
case createVocab32('s','t','o','p'):
{
int res=Vocab::encode("stopped");
int res=Vocab32::encode("stopped");
if (iCubBreatherThrd -> stopBreathing())
{
reply.addVocab(ack);
reply.addVocab32(ack);
}
else
reply.addVocab(nack);
reply.addVocab32(nack);

reply.addVocab(res);
reply.addVocab32(res);
return true;
}
//-----------------
Expand All @@ -151,7 +151,7 @@ class iCubBreather: public RFModule
}
}

reply.addVocab(nack);
reply.addVocab32(nack);
return true;
}

Expand Down Expand Up @@ -179,31 +179,31 @@ class iCubBreather: public RFModule
//****************** rate ******************
if (rf.check("rate"))
{
rate = rf.find("rate").asInt();
rate = rf.find("rate").asInt32();
yInfo(("*** "+name+": thread working at %i ms").c_str(), rate);
}
else yInfo(("*** "+name+": could not find rate in the config file; using %i ms as default").c_str(), rate);

//******************* VERBOSE ******************
if (rf.check("verbosity"))
{
verbosity = rf.find("verbosity").asInt();
verbosity = rf.find("verbosity").asInt32();
yInfo(("*** "+name+": verbosity set to %i").c_str(),verbosity);
}
else yInfo(("*** "+name+": could not find verbosity option in the config file; using %i as default").c_str(),verbosity);

//******************* NOISESTD ******************
if (rf.check("noiseStd"))
{
noiseStd = rf.find("noiseStd").asDouble();
noiseStd = rf.find("noiseStd").asFloat64();
yInfo(("*** "+name+": noiseStd set to %g").c_str(),noiseStd);
}
else yInfo(("*** "+name+": could not find noiseStd option in the config file; using %g as default").c_str(),noiseStd);

//******************* REFPEEDS ******************
if (rf.check("refSpeeds"))
{
refSpeeds = rf.find("refSpeeds").asDouble();
refSpeeds = rf.find("refSpeeds").asFloat64();
yInfo(("*** "+name+": refSpeeds set to %g").c_str(),refSpeeds);
}
else yInfo(("*** "+name+": could not find refSpeeds option in the config file; using %g as default").c_str(),refSpeeds);
Expand Down
4 changes: 2 additions & 2 deletions modules/iCubBreather/iCubBreatherThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ bool iCubBreatherThread::threadInit()

for (int i = 0; i < jnts; i++)
{
noiseStDvtns.push_back(bns->get(i).asDouble());
refSpeeds.push_back(brf->get(i).asDouble());
noiseStDvtns.push_back(bns->get(i).asFloat64());
refSpeeds.push_back(brf->get(i).asFloat64());
}
}
else
Expand Down
Loading

0 comments on commit d020e54

Please sign in to comment.