Skip to content

Remove unused types.h include, fix compilation with osqp 1.0.0 and fix flaky QPInverseKinematics test#983

Merged
GiulioRomualdi merged 2 commits into
gbionics:masterfrom
traversaro:fixosqp1
Jun 4, 2025
Merged

Remove unused types.h include, fix compilation with osqp 1.0.0 and fix flaky QPInverseKinematics test#983
GiulioRomualdi merged 2 commits into
gbionics:masterfrom
traversaro:fixosqp1

Conversation

@traversaro
Copy link
Copy Markdown
Collaborator

The types.h header was included in two .cpp files but was unused. It worked only by chance as osqp <= 0.6 had a include names types.h, but the compilation with osqp 1.0.0 is now failing with error:

[112/344] Building CXX object src/IK/CMakeFiles/IK.dir/src/JointLimitsTask.cpp.o
FAILED: src/IK/CMakeFiles/IK.dir/src/JointLimitsTask.cpp.o 
/home/conda/feedstock_root/build_artifacts/bipedal-locomotion-framework-split_1748901278298/_build_env/bin/x86_64-conda-linux-gnu-c++ -DFMT_SHARED -DIK_EXPORTS -DOSQP_EIGEN_OSQP_IS_V1 -DOSQP_EIGEN_OSQP_IS_V1_FINAL -DOSQP_SHARED_LIB -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -DSPDLOG_SHARED_LIB -D_USE_MATH_DEFINES -Dcasadi_VERSION=3.7.0 -I/home/conda/feedstock_root/build_artifacts/bipedal-locomotion-framework-split_1748901278298/work/src/IK/include -I/home/conda/feedstock_root/build_artifacts/bipedal-locomotion-framework-split_1748901278298/work/src/ParametersHandler/include -I/home/conda/feedstock_root/build_artifacts/bipedal-locomotion-framework-split_1748901278298/work/src/GenericContainer/include -I/home/conda/feedstock_root/build_artifacts/bipedal-locomotion-framework-split_1748901278298/work/src/TextLogging/include -I/home/conda/feedstock_root/build_artifacts/bipedal-locomotion-framework-split_1748901278298/work/src/System/include -I/home/conda/feedstock_root/build_artifacts/bipedal-locomotion-framework-split_1748901278298/work/src/Conversions/include -isystem /home/conda/feedstock_root/build_artifacts/bipedal-locomotion-framework-split_1748901278298/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/include/eigen3 -isystem /home/conda/feedstock_root/build_artifacts/bipedal-locomotion-framework-split_1748901278298/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/include/osqp -fvisibility-inlines-hidden -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/conda/feedstock_root/build_artifacts/bipedal-locomotion-framework-split_1748901278298/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/include -fdebug-prefix-map=/home/conda/feedstock_root/build_artifacts/bipedal-locomotion-framework-split_1748901278298/work=/usr/local/src/conda/libbipedal-locomotion-framework-0.21.1 -fdebug-prefix-map=/home/conda/feedstock_root/build_artifacts/bipedal-locomotion-framework-split_1748901278298/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh=/usr/local/src/conda-prefix -O3 -DNDEBUG -std=c++17 -fPIC -MD -MT src/IK/CMakeFiles/IK.dir/src/JointLimitsTask.cpp.o -MF src/IK/CMakeFiles/IK.dir/src/JointLimitsTask.cpp.o.d -o src/IK/CMakeFiles/IK.dir/src/JointLimitsTask.cpp.o -c /home/conda/feedstock_root/build_artifacts/bipedal-locomotion-framework-split_1748901278298/work/src/IK/src/JointLimitsTask.cpp
/home/conda/feedstock_root/build_artifacts/bipedal-locomotion-framework-split_1748901278298/work/src/IK/src/JointLimitsTask.cpp:9:10: fatal error: types.h: No such file or directory
    9 | #include <types.h>
      |          ^~~~~~~~~

let's unconditionally remove this inclusion as as far as I can see it was never actually used.

@GiulioRomualdi GiulioRomualdi enabled auto-merge (squash) June 3, 2025 20:01
@GiulioRomualdi
Copy link
Copy Markdown
Collaborator

The Ik fails with a high error in the tracking of the task. Perhaps this is due to the new version of osqp?! 🤔

@traversaro
Copy link
Copy Markdown
Collaborator Author

The Ik fails with a high error in the tracking of the task. Perhaps this is due to the new version of osqp?! 🤔

Yeah, that could be related.

@traversaro
Copy link
Copy Markdown
Collaborator Author

Interestingly, here the CI fails only on Windows as libosqp is update to 1.0.0 only there, while on Linux and macOS it is still using libosqp 0.6.3. However, in conda-forge/bipedal-locomotion-framework-feedstock#119 libosqp 1.0.0 is used everywhere, and the test failure is only on Windows.

@traversaro
Copy link
Copy Markdown
Collaborator Author

traversaro commented Jun 4, 2025

Interestingly, here the CI fails only on Windows as libosqp is update to 1.0.0 only there, while on Linux and macOS it is still using libosqp 0.6.3. However, in conda-forge/bipedal-locomotion-framework-feedstock#119 libosqp 1.0.0 is used everywhere, and the test failure is only on Windows.

No, actually the test is only running on Windows, see https://github.com/conda-forge/bipedal-locomotion-framework-feedstock/blob/ad38c2862a232dc4f95f5d093dd02c8a012b535a/recipe/build_cxx.sh#L48C63-L50, conda-forge/bipedal-locomotion-framework-feedstock#29, conda-forge/bipedal-locomotion-framework-feedstock#102 (comment) and #685 .

@S-Dafarra
Copy link
Copy Markdown
Collaborator

I never really understood why the test on the distance task is so brittle. Maybe it is more affected by singularities? 🤔

@traversaro
Copy link
Copy Markdown
Collaborator Author

traversaro commented Jun 4, 2025

I never really understood why the test on the distance task is so brittle. Maybe it is more affected by singularities? 🤔

For sure it does not help that OSQP is non-deterministic by default, I remember having some test failures also in qpsolvers-eigen . Anyhow, I just tested and indeed the test pass fine on Linux, I am now testing on Windows.

@traversaro traversaro changed the title Remove unused types.h include and fix compilation with osqp 1.0.0 Remove unused types.h include, fix compilation with osqp 1.0.0 and fix flaky QPInverseKinematics test Jun 4, 2025
@traversaro
Copy link
Copy Markdown
Collaborator Author

I never really understood why the test on the distance task is so brittle. Maybe it is more affected by singularities? 🤔

For sure it does not help that OSQP is non-deterministic by default, I remember having some test failures also in qpsolvers-eigen . Anyhow, I just tested and indeed the test pass fine on Linux, I am now testing on Windows.

The non-determinism was not due to OSQP, but due to the use of iDynTree test helpers, that use C-based Random Number Generator, without a proper seed. I added a seed that should ensure that the test is consistent, but probably it is possible to reproduce the failure also on Linux by varying that seed until we reach again the failure.

@GiulioRomualdi GiulioRomualdi merged commit e381996 into gbionics:master Jun 4, 2025
7 checks passed
@traversaro traversaro deleted the fixosqp1 branch June 4, 2025 09:07
@traversaro
Copy link
Copy Markdown
Collaborator Author

Interestingly, here the CI fails only on Windows as libosqp is update to 1.0.0 only there, while on Linux and macOS it is still using libosqp 0.6.3. However, in conda-forge/bipedal-locomotion-framework-feedstock#119 libosqp 1.0.0 is used everywhere, and the test failure is only on Windows.

The reason for this was yet another. Apparently the IK component was explicitly disabled in CI (see https://github.com/ami-iit/bipedal-locomotion-framework/blob/e381996a08d79ecafda2077cb3be3dde535e1e4f/.github/workflows/conda-forge-ci.yml#L84) since #229 . I fixed this in #986 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants