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

test-jacobians is not passing #51

Closed
nim65s opened this issue Oct 24, 2018 · 25 comments
Closed

test-jacobians is not passing #51

nim65s opened this issue Oct 24, 2018 · 25 comments

Comments

@nim65s
Copy link
Member

nim65s commented Oct 24, 2018

Hi,

When trying to run tests, I have this error:

test 4
      Start  4: test-jacobians

4: Test command: /local/users/gsaurel/humanoid-path-planner/hpp-constraints/build/tests/test-jacobians
4: Test timeout computed to be: 9.99988e+06
4: Running 4 test cases...
4: /local/users/gsaurel/humanoid-path-planner/hpp-constraints/tests/test-jacobians.cc(236): error in "jacobian": Jacobian of Configuration seems wrong (central). DOF 21 at row 0: 2.7798 > 0.00012207
4: /local/users/gsaurel/humanoid-path-planner/hpp-constraints/tests/test-jacobians.cc(236): error in "jacobian": Jacobian of Configuration seems wrong (central). DOF 26 at row 0: 3.35197 > 0.00012207
4: /local/users/gsaurel/humanoid-path-planner/hpp-constraints/tests/test-jacobians.cc(236): error in "jacobian": Jacobian of Configuration seems wrong (central). DOF 24 at row 0: 2.94695 > 0.00012207
4: /local/users/gsaurel/humanoid-path-planner/hpp-constraints/tests/test-jacobians.cc(236): error in "jacobian": Jacobian of Configuration seems wrong (central). DOF 24 at row 0: 3.2716 > 0.00012207
4: /local/users/gsaurel/humanoid-path-planner/hpp-constraints/tests/test-jacobians.cc(236): error in "jacobian": Jacobian of Configuration seems wrong (central). DOF 24 at row 0: 3.47788 > 0.00012207
4: 
4: *** 5 failures detected in test suite "hpp_constraints"
 4/10 Test  #4: test-jacobians ...................***Failed    0.18 sec

@jmirabel
Copy link
Contributor

This test passes on my computer... I have no clue about what's going on.

@nim65s
Copy link
Member Author

nim65s commented Oct 24, 2018

Thanks for your answer, I will try a few things

@nim65s
Copy link
Member Author

nim65s commented Oct 24, 2018

The bug disappeared when I compiled hpp-pinocchio from the latest release tarball instead of using robotpkg's binary version.

It appeared again when I applied a robotpkg's patch that was meant to allow compilation on 14.04.

I will ask Anthony to remove this patch.

@jmirabel
Copy link
Contributor

I understand what happened but I am surprised you did not get an assert. Are you in debug mode ?

To be compliant with old version of Eigen, we should do something like this for all changes in the patch:

if (LgT::NV==Eigen::Dynamic) {
  Jq_.middleRows (row_, lg.nv()).applyOnTheLeft (JqInt)
} else {
  Jq_.middleRows<LgT::NV> (row_).applyOnTheLeft (JqInt)
}

@nim65s
Copy link
Member Author

nim65s commented Oct 24, 2018

No, I am always in Release mode.
But it is already possible in the CI to launch all tests both in Debug & Release. I should probably activate that on all repo.

I will try to update the patch following your example

@jmirabel
Copy link
Contributor

humanoid-path-planner/hpp-pinocchio@749a76a should fix the problem.

@jmirabel
Copy link
Contributor

But I cannot easily test it with Eigen 3.2.0.

@nim65s
Copy link
Member Author

nim65s commented Oct 25, 2018

Thanks a lot, I will try it

@nim65s
Copy link
Member Author

nim65s commented Oct 25, 2018

This doesn't work, as the operands of the ternary operator must have the same type, and here we have a fixed and a dynamic type:

hpp-pinocchio/src/../src/jdifference-visitor.hh:47:42: error: no match for ternary 'operator?:' (operand types are 'bool', 'Eigen::DenseBase<Eigen::Ref<const Eigen::Matrix<double, -1, 1> > >::SegmentReturnType {aka Eigen::VectorBlock<Eigen::Ref<const Eigen::Matrix<double, -1, 1> >, -1>}', and 'Eigen::DenseBase<Eigen::Ref<const Eigen::Matrix<double, -1, 1> > >::FixedSegmentReturnType<7>::Type {aka Eigen::VectorBlock<Eigen::Ref<const Eigen::Matrix<double, -1, 1> >, 7>}')
_BLOCK_ACCESSOR_EIGEN(q0_,segment,LgT::NQ, iq_, lg.nq()),

I tried a few things without success

@nim65s
Copy link
Member Author

nim65s commented Oct 25, 2018

for more readability, the types are:

Eigen::DenseBase<Eigen::Ref<const Eigen::Matrix<double, -1, 1> > >::SegmentReturnType                         
Eigen::DenseBase<Eigen::Ref<const Eigen::Matrix<double, -1, 1> > >::FixedSegmentReturnType<7>::Type                     

@jmirabel
Copy link
Contributor

I forgot about that. I fixed it.

@nim65s
Copy link
Member Author

nim65s commented Oct 25, 2018

Could you push your fix in the topic/eigen32 branch ?

@jmirabel
Copy link
Contributor

done.

@nim65s
Copy link
Member Author

nim65s commented Oct 25, 2018

no more luck:

[…]
hpp-pinocchio/src/../src/dintegrate-visitor.hh:35:11:   required from 'void hpp::pinocchio::liegroupType::dIntegrateVisitor_dq::operator()(const LgT&) [with LgT = se3::SpecialEuclideanOperation<3>]'
[…]
/opt/openrobots/include/pinocchio/spatial/explog.hpp:309:5: error: 'THIS_METHOD_IS_ONLY_FOR_VECTORS_OF_A_SPECIFIC_SIZE' is not a member of 'Eigen::internal::static_assertion<false>'
EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Vector6Like,6);

@jmirabel
Copy link
Contributor

@jcarpent That is a bug in Pinocchio. The problem is that explog does not accept dynamic size vector.

@jmirabel
Copy link
Contributor

jmirabel/pinocchio@2d8882c should fix the issue.

@nim65s
Copy link
Member Author

nim65s commented Oct 25, 2018

So there was 2 typos, fixed in nim65s/pinocchio@400deb5

After that, here is what I get in hpp-constraints in 14.04:

[ 25%] Building CXX object src/CMakeFiles/hpp-constraints.dir/configuration-constraint.cc.o
cd /root/robotpkg/path/hpp-constraints/work.6ab9f1384d29/hpp-constraints-4.2.0/src && /usr/bin/ccache  /usr/bin/g++  -Dhpp_constraints_EXPORTS -pedantic -Wno-long-long -Wall -Wextra -Wcast-align -Wcast-qual -Wformat -Wwrite-strings -Wconversion    -O3 -DNDEBUG -fPIC -I/root/robotpkg/path/hpp-constraints/work.6ab9f1384d29/hpp-constraints-4.2.0 -I/root/robotpkg/path/hpp-constraints/work.6ab9f1384d29/hpp-constraints-4.2.0/include -isystem /usr/include/eigen3 -isystem /opt/openrobots/include -isystem /usr/include/assimp    -DURDFDOM_COLLISION_WITH_GROUP_NAME -DWITH_URDFDOM -DWITH_HPP_FCL -DFCL_USE_ASSIMP_UNIFIED_HEADER_NAMES -DFCL_HAVE_OCTOMAP= -o CMakeFiles/hpp-constraints.dir/configuration-constraint.cc.o -c /root/robotpkg/path/hpp-constraints/work.6ab9f1384d29/hpp-constraints-4.2.0/src/configuration-constraint.cc
/root/robotpkg/path/hpp-constraints/work.6ab9f1384d29/hpp-constraints-4.2.0/src/configuration-constraint.cc: In member function 'virtual void hpp::constraints::ConfigurationConstraint::impl_jacobian(hpp::constraints::matrixOut_t, hpp::constraints::ConfigurationIn_t) const':
/root/robotpkg/path/hpp-constraints/work.6ab9f1384d29/hpp-constraints-4.2.0/src/configuration-constraint.cc:86:93: error: no matching function for call to 'hpp::pinocchio::LiegroupSpace::Jdifference(hpp::constraints::ConfigurationIn_t&, const Eigen::Matrix<double, -1, 1>&, Eigen::Transpose<Eigen::Matrix<double, -1, 1> >, hpp::constraints::matrix_t&)'
goal_.space()->Jdifference<false> (argument, goal_.vector(), diff_.transpose(), unused);
^
/root/robotpkg/path/hpp-constraints/work.6ab9f1384d29/hpp-constraints-4.2.0/src/configuration-constraint.cc:86:93: note: candidate is:
In file included from /opt/openrobots/include/hpp/pinocchio/liegroup-element.hh:20:0,
from /root/robotpkg/path/hpp-constraints/work.6ab9f1384d29/hpp-constraints-4.2.0/include/hpp/constraints/differentiable-function.hh:24,
from /root/robotpkg/path/hpp-constraints/work.6ab9f1384d29/hpp-constraints-4.2.0/include/hpp/constraints/configuration-constraint.hh:25,
from /root/robotpkg/path/hpp-constraints/work.6ab9f1384d29/hpp-constraints-4.2.0/src/configuration-constraint.cc:17:
make[2]: Leaving directory `/root/robotpkg/path/hpp-constraints/work.6ab9f1384d29/hpp-constraints-4.2.0'
/opt/openrobots/include/hpp/pinocchio/liegroup-space.hh:217:12: note: template<bool ApplyOnTheLeft> void hpp::pinocchio::LiegroupSpace::Jdifference(hpp::pinocchio::vectorIn_t, hpp::pinocchio::vectorIn_t, hpp::pinocchio::matrixOut_t, hpp::pinocchio::matrixOut_t) const
void Jdifference (vectorIn_t q0, vectorIn_t q1, matrixOut_t J0, matrixOut_t J1) const;
^
/opt/openrobots/include/hpp/pinocchio/liegroup-space.hh:217:12: note:   template argument deduction/substitution failed:
make[1]: Leaving directory `/root/robotpkg/path/hpp-constraints/work.6ab9f1384d29/hpp-constraints-4.2.0'
/root/robotpkg/path/hpp-constraints/work.6ab9f1384d29/hpp-constraints-4.2.0/src/configuration-constraint.cc:86:93: note:   cannot convert '((Eigen::DenseBase<Eigen::Matrix<double, -1, 1> >*)(&((const hpp::constraints::ConfigurationConstraint*)this)->hpp::constraints::ConfigurationConstraint::diff_))->Eigen::DenseBase<Derived>::transpose<Eigen::Matrix<double, -1, 1> >()' (type 'Eigen::Transpose<Eigen::Matrix<double, -1, 1> >') to type 'hpp::pinocchio::matrixOut_t {aka Eigen::Ref<Eigen::Matrix<double, -1, -1> >}'
goal_.space()->Jdifference<false> (argument, goal_.vector(), diff_.transpose(), unused);
^

@jmirabel
Copy link
Contributor

jmirabel commented Oct 25, 2018

Thanks for the feedback. I pushed the fix on hpp-constraints branch topic/eigen32.

@nim65s
Copy link
Member Author

nim65s commented Oct 25, 2018

I had this error:

/root/robotpkg/path/hpp-constraints/work.6ab9f1384d29/hpp-constraints-4.2.0/src/configuration-constraint.cc: In member function 'virtual void hpp::constraints::ConfigurationConstraint::impl_jacobian(hpp::constraints::matrixOut_t, hpp::constraints::ConfigurationIn_t) const':
/root/robotpkg/path/hpp-constraints/work.6ab9f1384d29/hpp-constraints-4.2.0/src/configuration-constraint.cc:86:78: error: no matching function for call to 'hpp::pinocchio::LiegroupSpace::Jdifference(hpp::constraints::ConfigurationIn_t&, const Eigen::Matrix<double, -1, 1>&, Eigen::Matrix<double, 1, -1>&, hpp::constraints::matrix_t&)'
goal_.space()->Jdifference<false> (argument, goal_.vector(), J_, unused);
^
/root/robotpkg/path/hpp-constraints/work.6ab9f1384d29/hpp-constraints-4.2.0/src/configuration-constraint.cc:86:78: note: candidate is:
In file included from /opt/openrobots/include/hpp/pinocchio/liegroup-element.hh:20:0,
from /root/robotpkg/path/hpp-constraints/work.6ab9f1384d29/hpp-constraints-4.2.0/include/hpp/constraints/differentiable-function.hh:24,
from /root/robotpkg/path/hpp-constraints/work.6ab9f1384d29/hpp-constraints-4.2.0/include/hpp/constraints/configuration-constraint.hh:25,
from /root/robotpkg/path/hpp-constraints/work.6ab9f1384d29/hpp-constraints-4.2.0/src/configuration-constraint.cc:17:
/opt/openrobots/include/hpp/pinocchio/liegroup-space.hh:217:12: note: template<bool ApplyOnTheLeft> void hpp::pinocchio::LiegroupSpace::Jdifference(hpp::pinocchio::vectorIn_t, hpp::pinocchio::vectorIn_t, hpp::pinocchio::matrixOut_t, hpp::pinocchio::matrixOut_t) const
void Jdifference (vectorIn_t q0, vectorIn_t q1, matrixOut_t J0, matrixOut_t J1) const;
^
/opt/openrobots/include/hpp/pinocchio/liegroup-space.hh:217:12: note:   template argument deduction/substitution failed:
/root/robotpkg/path/hpp-constraints/work.6ab9f1384d29/hpp-constraints-4.2.0/src/configuration-constraint.cc:86:78: note:   cannot convert '((const hpp::constraints::ConfigurationConstraint*)this)->hpp::constraints::ConfigurationConstraint::J_' (type 'Eigen::Matrix<double, 1, -1>') to type 'hpp::pinocchio::matrixOut_t {aka Eigen::Ref<Eigen::Matrix<double, -1, -1> >}'
goal_.space()->Jdifference<false> (argument, goal_.vector(), J_, unused);
^

So I changed your mutable Eigen::Matrix<value_type, 1, Eigen::Dynamic> J_; by a mutable Eigen::Matrix<value_type, Eigen::Dynamic, Eigen::Dynamic> J_;

And now I have a bunch of:

hpp-constraints/src/static-stability.cc:173:35: error: 'class Eigen::JacobiSVD<Eigen::Matrix<double, -1, -1>, 2>' has no member named 'rank'

It turns out that the rank() method has not been added in Eigen before 3.2.2

@jmirabel
Copy link
Contributor

It's gonna be tedious to be compatible with Eigen 3.2.0. In 14.04 previously, we installed a more recent version of Eigen.

Let's not put HPP in robotpkg for Ubuntu 14.04 (or at least keep this for later). I think @florent-lamiraux will agree.

@nim65s
Copy link
Member Author

nim65s commented Oct 25, 2018

I agree.

I will just cc @pFernbach here, because I think that he needs to get a few things to work with the current HPP in 14.04 before being able to upgrade to 16.04.
Anyway, in his case, installing a more recent version of Eigen in 14.04 might help.

Still, should we open PRs for:

@pFernbach
Copy link
Member

We changed our mind and I will stop trying to use the current devel/master on 14.04.
We are also going to switch rbprm to 16.

@jmirabel
Copy link
Contributor

For the one in pinocchio, yes, we can open a PR.
I'll deal with the two others.

@nim65s
Copy link
Member Author

nim65s commented Oct 25, 2018

perfect, thanks :)

@jmirabel
Copy link
Contributor

Is this still ongoing ?

@jmirabel jmirabel closed this as completed Feb 8, 2019
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

No branches or pull requests

3 participants