-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add iwear_logger wrapper device and AddInstallRPathSupport cmake module #113
Add iwear_logger wrapper device and AddInstallRPathSupport cmake module #113
Conversation
I need to update the CI for |
@prashanthr05 can you add the dependency of wearables on yarp-telemetry on the supernbuild? Thanks! |
Thanks a lot @prashanthr05, this is indeed a very useful tool that has always been missing. Just a comment on your description
the |
True, I meant those lines at an implementation level and not at an architecture level. I will update the comment for clarity. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before going through the code, I have a couple of comments. Can you please update the CHANGELOG.md
with the changes, and can you upload the example XML in https://github.com/robotology/wearables/tree/master/app/xml?
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Together with the sensor data, we can dump also the status of each sensor that is exposed with getSensorStatus
method.
Do you think it would be a good idea to prefix the actual measurements with the sensor status? |
while (pImpl->iWear->getStatus() == WearStatus::Calibrating | ||
|| pImpl->iWear->getStatus() == WearStatus::WaitingForFirstRead) { | ||
if (pImpl->waitingFirstReadCounter++ % 1000 == 0) { | ||
pImpl->waitingFirstReadCounter = 1; | ||
yInfo() << logPrefix << "IWear interface waiting for first data. Waiting..."; | ||
} | ||
return; | ||
} | ||
|
||
if (pImpl->iWear->getStatus() == WearStatus::Error | ||
|| pImpl->iWear->getStatus() == WearStatus::Unknown) { | ||
yError() << logPrefix << "The status of the IWear interface is not Ok (" | ||
<< static_cast<int>(pImpl->iWear->getStatus()) << ")"; | ||
askToStop(); | ||
return; | ||
} | ||
|
||
// case status is TIMEOUT or DATA_OVERFLOW | ||
if (pImpl->iWear->getStatus() != WearStatus::Ok) { | ||
yWarning() << logPrefix << "The status of the IWear interface is not Ok (" | ||
<< static_cast<int>(pImpl->iWear->getStatus()) << ")"; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a general observation, not strictly related to this PR.
The status that we are reading here is the status of the IWear
interface, which should basically return the status of the device that is streaming the sensors data (e.g. getting the status of the driver), and in general is independent from the status of each sensor.
Indeed, it is possible that the status of the device is Ok
, but the status of one of the sensor interface is different (and that's why it makes sense to dump it as I was pointing out).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, we are often using an IWearRemapper
device in between the producer device, and the consumer device (in this case would be the iwear_logger
), which merge data from multiple sources.
In this case, however, the state returned by getStatus()
is the "worst status" that is found among all the associated sensors interface (see https://github.com/robotology/wearables/blob/master/devices/IWearRemapper/src/IWearRemapper.cpp#L802-L845). As a consequence, the specific status of the sensors interface is hidden.
I think we can eventually discuss the current choice in the IWearRemapper
, and change it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines were a copy-paste from iWearWrapper. Do you think this might not be needed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines were a copy-paste from iWearWrapper. Do you think this might not be needed here?
No, I think is fine as it is. I would rather change some logic on the Remapper side
Maybe we can add it as a prefix, and meanwhile propose to add it in |
Done in 1b87ac3 |
I don't know what's going on with the Windows CI. For me we can disable it and substitute it in a following PR with a conda-based CI that gets YARP in binary form. |
Apart from that, looks like CI Ubuntu checks on |
@traversaro , for this adding the line find_or_build_package(YARP COMPONENTS telemetry QUIET) to https://github.com/robotology/robotology-superbuild/blob/master/cmake/Buildwearables.cmake must suffice right? |
@prashanthr05 the
I am not sure if |
Thanks for the heads up!! @Nicogene |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can proceed merging, and open a separate issue to move to conda-based Windows CI as @traversaro was suggesting
@prashanthr05 let me know if you want to clean the commit history or we can squash them and merge |
0baad03
to
36c95fb
Compare
I have reorganized the commits. |
Thanks @prashanthr05! |
Sorry for coming late to this PR, it looks good @prashanthr05! Though, it seems that your IDE didn't use clang-format. The next time someone is going to edit the file, a possibly big diff will get generated. If possible, I'd fix the style in a new PR. I'm not sure if recently the style has been enforced on all files @lrapetti @Yeshasvitvs. |
On my side, not really. Do you think it would make sense to open a PR to fix the style in the whole project? |
Until I was the maintainer of this project, I was enforcing the style strictly. With low priority, it could be done. I always thought to start using github actions for that, but I still haven't found enough time to check what the community offers. |
I am using KDevelop. I tried adding the source-formatting settings to support the clang-format and reformatted the source. Unfortunately, there's no change from the reformatting. Looks like something is not working on my IDE. |
Mmh ok, qtcreator automatically detects the I checked again the sources, and for sure the style is not uniform. Just check the if brackets, sometimes they are inline and some other time not. Be aware, when you start using clang-format there's no way back 😆 I'm a bit nazi on it, for reasons :) |
This PR,
AddInstallRPATHSupport
cmake module that was required to load the shared objects privately linked by the YARP device plugin.iwear_logger
wrapper device that can be attached to any wearable producer to log the data from all the sensors associated with the producer.At the heart of its implementation, It replaces,
with
A template for configuring the
iwear_logger
wrapper device can be as follows,The data is saved as a
<experimentName>_<timestamp>.mat
in the specified<path>
parameter.This mat file contains a struct called
<experimentName>
The sensors data are stored as a struct one for each wearable sensor. The name of this struct is a modified format of Wearable sensor name accounting for Matlab variable name handling. (Special characters like
@/()#
are converted to underscores and the wearable separator is converted to underscore.)TODO
xml
file toapp/xml
yarp-telemetry
yarp-telemetry
(Add YARP_telemetry dependency for wearables robotology-superbuild#730)Closes #112