Skip to content
Snippets Groups Projects
Commit fcfc48ba authored by armar-user's avatar armar-user
Browse files

RobotStateComponent: logging

parent 1bdaa33f
No related branches found
No related tags found
No related merge requests found
......@@ -538,23 +538,24 @@ namespace armarx
const IceUtil::Time newestTimeInHistory = jointHistory.rbegin()->first;
if (time > newestTimeInHistory)
{
IceUtil::Time maxOffset = IceUtil::Time::seconds(2);
if (time <= newestTimeInHistory + maxOffset)
{
ARMARX_INFO << deactivateSpam(5)
<< "Requested joint timestamp is newer than newest available timestamp!"
<< "\n- requested timestamp: \t" << time.toDateTime()
<< "\n- newest timestamp: \t" << newestTimeInHistory.toDateTime()
<< "\n- difference: \t" << (time - newestTimeInHistory).toMicroSeconds() << " us";
}
else
const IceUtil::Time minOffset = IceUtil::Time::milliSeconds(25);
const IceUtil::Time maxOffset = IceUtil::Time::seconds(2);
if (time > newestTimeInHistory + maxOffset)
{
ARMARX_WARNING << deactivateSpam(1) << "Requested joint timestamp is substantially newer (>"
ARMARX_WARNING << deactivateSpam(5) << "Requested joint timestamp is substantially newer (>"
<< maxOffset.toSecondsDouble() << " sec) than newest available timestamp!"
<< "\n- requested timestamp: \t" << time.toDateTime()
<< "\n- newest timestamp: \t" << newestTimeInHistory.toDateTime();
return std::nullopt;
}
else if (time > newestTimeInHistory + minOffset)
{
ARMARX_INFO << deactivateSpam(10)
<< "Requested joint timestamp is newer than newest available timestamp!"
<< "\n- requested timestamp: \t" << time.toDateTime()
<< "\n- newest timestamp: \t" << newestTimeInHistory.toDateTime()
<< "\n- difference: \t" << (time - newestTimeInHistory).toMicroSeconds() << " us";
}
return Timestamped<NameValueMap> {jointHistory.rbegin()->first, jointHistory.rbegin()->second};
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment