Open SimoneMic opened 3 months ago
It looks like that: In yarp the timestamp is read from the subdevice but not used, instead it is assigned a generated timestamp: https://github.com/robotology/yarp/blob/93ac24db717e847304e200b0be807671cad63e89/src/devices/networkWrappers/multipleanalogsensorsserver/MultipleAnalogSensorsServer.cpp#L565
In ros2 the timestamp is the one obtained by the subdevice. https://github.com/robotology/yarp-devices-ros2/blob/3a1f4de56e6ff39c8d7feb50dcec6c07627d5905/src/devices/multipleAnalogSensors_nws_ros2/WrenchStamped_nws_ros2.cpp#L24
I thus think that we can consider two different issues here:
embObjMultipleFTsensors
should implement the generation of the timestamp. @marcoaccamemultipleAnalogSensorServer
could be improved to use the timestamp from the subdevice, if available and create a new timestamp otherwise @traversaro In yarp the timestamp is read from the subdevice but not used, instead it is assigned a generated timestamp: https://github.com/robotology/yarp/blob/93ac24db717e847304e200b0be807671cad63e89/src/devices/networkWrappers/multipleanalogsensorsserver/MultipleAnalogSensorsServer.cpp#L565
Good point, we indeed have the timestamp attribute in the message so we should just use it: https://github.com/robotology/yarp/blob/93ac24db717e847304e200b0be807671cad63e89/src/devices/messages/multipleAnalogSensorsMsgs/multipleAnalogSensorsSerializations.thrift#L15 .
In yarp the timestamp is read from the subdevice but not used, instead it is assigned a generated timestamp: https://github.com/robotology/yarp/blob/93ac24db717e847304e200b0be807671cad63e89/src/devices/networkWrappers/multipleanalogsensorsserver/MultipleAnalogSensorsServer.cpp#L565
Good point, we indeed have the timestamp attribute in the message so we should just use it: https://github.com/robotology/yarp/blob/93ac24db717e847304e200b0be807671cad63e89/src/devices/messages/multipleAnalogSensorsMsgs/multipleAnalogSensorsSerializations.thrift#L15 .
Looking a bit more, I think the timestamps are properly handled on YARP, on the server side in https://github.com/robotology/yarp/blob/93ac24db717e847304e200b0be807671cad63e89/src/devices/networkWrappers/multipleanalogsensorsserver/MultipleAnalogSensorsServer.cpp#L475-L482 and on the client side in https://github.com/robotology/yarp/blob/93ac24db717e847304e200b0be807671cad63e89/src/devices/networkWrappers/multipleanalogsensorsclient/MultipleAnalogSensorsClient.cpp#L227 . The stamp added to the YARP message is never used by the client, but if anyone is interested in modifying its logic I would be happy to point on the right modifications to do.
As per title, the
wrenchStamped_nws_ros2
on ergocub configuraton (on both feet) provides a wrong header, with negativestamp
and noframe_id
. On the YARP side everything seems fine, so I think that is a device issue.This is a sample of the message from a read on the cmd:
yarp read ... /ergocub/right_leg/FT/measures:o
Meanwhile, if I echo the topic from
ros2 topic echo /left_foot_heel_tiptoe_ft
I have:Meanwhile, another topic (like
/tf
) has the following header:This is the config file of the device (link):
And the subdevice: