Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MATLAB bindings: add iDynTree prefix to SwigRef, SwigMem and SwigGet to avoid conflicts with CasADi #868

Merged
merged 6 commits into from
May 15, 2021

Conversation

traversaro
Copy link
Member

Fix #865 . The main difference with respect to the past that after you generate the bindings via CMake passing the IDYNTREE_GENERATE_MATLAB option, you also need to navigate to the bindings/matlab directory and run the appropriate script:

cd bindings/matlab
./fix_generic_names_in_autogenerated_files.sh

However, given that this step is now done automatically by the regenerate-matlab-bindings GitHub Action, this additional step should not be particularly problematic.

@traversaro
Copy link
Member Author

The test is still failing on Octave via CI;

120/120 Test #120: octave_idyntree_tests ..........................................***Failed    0.24 sec
suite: 7 tests
   failure: test_span:  /home/runner/work/idyntree/idyntree/bindings/matlab/tests/EKFTest.m
   failure: test_span_qekf:  /home/runner/work/idyntree/idyntree/bindings/matlab/tests/EKFTest.m
   failure: test_momentum_invariance:  /home/runner/work/idyntree/idyntree/bindings/matlab/tests/InertiaUnitTest.m
   failure: test_joint_constructor:  /home/runner/work/idyntree/idyntree/bindings/matlab/tests/JointUnitTest.m
   failure: test_sparse_matrices:  /home/runner/work/idyntree/idyntree/bindings/matlab/tests/MatrixUnitTest.m
   failure: test_pos_twist_wrench_invariance:  /home/runner/work/idyntree/idyntree/bindings/matlab/tests/TransformUnitTest.m
Errors while running CTest
1/28: testing loadReducedModel...
[loadReducedModel]: loading the following model: ./model.urdf
[High Level Wappers]: test failed. Message: 

  scalar structure containing the fields:

    message = iDynTreeMEX: Cannot allocate pointer
    identifier = SWIG:NewPointerObj
    stack =

      9x1 struct array containing the fields:

        file
        name
        line
        column
        scope
        context

   failure: test__high_level_wrappers:  /home/runner/work/idyntree/idyntree/bindings/matlab/tests/highLevelWrappersSmokeTest.m

--------------------------------------------------

failure: iDynTreeMEX: Cannot allocate pointer
  Vector3:12 (/home/runner/work/idyntree/idyntree/bindings/matlab/autogenerated/+iDynTree/Vector3.m)
  EKFTest>test_span:5 (/home/runner/work/idyntree/idyntree/bindings/matlab/tests/EKFTest.m)
  run:24 (/home/runner/work/idyntree/idyntree/extern/MOxUnit/MOxUnit/@MOxUnitFunctionHandleTestCase/run.m)
  run:53 (/home/runner/work/idyntree/idyntree/extern/MOxUnit/MOxUnit/@MOxUnitTestSuite/run.m)
  run:53 (/home/runner/work/idyntree/idyntree/extern/MOxUnit/MOxUnit/@MOxUnitTestSuite/run.m)
  run_all_tests>@<anonymous>:114 ()
  moxunit_runtests>run_all_tests:162 (/home/runner/work/idyntree/idyntree/extern/MOxUnit/MOxUnit/moxunit_runtests.m)
  moxunit_runtests:99 (/home/runner/work/idyntree/idyntree/extern/MOxUnit/MOxUnit/moxunit_runtests.m)

failure: iDynTreeMEX: Cannot allocate pointer
  AttitudeQuaternionEKF:14 (/home/runner/work/idyntree/idyntree/bindings/matlab/autogenerated/+iDynTree/AttitudeQuaternionEKF.m)
  EKFTest>test_span_qekf:18 (/home/runner/work/idyntree/idyntree/bindings/matlab/tests/EKFTest.m)
  run:24 (/home/runner/work/idyntree/idyntree/extern/MOxUnit/MOxUnit/@MOxUnitFunctionHandleTestCase/run.m)
  run:53 (/home/runner/work/idyntree/idyntree/extern/MOxUnit/MOxUnit/@MOxUnitTestSuite/run.m)
  run:53 (/home/runner/work/idyntree/idyntree/extern/MOxUnit/MOxUnit/@MOxUnitTestSuite/run.m)
  run_all_tests>@<anonymous>:114 ()
  moxunit_runtests>run_all_tests:162 (/home/runner/work/idyntree/idyntree/extern/MOxUnit/MOxUnit/moxunit_runtests.m)
  moxunit_runtests:99 (/home/runner/work/idyntree/idyntree/extern/MOxUnit/MOxUnit/moxunit_runtests.m)

failure: iDynTreeMEX: Cannot allocate pointer
  Twist:10 (/home/runner/work/idyntree/idyntree/bindings/matlab/autogenerated/+iDynTree/Twist.m)
  InertiaUnitTest>test_momentum_invariance:7 (/home/runner/work/idyntree/idyntree/bindings/matlab/tests/InertiaUnitTest.m)
  run:24 (/home/runner/work/idyntree/idyntree/extern/MOxUnit/MOxUnit/@MOxUnitFunctionHandleTestCase/run.m)
  run:53 (/home/runner/work/idyntree/idyntree/extern/MOxUnit/MOxUnit/@MOxUnitTestSuite/run.m)
  run:53 (/home/runner/work/idyntree/idyntree/extern/MOxUnit/MOxUnit/@MOxUnitTestSuite/run.m)
  run_all_tests>@<anonymous>:114 ()
  moxunit_runtests>run_all_tests:162 (/home/runner/work/idyntree/idyntree/extern/MOxUnit/MOxUnit/moxunit_runtests.m)
  moxunit_runtests:99 (/home/runner/work/idyntree/idyntree/extern/MOxUnit/MOxUnit/moxunit_runtests.m)

