robotology / whole-body-estimators

YARP devices that implement estimators for humanoid robots.
27 stars 12 forks source link

Compilation error when compiling against YARP 3.6 #134

Closed traversaro closed 2 years ago

traversaro commented 2 years ago

Error:

2021-12-24T13:10:43.9642369Z [24/37] Building CXX object devices/wholeBodyDynamics/CMakeFiles/wholeBodyDynamicsDevice.dir/WholeBodyDynamicsDevice.cpp.o
2021-12-24T13:10:43.9644045Z FAILED: devices/wholeBodyDynamics/CMakeFiles/wholeBodyDynamicsDevice.dir/WholeBodyDynamicsDevice.cpp.o 
2021-12-24T13:10:43.9652156Z /usr/bin/c++ -D_USE_MATH_DEFINES -DwholeBodyDynamicsDevice_EXPORTS -I/__w/robotology-superbuild/robotology-superbuild/src/whole-body-estimators/devices/wholeBodyDynamics -I/__w/robotology-superbuild/robotology-superbuild/build/src/whole-body-estimators/idl/wholeBodyDynamicsSettings/autogenerated/include -I/__w/robotology-superbuild/robotology-superbuild/build/src/whole-body-estimators/idl/wholeBodyDynamics_IDLServer/autogenerated/include -I/__w/robotology-superbuild/robotology-superbuild/src/whole-body-estimators/libraries/ctrlLibRT/include -isystem /usr/include/eigen3 -isystem /__w/robotology-superbuild/robotology-superbuild/build/install/include -g -fPIC -std=gnu++1z -MD -MT devices/wholeBodyDynamics/CMakeFiles/wholeBodyDynamicsDevice.dir/WholeBodyDynamicsDevice.cpp.o -MF devices/wholeBodyDynamics/CMakeFiles/wholeBodyDynamicsDevice.dir/WholeBodyDynamicsDevice.cpp.o.d -o devices/wholeBodyDynamics/CMakeFiles/wholeBodyDynamicsDevice.dir/WholeBodyDynamicsDevice.cpp.o -c /__w/robotology-superbuild/robotology-superbuild/src/whole-body-estimators/devices/wholeBodyDynamics/WholeBodyDynamicsDevice.cpp
2021-12-24T13:10:43.9659590Z In file included from /__w/robotology-superbuild/robotology-superbuild/src/whole-body-estimators/devices/wholeBodyDynamics/WholeBodyDynamicsDevice.cpp:2:0:
2021-12-24T13:10:43.9662079Z /__w/robotology-superbuild/robotology-superbuild/src/whole-body-estimators/devices/wholeBodyDynamics/WholeBodyDynamicsDevice.h:245:32: error: 'Editor' in 'class wholeBodyDynamicsSettings' does not name a type
2021-12-24T13:10:43.9663746Z      wholeBodyDynamicsSettings::Editor settingsEditor;
2021-12-24T13:10:43.9664339Z                                 ^~~~~~
2021-12-24T13:10:43.9666373Z /__w/robotology-superbuild/robotology-superbuild/src/whole-body-estimators/devices/wholeBodyDynamics/WholeBodyDynamicsDevice.cpp: In constructor 'yarp::dev::WholeBodyDynamicsDevice::WholeBodyDynamicsDevice()':
2021-12-24T13:10:43.9669567Z /__w/robotology-superbuild/robotology-superbuild/src/whole-body-estimators/devices/wholeBodyDynamics/WholeBodyDynamicsDevice.cpp:40:53: error: class 'yarp::dev::WholeBodyDynamicsDevice' does not have any field named 'settingsEditor'
2021-12-24T13:10:43.9671169Z                                                      settingsEditor(settings)
2021-12-24T13:10:43.9671636Z                                                      ^~~~~~~~~~~~~~
2021-12-24T13:10:43.9673639Z /__w/robotology-superbuild/robotology-superbuild/src/whole-body-estimators/devices/wholeBodyDynamics/WholeBodyDynamicsDevice.cpp: In member function 'bool yarp::dev::WholeBodyDynamicsDevice::openSettingsPort()':
2021-12-24T13:10:43.9676297Z /__w/robotology-superbuild/robotology-superbuild/src/whole-body-estimators/devices/wholeBodyDynamics/WholeBodyDynamicsDevice.cpp:65:28: error: 'settingsEditor' was not declared in this scope
2021-12-24T13:10:43.9677767Z      settingsPort.setReader(settingsEditor);
2021-12-24T13:10:43.9678311Z                             ^~~~~~~~~~~~~~

Detected in https://github.com/robotology/robotology-superbuild/pull/971#issuecomment-1000835241 .

traversaro commented 2 years ago

I guess this is due to changes from https://github.com/robotology/yarp/pull/2782 :

The editor for structs is now disabled by default. The yarp.editor annotation should be passed to the struct in order to enable it.

So we need to add yarp.editor string somewhere.

traversaro commented 2 years ago

An example is: https://github.com/drdanz/yarp/blob/c26bbd6437dcef76270d2a09971c6dff63e2f05b/tests/yarpidl_thrift/demo/settings.thrift#L16 or https://github.com/drdanz/yarp/blob/c26bbd6437dcef76270d2a09971c6dff63e2f05b/doc/thrift_editor.md .