Open IbrahimKaramavus1773 opened 3 years ago
@IbrahimKaramavus1773 pull the latest master from KimeraRPGO, this commit should hopefully solve the problem.
I am working with Ubuntu 20.04 and ROS Foxy. Successfuly built GTSAM on develop branch with BUILD_WITH_MARCH_NATIVE = OFF and installed it.
Used out of the box cmake options for Kimera-RPGO, see image:
pooja@pooja-ThinkPad-P1-Gen-5:~/Kimera-RPGO/build$ make install
[ 6%] Building CXX object CMakeFiles/KimeraRPGO.dir/src/GenericSolver.cpp.o
/home/pooja/Kimera-RPGO/src/GenericSolver.cpp: In member function ‘void KimeraRPGO::GenericSolver::removePriorsWithPrefix(const char&)’:
/home/pooja/Kimera-RPGO/src/GenericSolver.cpp:138:77: error: no matching function for call to ‘dynamic_pointer_cast<gtsam::PriorFactor<gtsam::Pose3> >(std::shared_ptr<gtsam::NonlinearFactor>&)’
138 | if (boost::dynamic_pointer_cast<gtsam::PriorFactor<gtsam::Pose3>>(factor)) {
| ^
In file included from /usr/include/boost/shared_ptr.hpp:17,
from /usr/include/boost/format/alt_sstream.hpp:22,
from /usr/include/boost/format/internals.hpp:24,
from /usr/include/boost/format.hpp:38,
from /home/pooja/Kimera-RPGO/include/KimeraRPGO/Logger.h:8,
from /home/pooja/Kimera-RPGO/include/KimeraRPGO/GenericSolver.h:16,
from /home/pooja/Kimera-RPGO/src/GenericSolver.cpp:9:
/usr/include/boost/smart_ptr/shared_ptr.hpp:963:42: note: candidate: ‘template<class T, class U> boost::shared_ptr<X> boost::dynamic_pointer_cast(const boost::shared_ptr<U>&)’
963 | template<class T, class U> shared_ptr<T> dynamic_pointer_cast( shared_ptr<U> const & r ) BOOST_SP_NOEXCEPT
| ^~~~~~~~~~~~~~~~~~~~
/usr/include/boost/smart_ptr/shared_ptr.hpp:963:42: note: template argument deduction/substitution failed:
/home/pooja/Kimera-RPGO/src/GenericSolver.cpp:138:77: note: ‘std::shared_ptr<gtsam::NonlinearFactor>’ is not derived from ‘const boost::shared_ptr<U>’
138 | if (boost::dynamic_pointer_cast<gtsam::PriorFactor<gtsam::Pose3>>(factor)) {
| ^
In file included from /usr/include/boost/shared_ptr.hpp:17,
from /usr/include/boost/format/alt_sstream.hpp:22,
from /usr/include/boost/format/internals.hpp:24,
from /usr/include/boost/format.hpp:38,
from /home/pooja/Kimera-RPGO/include/KimeraRPGO/Logger.h:8,
from /home/pooja/Kimera-RPGO/include/KimeraRPGO/GenericSolver.h:16,
from /home/pooja/Kimera-RPGO/src/GenericSolver.cpp:9:
/usr/include/boost/smart_ptr/shared_ptr.hpp:1005:42: note: candidate: ‘template<class T, class U> boost::shared_ptr<X> boost::dynamic_pointer_cast(boost::shared_ptr<U>&&)’
1005 | template<class T, class U> shared_ptr<T> dynamic_pointer_cast( shared_ptr<U> && r ) BOOST_SP_NOEXCEPT
| ^~~~~~~~~~~~~~~~~~~~
/usr/include/boost/smart_ptr/shared_ptr.hpp:1005:42: note: template argument deduction/substitution failed:
/home/pooja/Kimera-RPGO/src/GenericSolver.cpp:138:77: note: ‘std::shared_ptr<gtsam::NonlinearFactor>’ is not derived from ‘boost::shared_ptr<U>’
138 | if (boost::dynamic_pointer_cast<gtsam::PriorFactor<gtsam::Pose3>>(factor)) {
| ^
/home/pooja/Kimera-RPGO/src/GenericSolver.cpp:141:21: error: no matching function for call to ‘dynamic_pointer_cast<gtsam::PriorFactor<gtsam::Pose3> >(std::shared_ptr<gtsam::NonlinearFactor>&)’
141 | factor);
| ^
In file included from /usr/include/boost/shared_ptr.hpp:17,
from /usr/include/boost/format/alt_sstream.hpp:22,
from /usr/include/boost/format/internals.hpp:24,
from /usr/include/boost/format.hpp:38,
from /home/pooja/Kimera-RPGO/include/KimeraRPGO/Logger.h:8,
from /home/pooja/Kimera-RPGO/include/KimeraRPGO/GenericSolver.h:16,
from /home/pooja/Kimera-RPGO/src/GenericSolver.cpp:9:
/usr/include/boost/smart_ptr/shared_ptr.hpp:963:42: note: candidate: ‘template<class T, class U> boost::shared_ptr<X> boost::dynamic_pointer_cast(const boost::shared_ptr<U>&)’
963 | template<class T, class U> shared_ptr<T> dynamic_pointer_cast( shared_ptr<U> const & r ) BOOST_SP_NOEXCEPT
| ^~~~~~~~~~~~~~~~~~~~
/usr/include/boost/smart_ptr/shared_ptr.hpp:963:42: note: template argument deduction/substitution failed:
/home/pooja/Kimera-RPGO/src/GenericSolver.cpp:141:21: note: ‘std::shared_ptr<gtsam::NonlinearFactor>’ is not derived from ‘const boost::shared_ptr<U>’
141 | factor);
| ^
In file included from /usr/include/boost/shared_ptr.hpp:17,
from /usr/include/boost/format/alt_sstream.hpp:22,
from /usr/include/boost/format/internals.hpp:24,
from /usr/include/boost/format.hpp:38,
from /home/pooja/Kimera-RPGO/include/KimeraRPGO/Logger.h:8,
from /home/pooja/Kimera-RPGO/include/KimeraRPGO/GenericSolver.h:16,
from /home/pooja/Kimera-RPGO/src/GenericSolver.cpp:9:
/usr/include/boost/smart_ptr/shared_ptr.hpp:1005:42: note: candidate: ‘template<class T, class U> boost::shared_ptr<X> boost::dynamic_pointer_cast(boost::shared_ptr<U>&&)’
1005 | template<class T, class U> shared_ptr<T> dynamic_pointer_cast( shared_ptr<U> && r ) BOOST_SP_NOEXCEPT
| ^~~~~~~~~~~~~~~~~~~~
/usr/include/boost/smart_ptr/shared_ptr.hpp:1005:42: note: template argument deduction/substitution failed:
/home/pooja/Kimera-RPGO/src/GenericSolver.cpp:141:21: note: ‘std::shared_ptr<gtsam::NonlinearFactor>’ is not derived from ‘boost::shared_ptr<U>’
141 | factor);
| ^
/home/pooja/Kimera-RPGO/src/GenericSolver.cpp:145:26: error: no matching function for call to ‘dynamic_pointer_cast<gtsam::PriorFactor<gtsam::Pose2> >(std::shared_ptr<gtsam::NonlinearFactor>&)’
145 | factor)) {
| ^
In file included from /usr/include/boost/shared_ptr.hpp:17,
from /usr/include/boost/format/alt_sstream.hpp:22,
from /usr/include/boost/format/internals.hpp:24,
from /usr/include/boost/format.hpp:38,
from /home/pooja/Kimera-RPGO/include/KimeraRPGO/Logger.h:8,
from /home/pooja/Kimera-RPGO/include/KimeraRPGO/GenericSolver.h:16,
from /home/pooja/Kimera-RPGO/src/GenericSolver.cpp:9:
/usr/include/boost/smart_ptr/shared_ptr.hpp:963:42: note: candidate: ‘template<class T, class U> boost::shared_ptr<X> boost::dynamic_pointer_cast(const boost::shared_ptr<U>&)’
963 | template<class T, class U> shared_ptr<T> dynamic_pointer_cast( shared_ptr<U> const & r ) BOOST_SP_NOEXCEPT
| ^~~~~~~~~~~~~~~~~~~~
/usr/include/boost/smart_ptr/shared_ptr.hpp:963:42: note: template argument deduction/substitution failed:
/home/pooja/Kimera-RPGO/src/GenericSolver.cpp:145:26: note: ‘std::shared_ptr<gtsam::NonlinearFactor>’ is not derived from ‘const boost::shared_ptr<U>’
145 | factor)) {
| ^
In file included from /usr/include/boost/shared_ptr.hpp:17,
from /usr/include/boost/format/alt_sstream.hpp:22,
from /usr/include/boost/format/internals.hpp:24,
from /usr/include/boost/format.hpp:38,
from /home/pooja/Kimera-RPGO/include/KimeraRPGO/Logger.h:8,
from /home/pooja/Kimera-RPGO/include/KimeraRPGO/GenericSolver.h:16,
from /home/pooja/Kimera-RPGO/src/GenericSolver.cpp:9:
/usr/include/boost/smart_ptr/shared_ptr.hpp:1005:42: note: candidate: ‘template<class T, class U> boost::shared_ptr<X> boost::dynamic_pointer_cast(boost::shared_ptr<U>&&)’
1005 | template<class T, class U> shared_ptr<T> dynamic_pointer_cast( shared_ptr<U> && r ) BOOST_SP_NOEXCEPT
| ^~~~~~~~~~~~~~~~~~~~
/usr/include/boost/smart_ptr/shared_ptr.hpp:1005:42: note: template argument deduction/substitution failed:
/home/pooja/Kimera-RPGO/src/GenericSolver.cpp:145:26: note: ‘std::shared_ptr<gtsam::NonlinearFactor>’ is not derived from ‘boost::shared_ptr<U>’
145 | factor)) {
| ^
/home/pooja/Kimera-RPGO/src/GenericSolver.cpp:148:21: error: no matching function for call to ‘dynamic_pointer_cast<gtsam::PriorFactor<gtsam::Pose2> >(std::shared_ptr<gtsam::NonlinearFactor>&)’
148 | factor);
| ^
In file included from /usr/include/boost/shared_ptr.hpp:17,
from /usr/include/boost/format/alt_sstream.hpp:22,
from /usr/include/boost/format/internals.hpp:24,
from /usr/include/boost/format.hpp:38,
from /home/pooja/Kimera-RPGO/include/KimeraRPGO/Logger.h:8,
from /home/pooja/Kimera-RPGO/include/KimeraRPGO/GenericSolver.h:16,
from /home/pooja/Kimera-RPGO/src/GenericSolver.cpp:9:
/usr/include/boost/smart_ptr/shared_ptr.hpp:963:42: note: candidate: ‘template<class T, class U> boost::shared_ptr<X> boost::dynamic_pointer_cast(const boost::shared_ptr<U>&)’
963 | template<class T, class U> shared_ptr<T> dynamic_pointer_cast( shared_ptr<U> const & r ) BOOST_SP_NOEXCEPT
| ^~~~~~~~~~~~~~~~~~~~
/usr/include/boost/smart_ptr/shared_ptr.hpp:963:42: note: template argument deduction/substitution failed:
/home/pooja/Kimera-RPGO/src/GenericSolver.cpp:148:21: note: ‘std::shared_ptr<gtsam::NonlinearFactor>’ is not derived from ‘const boost::shared_ptr<U>’
148 | factor);
| ^
In file included from /usr/include/boost/shared_ptr.hpp:17,
from /usr/include/boost/format/alt_sstream.hpp:22,
from /usr/include/boost/format/internals.hpp:24,
from /usr/include/boost/format.hpp:38,
from /home/pooja/Kimera-RPGO/include/KimeraRPGO/Logger.h:8,
from /home/pooja/Kimera-RPGO/include/KimeraRPGO/GenericSolver.h:16,
from /home/pooja/Kimera-RPGO/src/GenericSolver.cpp:9:
/usr/include/boost/smart_ptr/shared_ptr.hpp:1005:42: note: candidate: ‘template<class T, class U> boost::shared_ptr<X> boost::dynamic_pointer_cast(boost::shared_ptr<U>&&)’
1005 | template<class T, class U> shared_ptr<T> dynamic_pointer_cast( shared_ptr<U> && r ) BOOST_SP_NOEXCEPT
| ^~~~~~~~~~~~~~~~~~~~
/usr/include/boost/smart_ptr/shared_ptr.hpp:1005:42: note: template argument deduction/substitution failed:
/home/pooja/Kimera-RPGO/src/GenericSolver.cpp:148:21: note: ‘std::shared_ptr<gtsam::NonlinearFactor>’ is not derived from ‘boost::shared_ptr<U>’
148 | factor);
| ^
make[2]: *** [CMakeFiles/KimeraRPGO.dir/build.make:76: CMakeFiles/KimeraRPGO.dir/src/GenericSolver.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:212: CMakeFiles/KimeraRPGO.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
The change in https://github.com/MIT-SPARK/Kimera-RPGO/commit/3003ed918f11c3f45ccc98e8726839c5f6fc8b9f mentioned by @yunzc is already present on the develop branch, but build still fails.
Any help would be appreciated thanks!
Description: Dear developers, I am trying to build Kimera_VIO_ROS but i faced an error in building Kimera_RPGO. I am using Ubuntu 18.04 and ROS Melodic.The error is shown belown.
Any ideas how to fix it ?
Command:
Console output:
Additional files: Please attach all the files needed to reproduce the error.
Please give also the following information: