Skip to content

Commit

Permalink
Merge branch 'pps-with-modulations-devMultiEvent' of https://github.c…
Browse files Browse the repository at this point in the history
…om/robotology/peripersonal-space into pps-with-modulations-devMultiEvent
  • Loading branch information
matejhof committed Aug 29, 2016
2 parents ec12cfe + 5e91bb2 commit 0db2377
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
14 changes: 7 additions & 7 deletions lib/src/taxelPWE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,28 +116,28 @@ using namespace std;
In[0] = it->getNRM();
In[1] = it->getTTC();
locResp = pwe->computeResponse(In);
yDebug("[TaxelPWE::computeResponse()] event %s inside RF\n",it->toString().c_str());
yDebug("locResp = locResp + locResp * min(1.0,Evnt.Threat + stress_modulation)\n");
yDebug(" = %f + %f * min(1.0,%f + %f)\n",locResp,locResp,it->Threat,stress_modulation);
//yDebug("[TaxelPWE::computeResponse()] Taxel ID: %d, event inside RF - event in Taxel FoR: \n %s \n",this->getID(), it->toString().c_str());
//yDebug("locResp = locResp + locResp * min(1.0,Evnt.Threat + stress_modulation)\n");
//yDebug(" = %.2f + %.2f * min(1.0,%.2f + %.2f)\n",locResp,locResp,it->Threat,stress_modulation);
locResp = locResp + (locResp * min(1.0,it->Threat + stress_modulation)); //with this amplification,
//may come out of the range (which used to be <0,255>, now <0,1> after 9.8.2016)
//- in fact up to double that range
yDebug(" locResp = %f \n",locResp);
//yDebug(" locResp = %.2f \n",locResp);
if (locResp > maxResp)
maxResp = locResp;
}
else
yDebug("[TaxelPWE::computeResponse()] event %s outside RF\n",it->toString().c_str());
;//yDebug("[TaxelPWE::computeResponse()] Taxel ID: %d, event outside RF - event in Taxel FoR\n %s \n",this->getID(), it->toString().c_str());
}
In.clear();
if (maxResp > 0.0)
{
yDebug(" Setting taxel response to maxResp: %f\n",maxResp);
//yDebug(" Setting taxel response to maxResp: %.2f\n",maxResp);
Resp = maxResp;
return true;
}
else{
yDebug(" maxResp was <=0 (%f) - Leaving taxel response 0, returning false.\n",maxResp);
//yDebug(" maxResp was <=0 (%.2f) - Leaving taxel response 0, returning false.\n",maxResp);
return false;
}
}
Expand Down
5 changes: 3 additions & 2 deletions modules/visuoTactileRF/vtRFThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,8 @@ bool vtRFThread::projectIncomingEvents()
for (size_t j = 0; j < iCubSkin[i].taxels.size(); j++)
{
dynamic_cast<TaxelPWE*>(iCubSkin[i].taxels[j])->Evnts.push_back(projectIntoTaxelRF(iCubSkin[i].taxels[j]->getFoR(),T_a,
(*it))); //here every taxel (TaxelPWE) is updated with the event - if it is relevant for it
(*it))); //here every taxel (TaxelPWE) is updated with the event
//future work - would be better to check if it is inside the RF and only those that pass push to the taxel's events

// There's a reason behind this choice
dumpedVector.push_back((dynamic_cast<TaxelPWE*>(iCubSkin[i].taxels[j]))->Evnts.back().Pos[0]);
Expand Down Expand Up @@ -975,7 +976,7 @@ bool vtRFThread::computeResponse(double stress_modulation)
for (size_t j = 0; j < iCubSkin[i].taxels.size(); j++)
{
dynamic_cast<TaxelPWE*>(iCubSkin[i].taxels[j])->computeResponse(stress_modulation);
printMessage(4,"\t Representative ID %i\tResponse %f (with stress modulation:%f)\n",j,dynamic_cast<TaxelPWE*>(iCubSkin[i].taxels[j])->Resp,stress_modulation);
printMessage(4,"\t Representative ID %i\tResponse %.2f (with stress modulation:%.2f)\n",j,dynamic_cast<TaxelPWE*>(iCubSkin[i].taxels[j])->Resp,stress_modulation);
}
}

Expand Down

2 comments on commit 0db2377

@matejhof
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just curiosity, what happened here? Why did it merge the branch into the same branch? @pattacini do you have an idea?

@pattacini
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't know, actually

Please sign in to comment.