Skip to content

Commit

Permalink
reorder code, 3 cases involving env and penv use, #38
Browse files Browse the repository at this point in the history
  • Loading branch information
jgvictores committed Oct 31, 2017
1 parent 57d0164 commit 9cf1b8b
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions yarpplugins/YarpOpenraveControlboard/DeviceDriverImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,27 @@

bool roboticslab::YarpOpenraveControlboard::open(yarp::os::Searchable& config) {

if ( ( ! config.check("env") ) && ( ! config.check("penv") ) )
if ( ( config.check("env") ) && ( config.check("penv") ) )
{
CD_ERROR("Please use --env or --penv parameter. Bye!\n");
CD_ERROR("Please do not use --env and --penv simultaneously. Bye!\n");
return false;
}

if ( ( config.check("env") ) && ( config.check("penv") ) )
if ( config.check("env") )
{
CD_ERROR("Please do not use --env and --penv simultaneously. Bye!\n");
CD_DEBUG("Found env parameter. Not implemented yet. Bye!\n");
return false;
}
else if ( config.check("penv") )
{
//CD_DEBUG("penv: %p\n",*((const OpenRAVE::EnvironmentBase**)(config.find("penv").asBlob())));
penv = *((OpenRAVE::EnvironmentBasePtr*)(config.find("penv").asBlob()));
}
else
{
CD_ERROR("Please use --env or --penv parameter. Bye!\n");
return false;
}

//CD_DEBUG("penv: %p\n",*((const OpenRAVE::EnvironmentBase**)(config.find("penv").asBlob())));
penv = *((OpenRAVE::EnvironmentBasePtr*)(config.find("penv").asBlob()));

int robotIndex = config.check("robotIndex",-1,"robotIndex").asInt();
if( robotIndex < 0 ) // a.k.a. -1 one line above
Expand Down

0 comments on commit 9cf1b8b

Please sign in to comment.