failure: iDynTreeMEX: Cannot allocate pointer
  Wrench:10 (/home/runner/work/idyntree/idyntree/bindings/matlab/autogenerated/+iDynTree/Wrench.m)
  JointUnitTest>test_joint_constructor:5 (/home/runner/work/idyntree/idyntree/bindings/matlab/tests/JointUnitTest.m)
  run:24 (/home/runner/work/idyntree/idyntree/extern/MOxUnit/MOxUnit/@MOxUnitFunctionHandleTestCase/run.m)
  run:53 (/home/runner/work/idyntree/idyntree/extern/MOxUnit/MOxUnit/@MOxUnitTestSuite/run.m)
  run:53 (/home/runner/work/idyntree/idyntree/extern/MOxUnit/MOxUnit/@MOxUnitTestSuite/run.m)
  run_all_tests>@<anonymous>:114 ()
  moxunit_runtests>run_all_tests:162 (/home/runner/work/idyntree/idyntree/extern/MOxUnit/MOxUnit/moxunit_runtests.m)
  moxunit_runtests:99 (/home/runner/work/idyntree/idyntree/extern/MOxUnit/MOxUnit/moxunit_runtests.m)

failure: iDynTreeMEX: Cannot allocate pointer
  MatrixDynSize:12 (/home/runner/work/idyntree/idyntree/bindings/matlab/autogenerated/+iDynTree/MatrixDynSize.m)
  MatrixUnitTest>test_sparse_matrices:7 (/home/runner/work/idyntree/idyntree/bindings/matlab/tests/MatrixUnitTest.m)
  run:24 (/home/runner/work/idyntree/idyntree/extern/MOxUnit/MOxUnit/@MOxUnitFunctionHandleTestCase/run.m)
  run:53 (/home/runner/work/idyntree/idyntree/extern/MOxUnit/MOxUnit/@MOxUnitTestSuite/run.m)
  run:53 (/home/runner/work/idyntree/idyntree/extern/MOxUnit/MOxUnit/@MOxUnitTestSuite/run.m)
  run_all_tests>@<anonymous>:114 ()
  moxunit_runtests>run_all_tests:162 (/home/runner/work/idyntree/idyntree/extern/MOxUnit/MOxUnit/moxunit_runtests.m)
  moxunit_runtests:99 (/home/runner/work/idyntree/idyntree/extern/MOxUnit/MOxUnit/moxunit_runtests.m)

failure: iDynTreeMEX: Cannot allocate pointer
  Position:10 (/home/runner/work/idyntree/idyntree/bindings/matlab/autogenerated/+iDynTree/Position.m)
  TransformUnitTest>test_pos_twist_wrench_invariance:7 (/home/runner/work/idyntree/idyntree/bindings/matlab/tests/TransformUnitTest.m)
  run:24 (/home/runner/work/idyntree/idyntree/extern/MOxUnit/MOxUnit/@MOxUnitFunctionHandleTestCase/run.m)
  run:53 (/home/runner/work/idyntree/idyntree/extern/MOxUnit/MOxUnit/@MOxUnitTestSuite/run.m)
  run:53 (/home/runner/work/idyntree/idyntree/extern/MOxUnit/MOxUnit/@MOxUnitTestSuite/run.m)
  run_all_tests>@<anonymous>:114 ()
  moxunit_runtests>run_all_tests:162 (/home/runner/work/idyntree/idyntree/extern/MOxUnit/MOxUnit/moxunit_runtests.m)
  moxunit_runtests:99 (/home/runner/work/idyntree/idyntree/extern/MOxUnit/MOxUnit/moxunit_runtests.m)

failure: input does not evaluate to true

Input:0
  assertTrue:45 (/home/runner/work/idyntree/idyntree/extern/MOxUnit/MOxUnit/assertTrue.m)
  highLevelWrappersSmokeTest>test__high_level_wrappers:154 (/home/runner/work/idyntree/idyntree/bindings/matlab/tests/highLevelWrappersSmokeTest.m)
  run:24 (/home/runner/work/idyntree/idyntree/extern/MOxUnit/MOxUnit/@MOxUnitFunctionHandleTestCase/run.m)
  run:53 (/home/runner/work/idyntree/idyntree/extern/MOxUnit/MOxUnit/@MOxUnitTestSuite/run.m)
  run:53 (/home/runner/work/idyntree/idyntree/extern/MOxUnit/MOxUnit/@MOxUnitTestSuite/run.m)
  run_all_tests>@<anonymous>:114 ()
  moxunit_runtests>run_all_tests:162 (/home/runner/work/idyntree/idyntree/extern/MOxUnit/MOxUnit/moxunit_runtests.m)
  moxunit_runtests:99 (/home/runner/work/idyntree/idyntree/extern/MOxUnit/MOxUnit/moxunit_runtests.m)

--------------------------------------------------

FAILED (failure=7)

And @CarlottaSartore also has a similar failure in MATLAB:

Error using iDynTreeMEX
Cannot allocate pointer

 

Error in iDynTree.ExtWrenchesAndJointTorquesEstimator (line 12)
        tmp = iDynTreeMEX(1477, varargin{:});

 

Error in untitled (line 7)
estimator = iDynTree.ExtWrenchesAndJointTorquesEstimator();

@traversaro
Copy link
Member Author

traversaro commented May 15, 2021

The test is still failing on Octave via CI;

It appears I had forgot to push the last commit that fixed some wrong SwigMem|iDynTreeSwigMem substitutions: 391b1e6 . Now everything is working, @CarlottaSartore if you have the occasion to approve I can go on and release 3.2.0 .

Copy link

@CarlottaSartore CarlottaSartore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @traversaro !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants