robotology / whole-body-estimators

YARP devices that implement estimators for humanoid robots.
26 stars 12 forks source link

Design, expose, and export new interfaces for estimated quantities #80

Open diegoferigo opened 4 years ago

diegoferigo commented 4 years ago

In this issue I want to propose to update the following devices:

in such a way that, besides streaming estimated quantities though yarp port, also expose a C++ interface.

This approach is very useful in the case the devices are launched from C++. In fact, if the devices expose a known interface, this interface can be viewed and data could be extracted though it. No network communication is required.

Another advantage of this approach, is that the code that streams data to the network could be moved to a wrapper, simplifying the code of the devices and ease their maintenance.

This architecture is used extensively by wearables and human-dynamic-estimation. These two projects are part of a very complex architecture, and they have been designed to be extremely modular with this device + wrapper approach. Despite the complexity of the overall architecture, its design turned out to be very robust and efficient.

In that case, for the network communication, all the interfaces were implemented with thrift. While this is a powerful approach, it requires distributing the thrift files so that also the other side of the communication can read the sent data structure. In the case of this repo's devices, I don't think it is necessary, not in the first stage at least. Even with these new C++ interfaces, all the network stack could remain unchanged, avoiding to break all the existing code (that is a lot) that reads from wbd.

@traversaro @prashanthr05 @HosameldinMohamed