robotology / human-dynamics-estimation

Software repository for estimating human dynamics
BSD 3-Clause "New" or "Revised" License
80 stars 28 forks source link

Cleanup use of YARP deprecated methods #296

Closed traversaro closed 2 years ago

traversaro commented 2 years ago

YARP deprecated methods such as asDouble are used in the codebase, for example in https://github.com/robotology/human-dynamics-estimation/blob/f7913df5d63e54e626b885c18ba45826f5d578b9/devices/HumanWrenchProvider/HumanWrenchProvider.cpp#L117 . That code will not compile once https://github.com/robotology/yarp/pull/2833 is merged.

traversaro commented 2 years ago

fyi @lrapetti

lrapetti commented 2 years ago

Done in https://github.com/robotology/human-dynamics-estimation/pull/297

traversaro commented 2 years ago

Apparently there are still some deprecated functions, see this output from https://github.com/robotology/robotology-superbuild/issues/1125#issuecomment-1134261993 :

2022-05-23T03:55:05.8809863Z [8/56] Building CXX object devices/HumanStateProvider/CMakeFiles/HumanStateProvider.dir/HumanStateProvider.cpp.o
2022-05-23T03:55:05.8810879Z FAILED: devices/HumanStateProvider/CMakeFiles/HumanStateProvider.dir/HumanStateProvider.cpp.o 
2022-05-23T03:55:05.8816692Z /usr/share/miniconda3/envs/test/bin/x86_64-conda-linux-gnu-c++ -DHumanStateProvider_EXPORTS -DUSING_DEPRECATED_UPPERCASE_YARP_OS_TARGET -I/home/runner/work/robotology-superbuild/robotology-superbuild/src/HumanDynamicsEstimation/devices/HumanStateProvider -I/home/runner/work/robotology-superbuild/robotology-superbuild/src/HumanDynamicsEstimation/devices/HumanStateProvider/SYSTEM -I/home/runner/work/robotology-superbuild/robotology-superbuild/src/HumanDynamicsEstimation/interfaces/IHumanState -I/home/runner/work/robotology-superbuild/robotology-superbuild/src/HumanDynamicsEstimation/HumanDynamicsEstimationLibrary/utils/include -I/home/runner/work/robotology-superbuild/robotology-superbuild/src/HumanDynamicsEstimation/HumanDynamicsEstimationLibrary/algorithms/include -isystem /usr/share/miniconda3/envs/test/include/eigen3 -isystem /home/runner/work/robotology-superbuild/robotology-superbuild/build/install/include -isystem /home/runner/work/robotology-superbuild/robotology-superbuild/build/install/include/osqp -fvisibility-inlines-hidden -std=c++17 -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /usr/share/miniconda3/envs/test/include -O3 -DNDEBUG -fPIC -std=gnu++17 -MD -MT devices/HumanStateProvider/CMakeFiles/HumanStateProvider.dir/HumanStateProvider.cpp.o -MF devices/HumanStateProvider/CMakeFiles/HumanStateProvider.dir/HumanStateProvider.cpp.o.d -o devices/HumanStateProvider/CMakeFiles/HumanStateProvider.dir/HumanStateProvider.cpp.o -c /home/runner/work/robotology-superbuild/robotology-superbuild/src/HumanDynamicsEstimation/devices/HumanStateProvider/HumanStateProvider.cpp
2022-05-23T03:55:05.8822577Z /home/runner/work/robotology-superbuild/robotology-superbuild/src/HumanDynamicsEstimation/devices/HumanStateProvider/HumanStateProvider.cpp: In member function 'virtual bool hde::devices::HumanStateProvider::impl::CmdParser::read(yarp::os::ConnectionReader&)':
2022-05-23T03:55:05.8824228Z /home/runner/work/robotology-superbuild/robotology-superbuild/src/HumanDynamicsEstimation/devices/HumanStateProvider/HumanStateProvider.cpp:320:26: error: 'class yarp::os::Bottle' has no member named 'addVocab'; did you mean 'addVocab32'?
2022-05-23T03:55:05.8824848Z   320 |                 response.addVocab(yarp::os::Vocab::encode("many"));
2022-05-23T03:55:05.8825145Z       |                          ^~~~~~~~
2022-05-23T03:55:05.8825388Z       |                          addVocab32
2022-05-23T03:55:05.8826224Z /home/runner/work/robotology-superbuild/robotology-superbuild/src/HumanDynamicsEstimation/devices/HumanStateProvider/HumanStateProvider.cpp:320:45: error: 'yarp::os::Vocab' has not been declared
2022-05-23T03:55:05.8826776Z   320 |                 response.addVocab(yarp::os::Vocab::encode("many"));
2022-05-23T03:55:05.8827081Z       |                                             ^~~~~
2022-05-23T03:55:05.8827506Z [9/56] Building CXX object devices/HumanWrenchProvider/CMakeFiles/HumanWrenchProvider.dir/HumanWrenchProvider.cpp.o
2022-05-23T03:55:05.8828863Z /home/runner/work/robotology-superbuild/robotology-superbuild/src/HumanDynamicsEstimation/devices/HumanWrenchProvider/HumanWrenchProvider.cpp: In member function 'virtual int hde::devices::HumanWrenchProvider::getState(int)':
2022-05-23T03:55:05.8830236Z /home/runner/work/robotology-superbuild/robotology-superbuild/src/HumanDynamicsEstimation/devices/HumanWrenchProvider/HumanWrenchProvider.cpp:884:1: warning: control reaches end of non-void function [-Wreturn-type]
2022-05-23T03:55:05.8830791Z   884 | }
2022-05-23T03:55:05.8830999Z       | ^
2022-05-23T03:55:05.8831384Z [10/56] Building CXX object devices/HumanStateProvider/CMakeFiles/HumanStateProvider.dir/IKWorkerPool.cpp.o
2022-05-23T03:55:05.8831824Z ninja: build stopped: subcommand failed.
2022-05-23T03:55:18.8143783Z [367/424] Performing build step for 'casadi-matlab-bindings'

To find all of them, you can check any CI job (such as https://github.com/robotology/human-dynamics-estimation/runs/6548201486) and search for Wdeprecated-declarations. fyi @RiccardoGrieco @lrapetti

traversaro commented 2 years ago

Thanks @lrapetti !