conda-forge / dartsim-feedstock

A conda-smithy repository for dartsim.
BSD 3-Clause "New" or "Revised" License
1 stars 6 forks source link

test_ForceDependentSlip failure with libode==0.16.2==*_13 #62

Closed traversaro closed 3 months ago

traversaro commented 6 months ago

Solution to issue cannot be found in the documentation.

Issue

After the new build of libode that uses libccd (see https://github.com/conda-forge/libode-feedstock/pull/22), now the dart's test test_ForceDependentSlip fails, see https://github.com/conda-forge/dartsim-feedstock/pull/61/checks?check_run_id=22760346822 and https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=897543&view=logs&jobId=47084397-e614-5090-05b8-c04ebacb88b9 .

Installed packages

.

Environment info

.
traversaro commented 6 months ago

Example failure log:

2024-03-17T21:58:52.3326856Z       Start 34: test_ForceDependentSlip
2024-03-17T21:58:52.6935278Z 34/71 Test #34: test_ForceDependentSlip ...........***Failed    0.36 sec
2024-03-17T21:58:52.7013219Z Running main() from $SRC_DIR/unittests/gtest/src/gtest_main.cc
2024-03-17T21:58:52.7061822Z [==========] Running 2 tests from 1 test case.
2024-03-17T21:58:52.7069568Z [----------] Global test environment set-up.
2024-03-17T21:58:52.7070630Z [----------] 2 tests from ForceDependentSlip
2024-03-17T21:58:52.7102803Z [ RUN      ] ForceDependentSlip.BoxSlipVelocity
2024-03-17T21:58:52.7103255Z [       OK ] ForceDependentSlip.BoxSlipVelocity (222 ms)
2024-03-17T21:58:52.7103572Z [ RUN      ] ForceDependentSlip.CylinderSlipVelocity
2024-03-17T21:58:52.7103874Z $SRC_DIR/unittests/integration/test_ForceDependentSlip.cpp:265: Failure
2024-03-17T21:58:52.7104532Z The difference between extForceX * slip and body1->getLinearVelocity().x() is 0.00043832661683589763, which exceeds 1e-4, where
2024-03-17T21:58:52.7104981Z extForceX * slip evaluates to 0.02,
2024-03-17T21:58:52.7105347Z body1->getLinearVelocity().x() evaluates to 0.020438326616835898, and
2024-03-17T21:58:52.7105654Z 1e-4 evaluates to 0.0001.
2024-03-17T21:58:52.7105918Z $SRC_DIR/unittests/integration/test_ForceDependentSlip.cpp:266: Failure
2024-03-17T21:58:52.7106350Z The difference between 0.0 and body1->getLinearVelocity().y() is 0.005297929413959148, which exceeds 1e-4, where
2024-03-17T21:58:52.7106629Z 0.0 evaluates to 0,
2024-03-17T21:58:52.7107069Z body1->getLinearVelocity().y() evaluates to 0.005297929413959148, and
2024-03-17T21:58:52.7107376Z 1e-4 evaluates to 0.0001.
2024-03-17T21:58:52.7107631Z $SRC_DIR/unittests/integration/test_ForceDependentSlip.cpp:280: Failure
2024-03-17T21:58:52.7108200Z The difference between 0.0 and body2->getLinearVelocity().y() is 0.001254381120491032, which exceeds 1e-4, where
2024-03-17T21:58:52.7108591Z 0.0 evaluates to 0,
2024-03-17T21:58:52.7109367Z body2->getLinearVelocity().y() evaluates to 0.001254381120491032, and
2024-03-17T21:58:52.7109870Z 1e-4 evaluates to 0.0001.
2024-03-17T21:58:52.7110323Z $SRC_DIR/unittests/integration/test_ForceDependentSlip.cpp:265: Failure
2024-03-17T21:58:52.7111077Z The difference between extForceX * slip and body1->getLinearVelocity().x() is 0.00035668589428858657, which exceeds 1e-4, where
2024-03-17T21:58:52.7111420Z extForceX * slip evaluates to 0.02,
2024-03-17T21:58:52.7112755Z body1->getLinearVelocity().x() evaluates to 0.020356685894288587, and
2024-03-17T21:58:52.7113109Z 1e-4 evaluates to 0.0001.
2024-03-17T21:58:52.7113539Z $SRC_DIR/unittests/integration/test_ForceDependentSlip.cpp:266: Failure
2024-03-17T21:58:52.7113959Z The difference between 0.0 and body1->getLinearVelocity().y() is 0.0043113150438673625, which exceeds 1e-4, where
2024-03-17T21:58:52.7114245Z 0.0 evaluates to 0,
2024-03-17T21:58:52.7114716Z body1->getLinearVelocity().y() evaluates to 0.0043113150438673625, and
2024-03-17T21:58:52.7123500Z 1e-4 evaluates to 0.0001.
2024-03-17T21:58:52.7123884Z $SRC_DIR/unittests/integration/test_ForceDependentSlip.cpp:279: Failure
2024-03-17T21:58:52.7124482Z The difference between mass * accel.x() * slip and spinVel - linVel is 0.00048835745446274004, which exceeds 2e-4, where
2024-03-17T21:58:52.7124812Z mass * accel.x() * slip evaluates to 0.026508948770409546,
2024-03-17T21:58:52.7125413Z spinVel - linVel evaluates to 0.026997306224872286, and
2024-03-17T21:58:52.7126092Z 2e-4 evaluates to 0.00020000000000000001.
2024-03-17T21:58:52.7128069Z $SRC_DIR/unittests/integration/test_ForceDependentSlip.cpp:280: Failure
2024-03-17T21:58:52.7128526Z The difference between 0.0 and body2->getLinearVelocity().y() is 0.0013606856166480091, which exceeds 1e-4, where
2024-03-17T21:58:52.7128959Z 0.0 evaluates to 0,
2024-03-17T21:58:52.7135293Z body2->getLinearVelocity().y() evaluates to -0.0013606856166480091, and
2024-03-17T21:58:52.7135836Z 1e-4 evaluates to 0.0001.
2024-03-17T21:58:52.7136113Z $SRC_DIR/unittests/integration/test_ForceDependentSlip.cpp:265: Failure
2024-03-17T21:58:52.7136553Z The difference between extForceX * slip and body1->getLinearVelocity().x() is 0.00024724163885008962, which exceeds 1e-4, where
2024-03-17T21:58:52.7136863Z extForceX * slip evaluates to 0.02,
2024-03-17T21:58:52.7137190Z body1->getLinearVelocity().x() evaluates to 0.02024724163885009, and
2024-03-17T21:58:52.7137491Z 1e-4 evaluates to 0.0001.
2024-03-17T21:58:52.7137751Z $SRC_DIR/unittests/integration/test_ForceDependentSlip.cpp:266: Failure
2024-03-17T21:58:52.7138178Z The difference between 0.0 and body1->getLinearVelocity().y() is 0.002784063048611347, which exceeds 1e-4, where
2024-03-17T21:58:52.7138454Z 0.0 evaluates to 0,
2024-03-17T21:58:52.7138773Z body1->getLinearVelocity().y() evaluates to 0.002784063048611347, and
2024-03-17T21:58:52.7139058Z 1e-4 evaluates to 0.0001.
2024-03-17T21:58:52.7139330Z $SRC_DIR/unittests/integration/test_ForceDependentSlip.cpp:280: Failure
2024-03-17T21:58:52.7139749Z The difference between 0.0 and body2->getLinearVelocity().y() is 0.0012537817663281056, which exceeds 1e-4, where
2024-03-17T21:58:52.7140024Z 0.0 evaluates to 0,
2024-03-17T21:58:52.7140352Z body2->getLinearVelocity().y() evaluates to 0.0012537817663281056, and
2024-03-17T21:58:52.7140643Z 1e-4 evaluates to 0.0001.
2024-03-17T21:58:52.7140910Z $SRC_DIR/unittests/integration/test_ForceDependentSlip.cpp:265: Failure
2024-03-17T21:58:52.7141340Z The difference between extForceX * slip and body1->getLinearVelocity().x() is 0.00011317467529363065, which exceeds 1e-4, where
2024-03-17T21:58:52.7141740Z extForceX * slip evaluates to 0.02,
2024-03-17T21:58:52.7142074Z body1->getLinearVelocity().x() evaluates to 0.020113174675293631, and
2024-03-17T21:58:52.7142523Z 1e-4 evaluates to 0.0001.
2024-03-17T21:58:52.7142787Z $SRC_DIR/unittests/integration/test_ForceDependentSlip.cpp:266: Failure
2024-03-17T21:58:52.7143198Z The difference between 0.0 and body1->getLinearVelocity().y() is 0.00050173758912424411, which exceeds 1e-4, where
2024-03-17T21:58:52.7143478Z 0.0 evaluates to 0,
2024-03-17T21:58:52.7143791Z body1->getLinearVelocity().y() evaluates to 0.00050173758912424411, and
2024-03-17T21:58:52.7144088Z 1e-4 evaluates to 0.0001.
2024-03-17T21:58:52.7144350Z $SRC_DIR/unittests/integration/test_ForceDependentSlip.cpp:279: Failure
2024-03-17T21:58:52.7144767Z The difference between mass * accel.x() * slip and spinVel - linVel is 0.00048677195781898774, which exceeds 2e-4, where
2024-03-17T21:58:52.7145078Z mass * accel.x() * slip evaluates to 0.0265112720574745,
2024-03-17T21:58:52.7145401Z spinVel - linVel evaluates to 0.026998044015293488, and
2024-03-17T21:58:52.7145848Z 2e-4 evaluates to 0.00020000000000000001.
traversaro commented 6 months ago

Wow, this was tricky. At least in 0.16.2, cmake with ccd enable pass the following flags:

-DdLIBCCD_BOX_CYL 
-DdLIBCCD_CAP_CYL 
-DdLIBCCD_CONVEX_BOX 
-DdLIBCCD_CONVEX_CAP 
-DdLIBCCD_CONVEX_CONVEX 
-DdLIBCCD_CONVEX_CYL 
-DdLIBCCD_CONVEX_SPHERE
-DdLIBCCD_CYL_CYL

while compiling with autotools:

-DdLIBCCD_CAP_CYL
-DdLIBCCD_CONVEX_BOX
-DdLIBCCD_CONVEX_CAP
-DdLIBCCD_CONVEX_CONVEX
-DdLIBCCD_CONVEX_CYL
-DdLIBCCD_CONVEX_SPHERE
-DdLIBCCD_CYL_CYL     

The CMake build has an additional -DdLIBCCD_BOX_CYL flag that is not there in autotools. If one pass ODE_WITH_LIBCCD_BOX_CYL=OFF to the CMake build, indeed all dart test work fine.

jslee02 commented 6 months ago

That's a good catch! I also confirmed that this fixes the same issue on archilinux: build log, tested docker

traversaro commented 6 months ago

Ack, thanks! I will align manually cmake and autotools in the conda-forge build, and then open an issue upstream.

traversaro commented 6 months ago

By the way, the fact that box-cylinder check is not enable by the enable-ccd autotools flag is documented: https://bitbucket.org/odedevs/ode/src/bcfb66cd5e18e32e27cfaae3651ead930bbcda13/configure.ac#lines-428 .

traversaro commented 6 months ago

Fixed by https://github.com/conda-forge/libode-feedstock/pull/23 in libode==0.16.2=*_14 , upstream issue reported in https://bitbucket.org/odedevs/ode/issues/87/box-cylinder-ccd-check-disabled-by-default .

jslee02 commented 3 months ago

@traversaro Can this be closed?

traversaro commented 3 months ago

Yes!