Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YarpLoggerDevice signal length different when saving #878

Open
GiulioRomualdi opened this issue Aug 26, 2024 · 2 comments
Open

YarpLoggerDevice signal length different when saving #878

GiulioRomualdi opened this issue Aug 26, 2024 · 2 comments

Comments

@GiulioRomualdi
Copy link
Member

GiulioRomualdi commented Aug 26, 2024

We noticed that some datasets we collected back in time are corrupted because the length of the joint position differs from the one of the joint velocity. This shouldn't happen since the pushing in the buffer manager and retrieving the data are done in the same thread of the logger.

Looking at the timestamps of the data we noticed that the data related to the joint position is longer than the one of the joint velocity.

image

Notice that for this specific dataset, the data were saved by the inner thread of the buffer manager and not closing the application. Since this behavior does not happen in the case of the logger being closed (i.e., the buffer manager is destroyed) we were wondering if there is an issue in the saving of the data using the inner thread of robometry

cc @traversaro @S-Dafarra @LoreMoretti @isorrentino

Associated to: #877

@S-Dafarra
Copy link
Member

Does the same thing happen also for other data? I wonder if the condition in

if (m_robotSensorBridge->getJointPositions(m_jointSensorBuffer))
was returning false maybe?

@S-Dafarra
Copy link
Member

we were wondering if there is an issue in the saving of the data using the inner thread of robometry

The hunch might be correct. Checking the periodic save code in https://github.com/robotology/robometry/blob/bb2ea36c90141b9a6ac2be903619786734f95a52/src/librobometry/src/BufferManager.cpp#L230-L249, it seems that it locks the mutex m_mutex_cv, but this mutex is not locked when pushing back to the channel https://github.com/robotology/robometry/blob/bb2ea36c90141b9a6ac2be903619786734f95a52/src/librobometry/include/robometry/BufferManager.h#L421-L453.
This might mean that while saving the buffer (done in https://github.com/robotology/robometry/blob/bb2ea36c90141b9a6ac2be903619786734f95a52/src/librobometry/src/BufferManager.cpp#L158-L202), it is still possible to push to the channels that have not been saved yet 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants