Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fully qualify BlockTestCore::execution to avoid confusion with std::execution #16

Merged
merged 1 commit into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/actionApplyForce.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ execution ActionApplyForce::execute(const TestRepetitions& testrepetition)
if(!ok)
{
addProblem(testrepetition,Severity::critical,"Unable to open ports applyforce",true);
return execution::stopexecution;
return BlockTestCore::execution::stopexecution;
}

yarp::os::Network::connect(localExtWrenchPort,remoteExtWrenchPort);
Expand All @@ -55,7 +55,7 @@ execution ActionApplyForce::execute(const TestRepetitions& testrepetition)
if(tokenized.size()!=8)
{
addProblem(testrepetition,Severity::error,"Error in parameter number for applyForce",true);
return execution::stopexecution;
return BlockTestCore::execution::stopexecution;
}

yarp::os::Bottle cmd;
Expand All @@ -78,6 +78,6 @@ execution ActionApplyForce::execute(const TestRepetitions& testrepetition)

extWrenchPort.interrupt();
extWrenchPort.close();
return execution::continueexecution;
return BlockTestCore::execution::continueexecution;
}
}
4 changes: 2 additions & 2 deletions src/actionCanRead.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ execution ActionCanRead::execute(const TestRepetitions& testrepetition)
{
logStream << "Unable to find " << polyDriverTag_ <<" in the depot";
addProblem(testrepetition, Severity::error, logStream.str(),true);
return execution::continueexecution;
return BlockTestCore::execution::continueexecution;
}
auto pdrPtr = pdr->second;

Expand Down Expand Up @@ -118,6 +118,6 @@ execution ActionCanRead::execute(const TestRepetitions& testrepetition)

}

return execution::continueexecution;
return BlockTestCore::execution::continueexecution;
}
}
4 changes: 2 additions & 2 deletions src/actionCanWrite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ execution ActionCanWrite::execute(const TestRepetitions& testrepetition)
{
logStream << "Unable to find " << polyDriverTag_ <<" in the depot";
addProblem(testrepetition, Severity::error, logStream.str(),true);
return execution::continueexecution;
return BlockTestCore::execution::continueexecution;
}
auto pdrPtr = pdr->second;

Expand Down Expand Up @@ -108,6 +108,6 @@ execution ActionCanWrite::execute(const TestRepetitions& testrepetition)

}

return execution::continueexecution;
return BlockTestCore::execution::continueexecution;
}
}
2 changes: 1 addition & 1 deletion src/actionCheckComDistance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ execution ActionCheckComDistance::execute(const TestRepetitions&)
if(error)
addProblem(testrepetition,Severity::error);
*/
return execution::stopexecution;
return BlockTestCore::execution::stopexecution;
}

}
8 changes: 4 additions & 4 deletions src/actionCheckJointPosition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ execution ActionCheckJointPosition::execute(const TestRepetitions& testrepetitio
if(!YarpActionDepotStart::polyDriverDepot_[wrapperPrefix_]->view(iencoders))
{
addProblem(testrepetition,Severity::error,"Unable to open encoder control mode interface 2",true);
return execution::stopexecution;
return BlockTestCore::execution::stopexecution;
}

int nj{0};
if(!iencoders->getAxes(&nj))
{
addProblem(testrepetition,Severity::error,"Unable to open encoder control mode interface 3",true);
return execution::stopexecution;;
return BlockTestCore::execution::stopexecution;;
}

std::map<std::string, int> jointNames;
Expand All @@ -64,7 +64,7 @@ execution ActionCheckJointPosition::execute(const TestRepetitions& testrepetitio
{
TXLOG(Severity::error)<<"Joint not found:"<<jointname_<<std::endl;
addProblem(testrepetition,Severity::error,"Joint not found:",false);
return execution::stopexecution;;
return BlockTestCore::execution::stopexecution;;
}

std::this_thread::sleep_for(std::chrono::milliseconds(100));
Expand All @@ -85,7 +85,7 @@ execution ActionCheckJointPosition::execute(const TestRepetitions& testrepetitio
{
TXLOG(Severity::debug)<<"Joint position check value ok:"<<ref<<" expected:" <<expectedValue_<<" tolerance:"<<tolerance_ <<" name:"<<jointname_<<std::endl;
}
return execution::continueexecution;;
return BlockTestCore::execution::continueexecution;;
}

}
14 changes: 7 additions & 7 deletions src/actionCheckPosition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,34 +61,34 @@ execution ActionCheckPosition::execute(const TestRepetitions& testrepetition)
addProblem(testrepetition,Severity::critical,"FBE readings should have 6 elements",false);
fbePort.interrupt();
fbePort.close();
return execution::stopexecution;;
return BlockTestCore::execution::stopexecution;;
}

TXLOG(Severity::debug)<<"FBE x:"<<coordList->get(0).asFloat64()<<" y:"<<coordList->get(1).asFloat64()<<" z:"<<coordList->get(2).asFloat64()<<std::endl;

execution error=execution::stopexecution;;
execution error=BlockTestCore::execution::stopexecution;;
if(xminposition_&& std::abs(xminposition_)>std::abs(coordList->get(0).asFloat64()))
{
TXLOG(Severity::error)<<"FBE x not enough:"<<coordList->get(0).asFloat64()<<" desidered at least:"<<xminposition_<<std::endl;
error=execution::continueexecution;;
error=BlockTestCore::execution::continueexecution;;
}
if(yminposition_ && std::abs(yminposition_)>std::abs(coordList->get(1).asFloat64()))
{
TXLOG(Severity::error)<<"FBE y not enough:"<<coordList->get(1).asFloat64()<<" desidered at least:"<<yminposition_<<std::endl;
error=execution::continueexecution;;
error=BlockTestCore::execution::continueexecution;;
}
if(zminposition_ && std::abs(zminposition_)>std::abs(coordList->get(2).asFloat64()))
{
TXLOG(Severity::error)<<"FBE z not enough:"<<coordList->get(2).asFloat64()<<" desidered at least:"<<zminposition_<<std::endl;
error=execution::continueexecution;;
error=BlockTestCore::execution::continueexecution;;
}

if(error==execution::stopexecution)
if(error==BlockTestCore::execution::stopexecution)
addProblem(testrepetition,Severity::error,"FBE not enough",true);

fbePort.interrupt();
fbePort.close();
return execution::continueexecution;;
return BlockTestCore::execution::continueexecution;;
}

}
2 changes: 1 addition & 1 deletion src/actionCheckRobot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ execution ActionCheckRobot::execute(const TestRepetitions& testrepetition)
{
addProblem(testrepetition,Severity::critical,"getAxes failed",true);
}
return execution::continueexecution;;
return BlockTestCore::execution::continueexecution;;
}

}
18 changes: 9 additions & 9 deletions src/actionCheckVertical.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ execution ActionCheckVertical::execute(const TestRepetitions& testrepetition)
if(!ok)
{
addProblem(testrepetition,Severity::critical,"Unable to open ports checkvertical",true);
return execution::stopexecution;;
return BlockTestCore::execution::stopexecution;;
}
ok=yarp::os::Network::connect(remoteImuPort.c_str(), localImuPort.c_str());
if(!ok)
{
addProblem(testrepetition,Severity::critical,"Unable to connect to imu port",true);
return execution::stopexecution;;
return BlockTestCore::execution::stopexecution;;
}

// To check the robot is vertical, we do a simple test: we check if the z component of the
Expand All @@ -58,36 +58,36 @@ execution ActionCheckVertical::execute(const TestRepetitions& testrepetition)
if(!imuReadings)
{
addProblem(testrepetition,Severity::critical,"Impossible to read accelerometer measurements",true);
return execution::stopexecution;;
return BlockTestCore::execution::stopexecution;;
}
if(imuReadings->size()<12)
{
TXLOG(Severity::critical)<<"IMU readings should have at least 12 elements current:"<<imuReadings->size()<<std::endl;
addProblem(testrepetition,Severity::critical,"IMU readings should have at least 12 elements",false);
return execution::stopexecution;;
return BlockTestCore::execution::stopexecution;;
}

double gravityOnX = std::fabs((*imuReadings)[3]);
double gravityOnY = std::fabs((*imuReadings)[4]);
double gravityOnZ = std::fabs((*imuReadings)[5]);

execution error{execution::stopexecution};
execution error{BlockTestCore::execution::stopexecution};
if(!(gravityOnX < gravityOnZ))
{
TXLOG(Severity::error)<<"Absolute gravity on x:"<<gravityOnX<< " is greater then on z:"<<gravityOnZ<<std::endl;
error=execution::continueexecution;;
error=BlockTestCore::execution::continueexecution;;
}
if(!(gravityOnY < gravityOnZ))
{
TXLOG(Severity::error)<<"Absolute gravity on y:"<<gravityOnY<< " is greater then on z:"<<gravityOnZ<<std::endl;
error=execution::continueexecution;
error=BlockTestCore::execution::continueexecution;
}

if(error==execution::stopexecution)
if(error==BlockTestCore::execution::stopexecution)
addProblem(testrepetition,Severity::error,"Absolute gravity",true);

imuPort.interrupt();
imuPort.close();
return execution::continueexecution;;
return BlockTestCore::execution::continueexecution;;
}
}
4 changes: 2 additions & 2 deletions src/actionPolydriverClose.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ execution ActionPolydriverClose::execute(const TestRepetitions&)
TXLOG(Severity::info)<<"Close PolyDrive tag:"<<tag_<<std::endl;
TestRepetitions rep{0,0};
addProblem(rep, Severity::critical, "Polydriver failed to close tag:"+tag_,true);
return execution::continueexecution;
return BlockTestCore::execution::continueexecution;
}

it->second->close();
YarpActionDepotStart::polyDriverDepot_.erase(it);
TXLOG(Severity::info)<<"Close PolyDrive tag:"<<tag_<<std::endl;
return execution::continueexecution;
return BlockTestCore::execution::continueexecution;
}


Expand Down
2 changes: 1 addition & 1 deletion src/actionPolydriverOpener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ execution ActionPolydriverOpener::execute(const TestRepetitions&)
TestRepetitions rep{0,0};
addProblem(rep, Severity::critical, "Polydriver failed to open tag:"+tag_,true);
}
return execution::continueexecution;
return BlockTestCore::execution::continueexecution;
}


Expand Down
4 changes: 2 additions & 2 deletions src/actionPortClose.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ execution ActionPortClose::execute(const TestRepetitions& testrepetition)
{
logStream << "Unable to find " << portname_<<" in the port depot";
addProblem(testrepetition, Severity::error, logStream.str(),true);
return execution::continueexecution;
return BlockTestCore::execution::continueexecution;
}
auto port_ptr = portIt->second;

Expand All @@ -64,5 +64,5 @@ execution ActionPortClose::execute(const TestRepetitions& testrepetition)
addProblem(testrepetition, Severity::error, logStream.str(),true);
}

return execution::continueexecution;
return BlockTestCore::execution::continueexecution;
}
8 changes: 4 additions & 4 deletions src/actionPortConnect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ execution ActionPortConnect::execute(const TestRepetitions& testrepetition)
stringstream logStream;
logStream << "Port not exists " << src_;
addProblem(testrepetition, Severity::error, logStream.str(),true);
return execution::continueexecution;
return BlockTestCore::execution::continueexecution;
}
ok=Network::exists(dst_);
if(!ok)
{
stringstream logStream;
logStream << "Port not exists " << dst_;
addProblem(testrepetition, Severity::error, logStream.str(),true);
return execution::continueexecution;
return BlockTestCore::execution::continueexecution;
}

ok=Network::isValidPortName(src_);
Expand All @@ -57,7 +57,7 @@ execution ActionPortConnect::execute(const TestRepetitions& testrepetition)
stringstream logStream;
logStream << "Port not valid " << src_ << " -> " << dst_ << " with "<<crr_<<" carrier";
addProblem(testrepetition, Severity::error, logStream.str(),true);
return execution::continueexecution;
return BlockTestCore::execution::continueexecution;
}

ok &= Network::connect(src_, dst_, crr_);
Expand All @@ -67,5 +67,5 @@ execution ActionPortConnect::execute(const TestRepetitions& testrepetition)
logStream << "Unable to connect " << src_ << " -> " << dst_ << " with "<<crr_<<" carrier";
addProblem(testrepetition, Severity::error, logStream.str(),true);
}
return execution::continueexecution;
return BlockTestCore::execution::continueexecution;
}
2 changes: 1 addition & 1 deletion src/actionPortDisconnect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ execution ActionPortDisconnect::execute(const TestRepetitions& testrepetition)
logStream << "Unable to disconnect " << src_ << " -> " << dst_ ;
addProblem(testrepetition, Severity::critical, logStream.str(),true);
}
return execution::continueexecution;
return BlockTestCore::execution::continueexecution;
}
2 changes: 1 addition & 1 deletion src/actionPortOpen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ execution ActionPortOpen::execute(const TestRepetitions& testrepetition)
addProblem(testrepetition, Severity::error, logStream.str(),true);
}

return execution::continueexecution;
return BlockTestCore::execution::continueexecution;
}
8 changes: 4 additions & 4 deletions src/actionPortRead.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ execution ActionPortRead::execute(const TestRepetitions& testrepetition)
stringstream logStream;
logStream << "Unable to find " << portname_;
addProblem(testrepetition, Severity::error, logStream.str(),true);
return execution::continueexecution;
return BlockTestCore::execution::continueexecution;
}

auto port=it;
Expand All @@ -49,16 +49,16 @@ execution ActionPortRead::execute(const TestRepetitions& testrepetition)
stringstream logStream;
logStream << "Unable to read " << portname_;
addProblem(testrepetition, Severity::error, logStream.str(),true);
return execution::continueexecution;
return BlockTestCore::execution::continueexecution;
}

if(input.toString()!=value_)
{
stringstream logStream;
logStream << "Read unexpected value " << portname_;
addProblem(testrepetition, Severity::error, logStream.str(),true);
return execution::continueexecution;
return BlockTestCore::execution::continueexecution;
}

return execution::continueexecution;
return BlockTestCore::execution::continueexecution;
}
6 changes: 3 additions & 3 deletions src/actionPortWrite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ execution ActionPortWrite::execute(const TestRepetitions& testrepetition)
stringstream logStream;
logStream << "Unable to find " << portname_;
addProblem(testrepetition, Severity::error, logStream.str(),true);
return execution::continueexecution;
return BlockTestCore::execution::continueexecution;
}

auto port=it;
Expand All @@ -49,8 +49,8 @@ execution ActionPortWrite::execute(const TestRepetitions& testrepetition)
stringstream logStream;
logStream << "Unable to write " << portname_;
addProblem(testrepetition, Severity::error, logStream.str(),true);
return execution::continueexecution;
return BlockTestCore::execution::continueexecution;
}

return execution::continueexecution;
return BlockTestCore::execution::continueexecution;
}
2 changes: 1 addition & 1 deletion src/actionReset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ execution ActionReset::execute(const TestRepetitions& testrepetition)
yarp::os::SystemClock systemClock;
systemClock.delay(1.0);
clockClientPort.close();
return execution::continueexecution;;
return BlockTestCore::execution::continueexecution;;
}

}
2 changes: 1 addition & 1 deletion src/actionResetPose.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ execution ActionResetPose::execute(const TestRepetitions& testrepetition)
yarp::os::SystemClock systemClock;
systemClock.delay(1.0);
clockClientPort.close();
return execution::continueexecution;;
return BlockTestCore::execution::continueexecution;;
}

}
Loading