Closed GiulioRomualdi closed 2 years ago
cc @traversaro @S-Dafarra @AlexAntn @Nicogene
Hi @Nicogene sorry for the delay. I updated the readme https://github.com/robotology/yarp-telemetry/pull/146/commits/c151bcc1211e3f6a4d23bb5bcfd267da47d163a2 I added an example https://github.com/robotology/yarp-telemetry/pull/146/commits/3e854b0b27aa0bfb9c33cb5ce8191b21039d7441 and I updated the tests https://github.com/robotology/yarp-telemetry/pull/146/commits/be130431ae72780c4babbb78d86e7738f0e72277.
Let me know if it is fine with you 😄
Merged, thanks!
This PR implements a new approach to save data in
yarp-telemetry
library. Before entering into the details I want to underline that:As already explained in https://github.com/robotology/yarp-telemetry/issues/145 one of the main limitations of telemetry is the absence of a multilayer structure to store the data. For instance, it would be nice to have all the measurements of the FT contained in the same Matlab structure. Having this goal in mind we can imagine that a
mat
file is just atree
containing several structures where each leaf is aBufferInfo
. The following picture represents the content of amat
. The orange circles are theBufferInfo
(i.e. the leaf of the tree) and the gray one is the intermediate structure.In this case, it will be possible to access the element
E2
with the followingMatlab
commandSince we do not want to change the
BufferManager
interface (I want to keep the back compatibility with the already existing code), I decided (discussing with @S-Dafarra and @traversaro) to use a string separator to consider nested struct in the creation of a new channel. For instance in order to add the elementE2
represented in the above figure the channel has to be defined as followsThis PR contains the implementation of what I have just explained. The main contribution is the introduction of the
TreeNode
class that represents anode
of the tree. Each node contains a dictionary of childer and a pointer to aBufferInfo
.The
BufferManager::m_buffer_map
data struct used to contain the buffer has been substituted by thestd::shared_ptr<TreeNode<BufferInfo<T>>> m_tree
and the buffer manager is in charge to explore the tree to update the content of theBufferInfo
and save them in amat
file.TODO:
cc @traversaro and @S-Dafarra