testConcurrentIncrementalFilter fails on Ubuntu & Mac

Issue #401 closed
Chris Beall created an issue

testConcurrentIncrementalFilter fails on Ubuntu 16.04 and mac OS since PR #332 was merged. The specific change causing this issue is: 6a5beab4d48f3bf479dfab5291433d100033ae1a

Commenting out the assignment operator in GenericValue.h fixes this issue. @jdong37 is this change really still needed for Visual Studio?

[100%] Built target testConcurrentIncrementalFilter
Not equal:
expected:
Values with 2 values:
Value 3: (N5gtsam5Pose3E) R:
[
     0.0688475   0.997523 -0.0144056;
         -0.973888  0.0640709    -0.2178;
         -0.216338  0.0290244   0.975887
  ]
[1.85516, -1.13164, 0.281898]';
Value 4: (N5gtsam5Pose3E) R:
[
      -0.61921   0.773488  -0.135258;
         -0.729781  -0.630464  -0.264451;
         -0.289825 -0.0650426   0.954867
  ]
[1.74411, -2.45635, 0.241236]';
actual:
Values with 2 values:
Value 3: (N5gtsam5Pose3E) R:
[
    -0.228457  0.953607 -0.196062;
        -0.889242 -0.286376 -0.356705;
        -0.396304 0.0928549  0.913412
  ]
[2.00029, -2.32672, 0.18745]';
Value 4: (N5gtsam5Pose3E) R:
[
    -0.835982  0.411466 -0.363083;
        -0.324894 -0.904339 -0.276794;
        -0.442241 -0.113431  0.889694
  ]
[1.03001, -3.41891, -0.177638]';
/home/cbeall/git/gtsam/gtsam_unstable/nonlinear/tests/testConcurrentIncrementalFilter.cpp:554: Failure: "assert_equal(expectedValues, actualValues, 1e-12)" 
Not equal:
expected:
Values with 1 values:
Value 3: (N5gtsam5Pose3E) R:
[
     0.533824  0.845011 0.0314304;
        -0.829427  0.530489 -0.175021;
        -0.164568  0.067361  0.984063
  ]
[1.60673, -0.838999, 0.259172]';
actual:
Values with 1 values:
Value 3: (N5gtsam5Pose3E) R:
[
    -0.228457  0.953607 -0.196062;
        -0.889242 -0.286376 -0.356705;
        -0.396304 0.0928549  0.913412
  ]
[2.00029, -2.32672, 0.18745]';
/home/cbeall/git/gtsam/gtsam_unstable/nonlinear/tests/testConcurrentIncrementalFilter.cpp:1043: Failure: "assert_equal(expectedFilterSeparatorValues2, actualFilterSeparatorValues2, 1e-6)" 
Not equal:
expected:
Values with 4 values:
Value 1: (N5gtsam5Pose3E) R:
[
               1  2.37007e-16 -4.33681e-17;
        -2.02095e-16            1 -1.80411e-16;
         4.51028e-17  1.84748e-16            1
  ]
[-1.11022e-16, 1.38778e-17, -5.55112e-17]';
Value 2: (N5gtsam5Pose3E) R:
[
     0.729461  0.682997 0.0374457;
        -0.676466  0.728435 -0.108514;
        -0.101392 0.0538262  0.993389
  ]
[1.10578, -0.176194, 0.176412]';
Value 3: (N5gtsam5Pose3E) R:
[
     0.0688475   0.997523 -0.0144056;
         -0.973888  0.0640709    -0.2178;
         -0.216338  0.0290244   0.975887
  ]
[1.85516, -1.13164, 0.281898]';
Value 4: (N5gtsam5Pose3E) R:
[
      -0.61921   0.773488  -0.135258;
         -0.729781  -0.630464  -0.264451;
         -0.289825 -0.0650426   0.954867
  ]
[1.74411, -2.45635, 0.241236]';
actual:
Values with 4 values:
Value 1: (N5gtsam5Pose3E) R:
[
      0.994805   0.101321 0.00983263;
        -0.0998135   0.989834  -0.101321;
        -0.0199987  0.0998135   0.994805
  ]
[0.5, -0.05, 0.2]';
Value 2: (N5gtsam5Pose3E) R:
[
      0.575027   0.817493 -0.0323996;
          -0.79046   0.544926  -0.279694;
         -0.210993   0.186442   0.959542
  ]
[1.76755, -0.848289, 0.353801]';
Value 3: (N5gtsam5Pose3E) R:
[
    -0.228457  0.953607 -0.196062;
        -0.889242 -0.286376 -0.356705;
        -0.396304 0.0928549  0.913412
  ]
[2.00029, -2.32672, 0.18745]';
Value 4: (N5gtsam5Pose3E) R:
[
    -0.835982  0.411466 -0.363083;
        -0.324894 -0.904339 -0.276794;
        -0.442241 -0.113431  0.889694
  ]
[1.03001, -3.41891, -0.177638]';
/home/cbeall/git/gtsam/gtsam_unstable/nonlinear/tests/testConcurrentIncrementalFilter.cpp:1414: Failure: "assert_equal(expectedValues, actualValues, 1e-6)" 

Comments (7)

  1. Frank Dellaert

    @jdong37 could you respond to the question above? I'm also seeing this. @cbeall3 how exactly does the assignment operator break this?

  2. Jing Dong

    If the commit is removed, see following error. Looking at how to fix this error without uncomment the operator

    6>C:\Users\Jing Dong\borg\gtsam\gtsam/base/GenericValue.h(161): error C2280: 'gtsam::GenericValue<ValueType> &gtsam::GenericValue<ValueType>::operator =(const gtsam::GenericValue<ValueType> &)': attempting to reference a deleted function
    6>          with
    6>          [
    6>              ValueType=gtsam::Point3
    6>          ] (compiling source file C:\Users\Jing Dong\borg\gtsam\gtsam\slam\dataset.cpp)
    6>  C:\Users\Jing Dong\borg\gtsam\gtsam/base/GenericValue.h(197): note: compiler has generated 'gtsam::GenericValue<ValueType>::operator =' here
    6>          with
    6>          [
    6>              ValueType=gtsam::Point3
    6>          ] (compiling source file C:\Users\Jing Dong\borg\gtsam\gtsam\slam\dataset.cpp)
    6>  C:\Users\Jing Dong\borg\gtsam\gtsam/base/GenericValue.h(156): note: while compiling class template member function 'gtsam::Value &gtsam::GenericValue<ValueType>::operator =(const gtsam::Value &)'
    6>          with
    6>          [
    6>              ValueType=gtsam::Point3
    6>          ] (compiling source file C:\Users\Jing Dong\borg\gtsam\gtsam\slam\dataset.cpp)
    6>  C:\Users\Jing Dong\borg\gtsam\gtsam/nonlinear/Values-inl.h(68): note: see reference to class template instantiation 'gtsam::GenericValue<ValueType>' being compiled
    6>          with
    6>          [
    6>              ValueType=gtsam::Point3
    6>          ] (compiling source file C:\Users\Jing Dong\borg\gtsam\gtsam\slam\dataset.cpp)
    6>  C:\Users\Jing Dong\borg\gtsam\gtsam/nonlinear/Values-inl.h(64): note: while compiling class template member function 'gtsam::_ValuesConstKeyValuePair<ValueType> gtsam::ValuesCastHelper<const ValueType,gtsam::_ValuesConstKeyValuePair<ValueType>,gtsam::Values::ConstKeyValuePair>::cast(KeyValuePairType)'
    6>          with
    6>          [
    6>              ValueType=gtsam::Point3,
    6>              KeyValuePairType=gtsam::Values::ConstKeyValuePair
    6>          ] (compiling source file C:\Users\Jing Dong\borg\gtsam\gtsam\slam\dataset.cpp)
    6>  C:\Users\Jing Dong\borg\gtsam\gtsam/nonlinear/Values-inl.h(144): note: see reference to function template instantiation 'gtsam::_ValuesConstKeyValuePair<ValueType> gtsam::ValuesCastHelper<const ValueType,gtsam::_ValuesConstKeyValuePair<ValueType>,gtsam::Values::ConstKeyValuePair>::cast(KeyValuePairType)' being compiled
    6>          with
    6>          [
    6>              ValueType=gtsam::Point3,
    6>              KeyValuePairType=gtsam::Values::ConstKeyValuePair
    6>          ] (compiling source file C:\Users\Jing Dong\borg\gtsam\gtsam\slam\dataset.cpp)
    6>  C:\Users\Jing Dong\borg\gtsam\gtsam/nonlinear/Values-inl.h(150): note: see reference to class template instantiation 'gtsam::ValuesCastHelper<const ValueType,gtsam::_ValuesConstKeyValuePair<ValueType>,gtsam::Values::ConstKeyValuePair>' being compiled
    6>          with
    6>          [
    6>              ValueType=gtsam::Point3
    6>          ] (compiling source file C:\Users\Jing Dong\borg\gtsam\gtsam\slam\dataset.cpp)
    6>  C:\Users\Jing Dong\borg\gtsam\gtsam/nonlinear/Values-inl.h(135): note: while compiling class template member function 'gtsam::Values::Filtered<gtsam::Point3>::Filtered(const boost::function<bool (const gtsam::Values::ConstKeyValuePair &)> &,gtsam::Values &)' (compiling source file C:\Users\Jing Dong\borg\gtsam\gtsam\slam\dataset.cpp)
    6>  C:\Users\Jing Dong\borg\gtsam\gtsam/nonlinear/Values-inl.h(246): note: see reference to function template instantiation 'gtsam::Values::Filtered<gtsam::Point3>::Filtered(const boost::function<bool (const gtsam::Values::ConstKeyValuePair &)> &,gtsam::Values &)' being compiled (compiling source file C:\Users\Jing Dong\borg\gtsam\gtsam\slam\dataset.cpp)
    6>  C:\Users\Jing Dong\borg\gtsam\gtsam\slam\dataset.cpp(893): note: see reference to class template instantiation 'gtsam::Values::Filtered<gtsam::Point3>' being compiled
    6>  C:\Program Files\boost_1_68_0\boost/math/constants/constants.hpp(278): note: see reference to class template instantiation 'boost::math::constants::detail::constant_pi<T>' being compiled
    6>          with
    6>          [
    6>              T=double
    6>          ] (compiling source file C:\Users\Jing Dong\borg\gtsam\gtsam\slam\dataset.cpp)
    6>  C:\Program Files\boost_1_68_0\boost/math/constants/constants.hpp(278): note: see reference to function template instantiation 'double boost::math::constants::pi<T,boost::math::policies::policy<boost::math::policies::default_policy,boost::math::policies::default_policy,boost::math::policies::default_policy,boost::math::policies::default_policy,boost::math::policies::default_policy,boost::math::policies::default_policy,boost::math::policies::default_policy,boost::math::policies::default_policy,boost::math::policies::default_policy,boost::math::policies::default_policy,boost::math::policies::default_policy,boost::math::policies::default_policy,boost::math::policies::default_policy>>(void) noexcept' being compiled
    6>          with
    6>          [
    6>              T=double
    6>          ] (compiling source file C:\Users\Jing Dong\borg\gtsam\gtsam\slam\dataset.cpp)
    6>  C:\Users\Jing Dong\borg\gtsam\gtsam/geometry/Rot2.h(62): note: see reference to function template instantiation 'double boost::math::constants::pi<double>(void) noexcept' being compiled (compiling source file C:\Users\Jing Dong\borg\gtsam\gtsam\slam\dataset.cpp)
    
  3. Chris Beall reporter

    I actually don't understand why this empty assignment operator works on Windows. Compile - sure, but assign? This made sense in the context of DerivedValue, but not here. This is why it was commented out so as to fall back to the implicitly declared operator.

    Attempt to fix this explicitly is here: https://bitbucket.org/gtborg/gtsam/pull-requests/345/

      GenericValue<T>& operator=(const GenericValue<T>& rhs) {
          Value::operator=(static_cast<Value const&>(rhs));
          value_ = rhs.value_;
          return *this;
        }
    
  4. Log in to comment