Closed traversaro closed 1 year ago
On Windows the CI is also failing with error:
2023-01-11T14:37:24.5031950Z D:\a\yarp-devices-ros2\yarp-devices-ros2\src\devices\multipleAnalogSensors_nws_ros2\Imu_nws_ros2.cpp(48,33): error C2065: 'M_PI': undeclared identifier [D:\a\yarp-devices-ros2\yarp-devices-ros2\build\src\devices\multipleAnalogSensors_nws_ros2\yarp_imu_nws_ros2.vcxproj]
2023-01-11T14:37:24.5034373Z D:\a\yarp-devices-ros2\yarp-devices-ros2\src\devices\multipleAnalogSensors_nws_ros2\Imu_nws_ros2.cpp(48,59): error C2065: 'M_PI': undeclared identifier [D:\a\yarp-devices-ros2\yarp-devices-ros2\build\src\devices\multipleAnalogSensors_nws_ros2\yarp_imu_nws_ros2.vcxproj]
2023-01-11T14:37:24.5036417Z D:\a\yarp-devices-ros2\yarp-devices-ros2\src\devices\multipleAnalogSensors_nws_ros2\Imu_nws_ros2.cpp(48,85): error C2065: 'M_PI': undeclared identifier [D:\a\yarp-devices-ros2\yarp-devices-ros2\build\src\devices\multipleAnalogSensors_nws_ros2\yarp_imu_nws_ros2.vcxproj]
2023-01-11T14:37:24.5037766Z D:\a\yarp-devices-ros2\yarp-devices-ros2\src\devices\multipleAnalogSensors_nws_ros2\Imu_nws_ros2.cpp(48,97): error C2660: 'tf2::Quaternion::setRPY': function does not take 1 arguments [D:\a\yarp-devices-ros2\yarp-devices-ros2\build\src\devices\multipleAnalogSensors_nws_ros2\yarp_imu_nws_ros2.vcxproj]
2023-01-11T14:37:24.5038943Z C:/Miniconda3/envs/test/Library/include/tf2\tf2/LinearMath/Quaternion.h(88,8): message : see declaration of 'tf2::Quaternion::setRPY' [D:\a\yarp-devices-ros2\yarp-devices-ros2\build\src\devices\multipleAnalogSensors_nws_ros2\yarp_imu_nws_ros2.vcxproj]
2023-01-11T14:37:24.5040061Z D:\a\yarp-devices-ros2\yarp-devices-ros2\src\devices\multipleAnalogSensors_nws_ros2\Imu_nws_ros2.cpp(56,55): error C2065: 'M_PI': undeclared identifier [D:\a\yarp-devices-ros2\yarp-devices-ros2\build\src\devices\multipleAnalogSensors_nws_ros2\yarp_imu_nws_ros2.vcxproj]
2023-01-11T14:37:24.5041227Z D:\a\yarp-devices-ros2\yarp-devices-ros2\src\devices\multipleAnalogSensors_nws_ros2\Imu_nws_ros2.cpp(57,55): error C2065: 'M_PI': undeclared identifier [D:\a\yarp-devices-ros2\yarp-devices-ros2\build\src\devices\multipleAnalogSensors_nws_ros2\yarp_imu_nws_ros2.vcxproj]
2023-01-11T14:37:24.5042377Z D:\a\yarp-devices-ros2\yarp-devices-ros2\src\devices\multipleAnalogSensors_nws_ros2\Imu_nws_ros2.cpp(58,55): error C2065: 'M_PI': undeclared identifier [D:\a\yarp-devices-ros2\yarp-devices-ros2\build\src\devices\multipleAnalogSensors_nws_ros2\yarp_imu_nws_ros2.vcxproj]
Probably we need to just define _USE_MATH_DEFINES
(see https://github.com/search?q=repo%3Arobotology-playground%2Fyarp-devices-ros2%20_USE_MATH_DEFINES&type=code).
yep it seems that on windows is failing due to that reason. maybe is just enough to add the three lines :
ifndef _USE_MATH_DEFINES
#define _USE_MATH_DEFINES
#endif
I added those lines. Note that is important to make sure that it is the first include of the compilation unit, to ensure that no transitive header already include cmath without _USE_MATH_DEFINES
being defined.
CI seems to be happy now.
wonderful! :)
Currently the CI is failing on Linux and Windows with a weird conflict error. This is due to the fact that we are install mamba on the top of miniconda3 . We solve the problem by directly using mambaforge .
Similar to: