libpointmatcher icon indicating copy to clipboard operation
libpointmatcher copied to clipboard

refactor: Drop support for yaml-cpp old API

Open aguenette opened this issue 3 years ago • 6 comments

fix #42

So, here's my attempt to upgrade libpointmatcher's yaml-cpp dependency to its new API.

As discuss in #42, libpointmatcher will no longer provides yaml-cpp sources in the contrib directory, which mean that Windows users will have to build and install yaml-cpp from sources.

I've followed this tutorial to upgrade the API.

Changes:

  • Use the new yaml-cpp API, i.e. version 0.5+.
  • No longer provide sources in the contrib directory.

Tested on:

  • [x] Ubuntu 18.04
  • [x] Ubuntu 20.04
  • [ ] Windows

However, these changes need to be tested on Windows, so if a Windows user feels generous and is willing to test them, it would be greatly appreciated. 😄

Any suggestions are welcomed. Thanks!

aguenette avatar Feb 20 '21 18:02 aguenette

Can one of the admins verify this patch?

ethzasl-jenkins avatar Feb 20 '21 18:02 ethzasl-jenkins

add to white list

pomerlef avatar Feb 20 '21 20:02 pomerlef

ok to test

pomerlef avatar Feb 20 '21 22:02 pomerlef

Tests are failing on OSX

[ 72%] Linking CXX executable icp_customized
Undefined symbols for architecture x86_64:
  "YAML::Load(std::__1::basic_istream<char, std::__1::char_traits<char> >&)", referenced from:
      PointMatcher<float>::ICPChainBase::loadFromYaml(std::__1::basic_istream<char, std::__1::char_traits<char> >&) in libpointmatcher.a(ICP.cpp.o)
      PointMatcher<double>::ICPChainBase::loadFromYaml(std::__1::basic_istream<char, std::__1::char_traits<char> >&) in libpointmatcher.a(ICP.cpp.o)
      PointMatcher<float>::DataPointsFilters::DataPointsFilters(std::__1::basic_istream<char, std::__1::char_traits<char> >&) in libpointmatcher.a(DataPointsFilter.cpp.o)
      PointMatcher<double>::DataPointsFilters::DataPointsFilters(std::__1::basic_istream<char, std::__1::char_traits<char> >&) in libpointmatcher.a(DataPointsFilter.cpp.o)
  "YAML::detail::memory::create_node()", referenced from:
      YAML::Node::EnsureNodeExists() const in libpointmatcher.a(ICP.cpp.o)
  "YAML::detail::node_data::empty_scalar", referenced from:
      bool YAML::detail::node::equals<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, boost::shared_ptr<YAML::detail::memory_holder>) in libpointmatcher.a(ICP.cpp.o)
  "YAML::detail::node_data::mark_defined()", referenced from:
      YAML::detail::node::mark_defined() in libpointmatcher.a(ICP.cpp.o)
  "YAML::detail::node_data::end()", referenced from:
      PointMatcher<float>::ICPChainBase::loadFromYaml(std::__1::basic_istream<char, std::__1::char_traits<char> >&) in libpointmatcher.a(ICP.cpp.o)
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const& PointMatcher<float>::ICPChainBase::createModulesFromRegistrar<PointMatcherSupport::Registrar<PointMatcher<float>::DataPointsFilter> >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, YAML::Node const&, PointMatcherSupport::Registrar<PointMatcher<float>::DataPointsFilter> const&, std::__1::vector<std::__1::shared_ptr<PointMatcherSupport::Registrar<PointMatcher<float>::DataPointsFilter>::TargetType>, std::__1::allocator<std::__1::shared_ptr<PointMatcherSupport::Registrar<PointMatcher<float>::DataPointsFilter>::TargetType> > >&) in libpointmatcher.a(ICP.cpp.o)
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const& PointMatcher<float>::ICPChainBase::createModulesFromRegistrar<PointMatcherSupport::Registrar<PointMatcher<float>::OutlierFilter> >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, YAML::Node const&, PointMatcherSupport::Registrar<PointMatcher<float>::OutlierFilter> const&, std::__1::vector<std::__1::shared_ptr<PointMatcherSupport::Registrar<PointMatcher<float>::OutlierFilter>::TargetType>, std::__1::allocator<std::__1::shared_ptr<PointMatcherSupport::Registrar<PointMatcher<float>::OutlierFilter>::TargetType> > >&) in libpointmatcher.a(ICP.cpp.o)
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const& PointMatcher<float>::ICPChainBase::createModulesFromRegistrar<PointMatcherSupport::Registrar<PointMatcher<float>::TransformationChecker> >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, YAML::Node const&, PointMatcherSupport::Registrar<PointMatcher<float>::TransformationChecker> const&, std::__1::vector<std::__1::shared_ptr<PointMatcherSupport::Registrar<PointMatcher<float>::TransformationChecker>::TargetType>, std::__1::allocator<std::__1::shared_ptr<PointMatcherSupport::Registrar<PointMatcher<float>::TransformationChecker>::TargetType> > >&) in libpointmatcher.a(ICP.cpp.o)
      PointMatcher<double>::ICPChainBase::loadFromYaml(std::__1::basic_istream<char, std::__1::char_traits<char> >&) in libpointmatcher.a(ICP.cpp.o)
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const& PointMatcher<double>::ICPChainBase::createModulesFromRegistrar<PointMatcherSupport::Registrar<PointMatcher<double>::DataPointsFilter> >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, YAML::Node const&, PointMatcherSupport::Registrar<PointMatcher<double>::DataPointsFilter> const&, std::__1::vector<std::__1::shared_ptr<PointMatcherSupport::Registrar<PointMatcher<double>::DataPointsFilter>::TargetType>, std::__1::allocator<std::__1::shared_ptr<PointMatcherSupport::Registrar<PointMatcher<double>::DataPointsFilter>::TargetType> > >&) in libpointmatcher.a(ICP.cpp.o)
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const& PointMatcher<double>::ICPChainBase::createModulesFromRegistrar<PointMatcherSupport::Registrar<PointMatcher<double>::OutlierFilter> >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, YAML::Node const&, PointMatcherSupport::Registrar<PointMatcher<double>::OutlierFilter> const&, std::__1::vector<std::__1::shared_ptr<PointMatcherSupport::Registrar<PointMatcher<double>::OutlierFilter>::TargetType>, std::__1::allocator<std::__1::shared_ptr<PointMatcherSupport::Registrar<PointMatcher<double>::OutlierFilter>::TargetType> > >&) in libpointmatcher.a(ICP.cpp.o)
      ...
  "YAML::detail::node_data::begin()", referenced from:
      PointMatcher<float>::ICPChainBase::loadFromYaml(std::__1::basic_istream<char, std::__1::char_traits<char> >&) in libpointmatcher.a(ICP.cpp.o)
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const& PointMatcher<float>::ICPChainBase::createModulesFromRegistrar<PointMatcherSupport::Registrar<PointMatcher<float>::DataPointsFilter> >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, YAML::Node const&, PointMatcherSupport::Registrar<PointMatcher<float>::DataPointsFilter> const&, std::__1::vector<std::__1::shared_ptr<PointMatcherSupport::Registrar<PointMatcher<float>::DataPointsFilter>::TargetType>, std::__1::allocator<std::__1::shared_ptr<PointMatcherSupport::Registrar<PointMatcher<float>::DataPointsFilter>::TargetType> > >&) in libpointmatcher.a(ICP.cpp.o)
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const& PointMatcher<float>::ICPChainBase::createModulesFromRegistrar<PointMatcherSupport::Registrar<PointMatcher<float>::OutlierFilter> >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, YAML::Node const&, PointMatcherSupport::Registrar<PointMatcher<float>::OutlierFilter> const&, std::__1::vector<std::__1::shared_ptr<PointMatcherSupport::Registrar<PointMatcher<float>::OutlierFilter>::TargetType>, std::__1::allocator<std::__1::shared_ptr<PointMatcherSupport::Registrar<PointMatcher<float>::OutlierFilter>::TargetType> > >&) in libpointmatcher.a(ICP.cpp.o)
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const& PointMatcher<float>::ICPChainBase::createModulesFromRegistrar<PointMatcherSupport::Registrar<PointMatcher<float>::TransformationChecker> >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, YAML::Node const&, PointMatcherSupport::Registrar<PointMatcher<float>::TransformationChecker> const&, std::__1::vector<std::__1::shared_ptr<PointMatcherSupport::Registrar<PointMatcher<float>::TransformationChecker>::TargetType>, std::__1::allocator<std::__1::shared_ptr<PointMatcherSupport::Registrar<PointMatcher<float>::TransformationChecker>::TargetType> > >&) in libpointmatcher.a(ICP.cpp.o)
      PointMatcher<double>::ICPChainBase::loadFromYaml(std::__1::basic_istream<char, std::__1::char_traits<char> >&) in libpointmatcher.a(ICP.cpp.o)
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const& PointMatcher<double>::ICPChainBase::createModulesFromRegistrar<PointMatcherSupport::Registrar<PointMatcher<double>::DataPointsFilter> >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, YAML::Node const&, PointMatcherSupport::Registrar<PointMatcher<double>::DataPointsFilter> const&, std::__1::vector<std::__1::shared_ptr<PointMatcherSupport::Registrar<PointMatcher<double>::DataPointsFilter>::TargetType>, std::__1::allocator<std::__1::shared_ptr<PointMatcherSupport::Registrar<PointMatcher<double>::DataPointsFilter>::TargetType> > >&) in libpointmatcher.a(ICP.cpp.o)
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const& PointMatcher<double>::ICPChainBase::createModulesFromRegistrar<PointMatcherSupport::Registrar<PointMatcher<double>::OutlierFilter> >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, YAML::Node const&, PointMatcherSupport::Registrar<PointMatcher<double>::OutlierFilter> const&, std::__1::vector<std::__1::shared_ptr<PointMatcherSupport::Registrar<PointMatcher<double>::OutlierFilter>::TargetType>, std::__1::allocator<std::__1::shared_ptr<PointMatcherSupport::Registrar<PointMatcher<double>::OutlierFilter>::TargetType> > >&) in libpointmatcher.a(ICP.cpp.o)
      ...
  "YAML::detail::node_data::set_null()", referenced from:
      YAML::Node::EnsureNodeExists() const in libpointmatcher.a(ICP.cpp.o)
  "YAML::detail::node_data::size() const", referenced from:
      PointMatcherSupport::getNameParamsFromYAML(YAML::Node const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >&) in libpointmatcher.a(Registrar.cpp.o)
ld: symbol(s) not found for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

make[2]: *** [examples/icp_customized] Error 1

make[1]: *** [examples/CMakeFiles/icp_customized.dir/all] Error 2

make: *** [all] Error 2

pomerlef avatar Feb 22 '21 15:02 pomerlef

I have built it on jetson nano with yaml-cpp 0.5, but failure with some tests.

[ RUN      ] Transformation.ComputeRigidTransformDataPoints3D
/mnt/c/nano/git/libpointmatcher/utest/ui/Transformations.cpp:39: Failure
Value of: transformedFeature.isApprox(transformedCloud.features.col(i), kEpsilonNumericalError)
  Actual: false
Expected: true
[  FAILED  ] Transformation.ComputeRigidTransformDataPoints3D (17 ms)
[ RUN      ] Transformation.ComputeSimilarityTransformDataPoints2D
[       OK ] Transformation.ComputeSimilarityTransformDataPoints2D (40 ms)
[ RUN      ] Transformation.ComputeSimilarityTransformDataPoints3D
/mnt/c/nano/git/libpointmatcher/utest/ui/Transformations.cpp:39: Failure
Value of: transformedFeature.isApprox(transformedCloud.features.col(i), kEpsilonNumericalError)
  Actual: false
Expected: true
[  FAILED  ] Transformation.ComputeSimilarityTransformDataPoints3D (27 ms)
[----------] 7 tests from Transformation (135 ms total)


[----------] Global test environment tear-down
[==========] 80 tests from 13 test cases ran. (87892 ms total)
[  PASSED  ] 78 tests.
[  FAILED  ] 2 tests, listed below:
[  FAILED  ] Transformation.ComputeRigidTransformDataPoints3D
[  FAILED  ] Transformation.ComputeSimilarityTransformDataPoints3D

xlla avatar Aug 31 '21 18:08 xlla

Hi @xlla! On Ubuntu 18.04, all the tests pass. So, I'm not sure that the problem comes from the refactor of the yaml-cpp API. Have you tried to run the tests on the master branch (i.e. using the old yaml-cpp API)? If not, can you please try it and tell me if you get the same tests failure? It's just to be sure that it's not related with the changed from this branch. Thanks!

aguenette avatar Sep 02 '21 12:09 aguenette