-
Notifications
You must be signed in to change notification settings - Fork 105
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 rawValuesPublisherInterface and related nws and nwc to stream and save raw values #983
Add rawValuesPublisherInterface and related nws and nwc to stream and save raw values #983
Conversation
I am a bit afraid of depending on YARP 3.10 functionality until that is actually released, as this will prevent us to be able to release icub-main until YARP 3.10 is released. Do we have any specific plan to deal with this? |
ugh no! When we discussed this activity this issue was not pointed out. 😢 |
How did you tested the code? The master branch of superbuild and the conda package use YARP 3.9, so I guess you had to manually change something to be able to use the master branch of YARP (unless you were cloning and. compiling all the dependencies manually). |
Depending on the timeline for this we can try to understand with Randaz if there is an expected release date of YARP 3.10. |
More or less you're right. Basically I've compiled the superbuild as unstable and then I've enabled the DEVEL mode for icub-main and YARP. And I was based on a stable branch on the master branch thus to use the paramParserGenerator. |
I've updated the code so that we can locally use the paramParserGenerator on the nws and nwc and then, once we have the generated files and pushed them on the repo, we can disable that plugin so that we can temporarily let icub-main being not dependent by yarp 3.10 |
src/libraries/icubmod/fakeRawValuesPublisher/FakeRawValuesPublisher_params.md
Outdated
Show resolved
Hide resolved
Hi @MSECode , I still need to check embObjMotioncontrol |
f45ae6f
to
a79fa4e
Compare
4aa8774
to
f4f6953
Compare
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.
Hi @MSECode , well done! you completed a very complex activity! 🚀
I request some changes that I can summarize in the following point:
- move in cpp all the includes that are not necessary in .h file in to avoid unuseful dependency.
- in EmbObJMotionControl add the function
getBoardInfo()
in the log prints in order to have an accurate log. - REmove all debug code or put under a macro compilation if you think you still need in some cases.
- Verify if the client gets an error if it doesn't receive data for a configurable timeout.
thanks heap!
src/libraries/icubmod/embObjMotionControl/embObjMotionControl.cpp
Outdated
Show resolved
Hide resolved
src/libraries/icubmod/embObjMotionControl/embObjMotionControl.cpp
Outdated
Show resolved
Hide resolved
src/libraries/icubmod/embObjMotionControl/embObjMotionControl.cpp
Outdated
Show resolved
Hide resolved
src/libraries/icubmod/rawValuesPublisherServer/RawValuesPublisherServer.cpp
Outdated
Show resolved
Hide resolved
src/libraries/icubmod/rawValuesPublisherServer/RawValuesPublisherServer.cpp
Outdated
Show resolved
Hide resolved
src/libraries/icubmod/rawValuesPublisherServer/RawValuesPublisherServer.h
Outdated
Show resolved
Hide resolved
src/tools/motorTemperaturePublisher/src/MotorTemperaturePublisher.h
Outdated
Show resolved
Hide resolved
src/tools/motorTemperaturePublisher/src/MotorTemperaturePublisher.cpp
Outdated
Show resolved
Hide resolved
2acd90b
to
a8f5d19
Compare
Hi @MSECode,
|
This feature allows to publisher raw data coming from the sensor boards to yarp ports, so that they can be then collected by the TelemetryDeviceDumper and added to a MATLAB file. Together with the Interface we have the network wrappers server and client and the fake device that can be used for testing of new raw data Interface has been made exploiting thrift and wrappers use the paramparsergenerator Regarding this for now the genrated files are pushed and their re-generation is disabled waiting for yarp 3.10
a8f5d19
to
54a0125
Compare
Fixed all. I think now we can move the PR to ready. I'll double check everything but I suppose we are ok |
Thanks for your contribution @MSECode 👍🏻 |
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.
Few prelimar comments, I will give a second look soon
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>") | ||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/iCub>" | ||
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>" | ||
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/iCub>") | ||
target_link_libraries(${PROJECT_NAME} YARP::YARP_os |
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.
Let's see if @traversaro has a better solution for this one we found
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 the problem is that the thrift classes do not have any namespace (that is true also for generated public classes that are just defined in the global namespace). Since robotology/yarp#2028, the include should be placed in include/<namespace>
, so if we use the iCub
namespace in thrift files we should be good to go and there will be no need to specifiy additional include directories as done 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.
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.
If it's allowed by the automation, I'd like to segregate generated files in dedicated directories.
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.
Sure, in that case you just need to have two directories passed as BUILD_INTERFACE
interface, and only one install (I am not a big fan of using thrift-generated files in public interfaces due to this), something like:
target_include_directories(${PROJECT_NAME} PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/autogenerated/include>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
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.
As per discussion w/ @valegagge and @Nicogene I'm gonna fix the CMakeLists.txt as proposed by @traversaro. Thus also the generated files should not be together with the hand-coded ones.
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.
Thanks heaps!
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 one thing.
I tried to compile everything but without this line:
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/autogenerated>"
in src/libraries/iCubDev/CMakeLists.txt
robometry
compilation keeps failing with errors in finding the include:
[ 88%] Building CXX object src/telemetryDeviceDumper/CMakeFiles/yarp_telemetryDeviceDumper.dir/TelemetryDeviceDumper.cpp.o
In file included from /home/iiticublap258/Workspace/robometry/src/telemetryDeviceDumper/TelemetryDeviceDumper.h:22,
from /home/iiticublap258/Workspace/robometry/build/src/telemetryDeviceDumper/yarp_plugin_telemetryDeviceDumper.cpp:10:
/home/iiticublap258/Workspace/robotology-superbuild/build/install/include/iCub/IRawValuesPublisher.h:9:10: fatal error: iCub/rawValuesDataVectorsMap.h: No such file or directory
9 | #include <iCub/rawValuesDataVectorsMap.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
[ 96%] Built target CB_to_matfile_example
make[2]: *** [src/telemetryDeviceDumper/CMakeFiles/yarp_telemetryDeviceDumper.dir/build.make:76: src/telemetryDeviceDumper/CMakeFiles/yarp_telemetryDeviceDumper.dir/yarp_plugin_telemetryDeviceDumper.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /home/iiticublap258/Workspace/robometry/src/telemetryDeviceDumper/TelemetryDeviceDumper.h:22,
from /home/iiticublap258/Workspace/robometry/src/telemetryDeviceDumper/TelemetryDeviceDumper.cpp:8:
/home/iiticublap258/Workspace/robotology-superbuild/build/install/include/iCub/IRawValuesPublisher.h:9:10: fatal error: iCub/rawValuesDataVectorsMap.h: No such file or directory
9 | #include <iCub/rawValuesDataVectorsMap.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [src/telemetryDeviceDumper/CMakeFiles/yarp_telemetryDeviceDumper.dir/build.make:90: src/telemetryDeviceDumper/CMakeFiles/yarp_telemetryDeviceDumper.dir/TelemetryDeviceDumper.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:236: src/telemetryDeviceDumper/CMakeFiles/yarp_telemetryDeviceDumper.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
@@ -170,7 +171,7 @@ eObool_t feat_manage_motioncontrol_addinfo_multienc(eOipv4addr_t ipv4, eOprotID3 | |||
{ | |||
multienc->update(id32, yarp::os::Time::now(), rxdata); | |||
} | |||
|
|||
*/ |
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.
Instead of commenting out, isn't better to remove it? There is a plan for re-enabling 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.
I think there might be a plan to re-enabling it, even though it is probably gonna be removed soon as part of this: #929
But there might be a moment in which we need to re-enable it before removing. I'm not 100% sure about that.
@valegagge, do u have a more clear idea about this?
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.
src/libraries/icubmod/fakeRawValuesPublisher/FakeRawValuesPublisher_ParamsParser.cpp
Show resolved
Hide resolved
# CopyPolicy: Released under the terms of the GNU GPL v2.0. | ||
# | ||
# rawValuePublisher.thrift | ||
|
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.
namespace yarp iCub |
Adding a namespace here should ensure that all the classes are generated in the correct iCub namespace. See https://github.com/ami-iit/bipedal-locomotion-framework/blob/da3d948990fdab29daf8da9ccb90fb93a093804b/src/YarpUtilities/thrifts/BipedalLocomotion/YarpUtilities/VectorsCollection.thrift#L1 for an example of this (if you want more nested namespaces, you can nest them with iCub.debugLibrary
.
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 updated the comment for more details).
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.
Hi @MSECode
Well done 👍🏻
I've got two main concerns though:
- I don't think it's a good strategy to mix hand-coded files with generated files in the same directory. This happens for files located in
iCubDev/include
. Can you instead reserve a dedicated folder for generated files? - The names of the plugins that include
yarp_
. It's way better to remove the prefix in my view.
src/tools/fakeRawDataPublisherTester/src/FakeRawDataPublisherTester.cpp
Outdated
Show resolved
Hide resolved
Hi @pattacini, |
…make compilation better
771458e
to
054ebb5
Compare
Thank you @MSECode 👍🏻 The only point remaining is whether it is convenient or not to commit autogenerated files as per our T2T update, or maintain only the .thrift file. |
Another quite important point to consider is robotology/robometry#190 (comment). cc @MSECode |
As discussed, it's ok to keep the autogenerated files committed to the repo 👍🏻 |
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.
Hi @MSECode
As discussed during today's meetup, two things have to be addressed before merging:
- Increasing the minor number of icub-main release (major.minor.patch). I think minor is more appropriate than patch here.
- Fixing the cmake installation of the generated headers in the correct path.
Yes that's correct.
This should be all. If I missed something please add. |
Pitch perfect 👍🏻 |
Pushed fixed requested and checked compilation on a clean container and behavior on a setup. |
This PR add the interface
rawValuesPublisher
and related network wrappers (client and server) to get the raw values and their metadata from the fw level (boards) and stream them to yarp ports so that they can be read on the port and be read by thetelemetryDeviceDumper
plugin so that a user can save them to a MATLAB file.In this updates we have also modified iCubDev
CMakeLists.txt
to compile and installed the thrift generated files related to the new interface. (As already discussed with @Nicogene we need to revise these updates).I've also add to the tools a module used initially for testing the whole pipeline without using the telemetryDeviceDumper.
This PR is, in fact, related to robotology/robometry#190
and as for that is still under review since it brings lots of changes and it's better to discuss some of the choices, such as the interface and its methods, to check if they have been designed as desired.
cc: @valegagge @Nicogene @traversaro