[Rock-dev] [rock] #398: Frequent timeouts in imu_xsens driver
rock
noreply at opendfki.de
Wed Dec 11 17:10:20 CET 2013
#398: Frequent timeouts in imu_xsens driver
--------------------+-----------------------------------
Reporter: lech01 | Owner: rock-dev-mailing-list
Type: defect | Status: new
Priority: minor | Milestone:
Component: base | Keywords:
--------------------+-----------------------------------
The imu_xsens driver is showing frequent timeout errors, even when timeout
is set very high (e.g. 5 seconds). Timeouts are reported by the underlying
mtsdk driver, although data is coming through:
[20131211-16:44:35:094] [ERROR] - ""::Could not process data: Timeout
occurred, no data was received
(/home/leifole/dev/rock/smallrock/drivers/orogen/imu_xsens/tasks/Task.cpp:132
- virtual void imu_xsens::Task::updateHook())
In the update hook, it's the processBufferedDate call:
if( (rv = mt_device->processBufferedData(data, msgs)) != XRV_OK )
{
LOG_ERROR( "Could not process data: %s", XsResultValue_toString( rv
) );
new_state = EMPTY_BUFFER;
}
Looking at processBufferedData, it seems XRV_TIMEOUTNODATA is returned
even if there hasn't been a timeout, but just an invalid packet was read:
XsResultValue DeviceClass::processBufferedData(XsByteArray& rawIn,
XsMessageArray& messages)
{
ProtocolHandler protocol;
if (rawIn.size())
m_dataBuffer.append(rawIn);
int popped = 0;
messages.clear();
for(;;)
{
XsByteArray raw(m_dataBuffer.data()+popped,
m_dataBuffer.size()-popped);
XsMessage message;
MessageLocation location = protocol.findMessage(message,
raw);
if (location.isValid())
{
// message is valid, remove data from cache
popped += location.m_size + location.m_startPos;
messages.push_back(message);
}
else
{
if (popped)
m_dataBuffer.pop_front(popped);
if (messages.empty())
return XRV_TIMEOUTNODATA;
return XRV_OK;
}
}
}
Don't want to fiddle around too much with the xsens sdk, so not sure how
to handle this...
--
Ticket URL: <http://rock.opendfki.de/ticket/398>
rock <http://rock.opendfki.de>
rock: the robot construction kit
More information about the Rock-dev
mailing list