Skip to content

Commit

Permalink
Expand PVT buffer emergency error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterBowman committed Jul 19, 2019
1 parent 53489a8 commit b0a36cf
Showing 1 changed file with 35 additions and 9 deletions.
44 changes: 35 additions & 9 deletions libraries/YarpPlugins/TechnosoftIpos/ICanBusSharerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -430,25 +430,51 @@ bool roboticslab::TechnosoftIpos::interpretMessage(const yarp::dev::CanMessage &

if (message.getData()[0] == 0x01 && message.getData()[1] == 0xFF && message.getData()[2] == 0x01)
{
if (message.getData()[4] == 0x20)
CD_INFO("PVT control message. canId: %d.\n",canId);

if ((message.getData()[4] & 0x80) == 0)
{
CD_INFO("\t* pt buffer is not empty.\n");
}
else
{
CD_INFO("\t* pt buffer is empty.\n");
}

if ((message.getData()[4] & 0x40) == 0)
{
CD_WARNING("pt buffer full. canId: %d.\n",canId);
CD_INFO("\t* pt buffer is not low.\n");
}
else if (message.getData()[4] == 0x40)
else
{
CD_WARNING("pt buffer low. canId: %d.\n",canId);
CD_INFO("\t* pt buffer is low.\n");
}
else if (message.getData()[4] & 0x80)

if ((message.getData()[4] & 0x20) == 0)
{
CD_WARNING("pt buffer empty. canId: %d.\n",canId);
CD_INFO("\t* pt buffer is not full.\n");
}
else if (message.getData()[3] == 0x08)
else
{
CD_INFO("\t* pt buffer is full.\n");
}

if ((message.getData()[4] & 0x10) == 0)
{
CD_INFO("\t* pt no integrity counter error.\n");
}
else
{
CD_INFO("\t* pt integrity counter error.\n");
}

if ((message.getData()[4] & 0x08) == 0)
{
CD_WARNING("pt buffer message (don't know what it means). canId: %d.\n",canId);
CD_INFO("\t* pvt maintained position on buffer empty (zero velocity).\n");
}
else
{
CD_INFO("PVT control message. canId: %d.\n",canId);
CD_INFO("\t* pvt performed quick stop on buffer empty (non-zero velocity).\n");
}

return true;
Expand Down

0 comments on commit b0a36cf

Please sign in to comment.