Oxford-PTAM / PTAM-GPL

PTAM (Parallel Tracking and Mapping) re-released under GPLv3.
GNU General Public License v3.0
790 stars 361 forks source link

How to build against libvcd https://github.com/edrosten/libcvd ? #12

Open jiapei100 opened 8 years ago

jiapei100 commented 8 years ago

It looks like current PTAM-GPL is problematic with /cvd/internal/scalar_convert.h error: with 'constexpr T& CVD::Pixel::Internal::Internal::trivial_array<T, N>::operator const'

In file included from /usr/local/include/cvd/internal/convert_pixel_types.h:7:0, from /usr/local/include/cvd/internal/pixel_operations.h:7, from /usr/local/include/cvd/vision.h:11, from ....../PTAM/src/CalibCornerPatch.cc:6: /usr/local/include/cvd/internal/scalar_convert.h:96:24: error: 'constexpr const T& CVD::Pixel::Internal::Internal::trivial_array<T, N>::operator const' cannot be overloaded constexpr const T& operator[](size_t i) const ^ /usr/local/include/cvd/internal/scalar_convert.h:91:18: error: with 'constexpr T& CVD::Pixel::Internal::Internal::trivial_array<T, N>::operator const' constexpr T& operator[](size_t i) ^ /usr/local/include/cvd/internal/scalar_convert.h: In instantiation of 'constexpr T& CVD::Pixel::Internal::Internal::trivial_array<T, N>::operator const [with T = float; int N = 512; size_t = long unsigned int]': /usr/local/include/cvd/internal/scalar_convert.h:107:11: required from 'constexpr CVD::Pixel::Internal::Internal::trivial_array<S, 512> CVD::Pixel::Internal::Internal::buildLookupTable() [with S = float]' /usr/local/include/cvd/internal/scalar_convert.h:112:88: required from here /usr/local/include/cvd/internal/scalar_convert.h:93:18: error: binding 'const float' to reference of type 'float&' discards qualifiers return elems[i]; ^ /usr/local/include/cvd/internal/scalar_convert.h:94:5: error: body of constexpr function 'constexpr T& CVD::Pixel::Internal::Internal::trivial_array<T, N>::operator const [with T = float; int N = 512; size_t = long unsigned int]' not a return-statement } ^ /usr/local/include/cvd/internal/scalar_convert.h: In instantiation of 'constexpr CVD::Pixel::Internal::Internal::trivial_array<S, 512> CVD::Pixel::Internal::Internal::buildLookupTable() [with S = float]': /usr/local/include/cvd/internal/scalar_convert.h:112:88: required from here /usr/local/include/cvd/internal/scalar_convert.h:110:4: error: body of constexpr function 'constexpr CVD::Pixel::Internal::Internal::trivial_array<S, 512> CVD::Pixel::Internal::Internal::buildLookupTable() [with S = float]' not a return-statement } ^ /usr/local/include/cvd/internal/scalar_convert.h:112:88: error: 'constexpr CVD::Pixel::Internal::Internal::trivial_array<S, 512> CVD::Pixel::Internal::Internal::buildLookupTable() [with S = float]' called in a constant expression constexpr static trivial_array<float, 512> float_for_byte = buildLookupTable(); ^ /usr/local/include/cvd/internal/scalar_convert.h:103:36: note: 'constexpr CVD::Pixel::Internal::Internal::trivial_array<S, 512> CVD::Pixel::Internal::Internal::buildLookupTable() [with S = float]' is not usable as a constexpr function because: constexpr trivial_array<S, 512> buildLookupTable() ^ /usr/local/include/cvd/internal/scalar_convert.h: In instantiation of 'constexpr T& CVD::Pixel::Internal::Internal::trivial_array<T, N>::operator const [with T = double; int N = 512; size_t = long unsigned int]': /usr/local/include/cvd/internal/scalar_convert.h:107:11: required from 'constexpr CVD::Pixel::Internal::Internal::trivial_array<S, 512> CVD::Pixel::Internal::Internal::buildLookupTable() [with S = double]' /usr/local/include/cvd/internal/scalar_convert.h:113:91: required from here /usr/local/include/cvd/internal/scalar_convert.h:93:18: error: binding 'const double' to reference of type 'double&' discards qualifiers return elems[i]; ^ /usr/local/include/cvd/internal/scalar_convert.h:94:5: error: body of constexpr function 'constexpr T& CVD::Pixel::Internal::Internal::trivial_array<T, N>::operator const [with T = double; int N = 512; size_t = long unsigned int]' not a return-statement } ^ /usr/local/include/cvd/internal/scalar_convert.h: In instantiation of 'constexpr CVD::Pixel::Internal::Internal::trivial_array<S, 512> CVD::Pixel::Internal::Internal::buildLookupTable() [with S = double]': /usr/local/include/cvd/internal/scalar_convert.h:113:91: required from here /usr/local/include/cvd/internal/scalar_convert.h:110:4: error: body of constexpr function 'constexpr CVD::Pixel::Internal::Internal::trivial_array<S, 512> CVD::Pixel::Internal::Internal::buildLookupTable() [with S = double]' not a return-statement } ^ /usr/local/include/cvd/internal/scalar_convert.h:113:91: error: 'constexpr CVD::Pixel::Internal::Internal::trivial_array<S, 512> CVD::Pixel::Internal::Internal::buildLookupTable() [with S = double]' called in a constant expression constexpr static trivial_array<double, 512> double_for_byte = buildLookupTable(); ^ /usr/local/include/cvd/internal/scalar_convert.h:103:36: note: 'constexpr CVD::Pixel::Internal::Internal::trivial_array<S, 512> CVD::Pixel::Internal::Internal::buildLookupTable() [with S = double]' is not usable as a constexpr function because: constexpr trivial_array<S, 512> buildLookupTable() ^ In file included from /usr/local/include/cvd/vision.h:12:0, from ....../PTAM/src/CalibCornerPatch.cc:6: /usr/local/include/cvd/utility.h: In instantiation of 'void CVD::copy(const CVD::BasicImage&, CVD::BasicImage&, CVD::ImageRef, CVD::ImageRef, CVD::ImageRef) [with S = float; T = float]': ....../PTAM/src/CalibCornerPatch.cc:49:79: required from here /usr/local/include/cvd/utility.h:40:17: error: 'convert_image' was not declared in this scope convert_image(in, out); ^ PTAM/CMakeFiles/PTAM.dir/build.make:134: recipe for target 'PTAM/CMakeFiles/PTAM.dir/src/CalibCornerPatch.cc.o' failed make[2]: * [PTAM/CMakeFiles/PTAM.dir/src/CalibCornerPatch.cc.o] Error 1 make[2]: * Waiting for unfinished jobs....

Any suggestions?

Cheers Pei