ORB_SLAM2
ORB_SLAM2 copied to clipboard
Update to OpenCV4 and fix some build errors
Mostly changes or adds #include
-statements to account for moved files or missing unistd.h
.
Hi. I still have strange problem using OpenCV4. I receive these messages: [ 62%] Built target ORB_SLAM2
Scanning dependencies of target mono_euroc
[ 65%] Building CXX object CMakeFiles/mono_euroc.dir/Examples/Monocular/mono_euroc.cc.o
[ 68%] Linking CXX executable ../Examples/Monocular/mono_euroc
CMakeFiles/mono_euroc.dir/Examples/Monocular/mono_euroc.cc.o: In function cvflann::anyimpl::big_any_policy<cv::String>::static_delete(void**)': mono_euroc.cc:(.text._ZN7cvflann7anyimpl14big_any_policyIN2cv6StringEE13static_deleteEPPv[_ZN7cvflann7anyimpl14big_any_policyIN2cv6StringEE13static_deleteEPPv]+0x15): undefined reference to
cv::String::deallocate()'
CMakeFiles/mono_euroc.dir/Examples/Monocular/mono_euroc.cc.o: In function cvflann::anyimpl::big_any_policy<cv::String>::move(void* const*, void**)': mono_euroc.cc:(.text._ZN7cvflann7anyimpl14big_any_policyIN2cv6StringEE4moveEPKPvPS5_[_ZN7cvflann7anyimpl14big_any_policyIN2cv6StringEE4moveEPKPvPS5_]+0x10): undefined reference to
cv::String::deallocate()'
mono_euroc.cc:(.text.ZN7cvflann7anyimpl14big_any_policyIN2cv6StringEE4moveEPKPvPS5[ZN7cvflann7anyimpl14big_any_policyIN2cv6StringEE4moveEPKPvPS5]+0x24): undefined reference to cv::String::deallocate()' CMakeFiles/mono_euroc.dir/Examples/Monocular/mono_euroc.cc.o: In function
main':
mono_euroc.cc:(.text.startup+0x398): undefined reference to cv::imread(cv::String const&, int)' mono_euroc.cc:(.text.startup+0x4d8): undefined reference to
cv::String::deallocate()'
mono_euroc.cc:(.text.startup+0xa6d): undefined reference to cv::String::allocate(unsigned long)' mono_euroc.cc:(.text.startup+0xd32): undefined reference to
cv::String::deallocate()'
../lib/libORB_SLAM2.so: undefined reference to cv::read(cv::FileNode const&, double&, double)' ../lib/libORB_SLAM2.so: undefined reference to
cv::line(cv::InputOutputArray const&, cv::Pointcv::rectangle(cv::_InputOutputArray const&, cv::Point_<int>, cv::Point_<int>, cv::Scalar_<double> const&, int, int, int)' ../lib/libORB_SLAM2.so: undefined reference to
cv::getTextSize(cv::String const&, int, double, int, int*)'
../lib/libORB_SLAM2.so: undefined reference to cv::error(int, cv::String const&, char const*, char const*, int)' ../lib/libORB_SLAM2.so: undefined reference to
cv::read(cv::FileNode const&, int&, int)'
../lib/libORB_SLAM2.so: undefined reference to cv::operator<<(cv::FileStorage&, cv::String const&)' ../lib/libORB_SLAM2.so: undefined reference to
cv::Mat::diag(cv::Mat const&)'
../lib/libORB_SLAM2.so: undefined reference to cv::write(cv::FileStorage&, cv::String const&, double)' ../lib/libORB_SLAM2.so: undefined reference to
cv::FileStorage::FileStorage(cv::String const&, int, cv::String const&)'
../lib/libORB_SLAM2.so: undefined reference to cv::read(cv::FileNode const&, float&, float)' ../lib/libORB_SLAM2.so: undefined reference to
cv::eigen(cv::InputArray const&, cv::OutputArray const&, cv::OutputArray const&)'
../lib/libORB_SLAM2.so: undefined reference to cv::read(cv::FileNode const&, cv::String&, cv::String const&)' ../lib/libORB_SLAM2.so: undefined reference to
cv::putText(cv::InputOutputArray const&, cv::String const&, cv::Pointcv::namedWindow(cv::String const&, int)' ../lib/libORB_SLAM2.so: undefined reference to
cv::write(cv::FileStorage&, cv::String const&, int)'
../lib/libORB_SLAM2.so: undefined reference to cv::imshow(cv::String const&, cv::_InputArray const&)' ../lib/libORB_SLAM2.so: undefined reference to
cv::FileStorage::operator[](cv::String const&) const'
../lib/libORB_SLAM2.so: undefined reference to cv::circle(cv::_InputOutputArray const&, cv::Point_<int>, int, cv::Scalar_<double> const&, int, int, int)' ../lib/libORB_SLAM2.so: undefined reference to
cv::InputArray::getMat(int) const'
collect2: error: ld returned 1 exit status
CMakeFiles/mono_euroc.dir/build.make:121: recipe for target '../Examples/Monocular/mono_euroc' failed
make[2]: *** [../Examples/Monocular/mono_euroc] Error 1
CMakeFiles/Makefile2:81: recipe for target 'CMakeFiles/mono_euroc.dir/all' failed
make[1]: *** [CMakeFiles/mono_euroc.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
buemi@CTNCWD7002:~/Antonio/ORB_SLAM2-master/build$ make -j1 >errors.txt
CMakeFiles/mono_euroc.dir/Examples/Monocular/mono_euroc.cc.o: In function cvflann::anyimpl::big_any_policy<cv::String>::static_delete(void**)': mono_euroc.cc:(.text._ZN7cvflann7anyimpl14big_any_policyIN2cv6StringEE13static_deleteEPPv[_ZN7cvflann7anyimpl14big_any_policyIN2cv6StringEE13static_deleteEPPv]+0x15): undefined reference to
cv::String::deallocate()'
CMakeFiles/mono_euroc.dir/Examples/Monocular/mono_euroc.cc.o: In function cvflann::anyimpl::big_any_policy<cv::String>::move(void* const*, void**)': mono_euroc.cc:(.text._ZN7cvflann7anyimpl14big_any_policyIN2cv6StringEE4moveEPKPvPS5_[_ZN7cvflann7anyimpl14big_any_policyIN2cv6StringEE4moveEPKPvPS5_]+0x10): undefined reference to
cv::String::deallocate()'
mono_euroc.cc:(.text.ZN7cvflann7anyimpl14big_any_policyIN2cv6StringEE4moveEPKPvPS5[ZN7cvflann7anyimpl14big_any_policyIN2cv6StringEE4moveEPKPvPS5]+0x24): undefined reference to cv::String::deallocate()' CMakeFiles/mono_euroc.dir/Examples/Monocular/mono_euroc.cc.o: In function
main':
mono_euroc.cc:(.text.startup+0x398): undefined reference to cv::imread(cv::String const&, int)' mono_euroc.cc:(.text.startup+0x4d8): undefined reference to
cv::String::deallocate()'
mono_euroc.cc:(.text.startup+0xa6d): undefined reference to cv::String::allocate(unsigned long)' mono_euroc.cc:(.text.startup+0xd32): undefined reference to
cv::String::deallocate()'
../lib/libORB_SLAM2.so: undefined reference to cv::read(cv::FileNode const&, double&, double)' ../lib/libORB_SLAM2.so: undefined reference to
cv::line(cv::InputOutputArray const&, cv::Pointcv::rectangle(cv::_InputOutputArray const&, cv::Point_<int>, cv::Point_<int>, cv::Scalar_<double> const&, int, int, int)' ../lib/libORB_SLAM2.so: undefined reference to
cv::getTextSize(cv::String const&, int, double, int, int*)'
../lib/libORB_SLAM2.so: undefined reference to cv::error(int, cv::String const&, char const*, char const*, int)' ../lib/libORB_SLAM2.so: undefined reference to
cv::read(cv::FileNode const&, int&, int)'
../lib/libORB_SLAM2.so: undefined reference to cv::operator<<(cv::FileStorage&, cv::String const&)' ../lib/libORB_SLAM2.so: undefined reference to
cv::Mat::diag(cv::Mat const&)'
../lib/libORB_SLAM2.so: undefined reference to cv::write(cv::FileStorage&, cv::String const&, double)' ../lib/libORB_SLAM2.so: undefined reference to
cv::FileStorage::FileStorage(cv::String const&, int, cv::String const&)'
../lib/libORB_SLAM2.so: undefined reference to cv::read(cv::FileNode const&, float&, float)' ../lib/libORB_SLAM2.so: undefined reference to
cv::eigen(cv::_InputArray const&, cv::_OutputArray const&, cv::OutputArray const&)'
../lib/libORB_SLAM2.so: undefined reference to cv::read(cv::FileNode const&, cv::String&, cv::String const&)' ../lib/libORB_SLAM2.so: undefined reference to
cv::putText(cv::InputOutputArray const&, cv::String const&, cv::Pointcv::namedWindow(cv::String const&, int)' ../lib/libORB_SLAM2.so: undefined reference to
cv::write(cv::FileStorage&, cv::String const&, int)'
../lib/libORB_SLAM2.so: undefined reference to cv::imshow(cv::String const&, cv::_InputArray const&)' ../lib/libORB_SLAM2.so: undefined reference to
cv::FileStorage::operator[](cv::String const&) const'
../lib/libORB_SLAM2.so: undefined reference to cv::circle(cv::_InputOutputArray const&, cv::Point_<int>, int, cv::Scalar_<double> const&, int, int, int)' ../lib/libORB_SLAM2.so: undefined reference to
cv::InputArray::getMat(int) const'
collect2: error: ld returned 1 exit status
make[2]: *** [../Examples/Monocular/mono_euroc] Error 1
make[1]: *** [CMakeFiles/mono_euroc.dir/all] Error 2
make: *** [all] Error 2
you are missing libraries at the linking step. Figure out, which .so files in /usr/lib/ (or whereever your opencv libs are) have these. Then figure out how to add them to the linking step. (make V=1) should print you the commands, adding them to the last linking step by hand should suffice as a workaround. Then figure out how to "properly" add this to the cmakefiles.txt.
Thank you, I really appreciate your help. Unfortunately, is not clear to me how to add the libraries path to the last linking step, since the CMakeList doesn't seem to directly containing the linker command.
Thank you, this works awesomely!
use this work , I find the tracking time are increasing and the tracking precision is downing ,.
@zhuangxiaopi how did you measure the performance? Was it running on your camera or another rosbag ?
I run the dataset "fr3_walking_rpy",the media tracking time is 0.1s . I didn’t use the evaluation tool because the trajectory drift is visible to the naked eye. Thx .
At 2020-09-25 22:46:55, "Do Anh Tu" [email protected] wrote:
@zhuangxiaopi how did you measure the performance? Was it running on your camera or another rosbag ?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
using build.sh I get "ORB_SLAM2/src/ORBmatcher.cc:30:9: fatal error: 'stdint-gcc.h' file not found" - any idea how to fix that?
Are you using GCC? I'm using clang and had to change this to #include <cstdint>
Thank you for this pull request. Works perfectly fine on Ubuntu 20.04 (uname -a: "Linux akp-VirtualBox 5.8.0-59-generic #66~20.04.1-Ubuntu SMP Thu Jun 17 11:14:10 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux").
Why is this not yet merged in master?
Glad it worked for you. Because this repo seems unmaintained, the maintainer was last seen 2017 :(
Glad it worked for you. Because this repo seems unmaintained, the maintainer was last seen 2017 :(
Yeah I understand that ORB-SLAM3 is superior now and everyone should upgrade. However, many implementations still use ORB-SLAM2, so this is really a pity. Thank YOU for being active and responding quickly, though. Great work :)