thien94 / orb_slam3_ros_wrapper

A ROS wrapper for ORB-SLAM3. Focus on portability and flexibility.
166 stars 76 forks source link

Building errors #11

Closed danydownload closed 1 year ago

danydownload commented 2 years ago

Hi,

I cannot manage to build this ros package. I got the following errors:

Screenshot from 2022-03-02 12-03-02 Screenshot from 2022-03-02 12-03-19 Screenshot from 2022-03-02 12-03-46

Do you have any suggest?

Libraries version: Ros Noetic OPENCV VERSION: 4.5.5 Eigen 3 VERSION: 3.3.7 and the latest version of Sophus

UPDATE: I manage to build this using the same version of ORB_SLAM3 that you have used (v0.3-beta instead of the latest version) and OpenCV3.4.5

RoZhong commented 2 years ago

try c++11 to c++14

danydownload commented 2 years ago

already tried but no luck!

mikodham commented 2 years ago

already tried but no luck!

same here!

curtesian commented 2 years ago

I made a fork of this repo located here.

After a lot of source code changes, I was able to test it with the EuRoC stereo inertial launch file. I set the OpenCV required version to 4.2 (change it in the CMakeList if you need to). Also change the orbslam path in the CMakeList, per the readme instructions. You'll also need to point to the new vocabulary and yaml files from the original orbslam package.

Biggest source code changes were including the Converter.h header file and implementing the conversion to cv::Mat format, and correctly indexing the Vector3f values in common.cc.

koksyuen commented 2 years ago

@cmanore25 which version of ROS (Melodic/Noetic) are you using?

curtesian commented 2 years ago

@cmanore25 which version of ROS (Melodic/Noetic) are you using?

I am using ROS Noetic with Ubuntu 20.04

viveksood97 commented 2 years ago

I made a fork of this repo located here.

After a lot of source code changes, I was able to test it with the EuRoC stereo inertial launch file. I set the OpenCV required version to 4.2 (change it in the CMakeList if you need to). Also change the orbslam path in the CMakeList, per the readme instructions. You'll also need to point to the new vocabulary and yaml files from the original orbslam package.

Biggest source code changes were including the Converter.h header file and implementing the conversion to cv::Mat format, and correctly indexing the Vector3f values in common.cc.

@cmanore25 Hey I tried to use your fork but still got the same error. Any suggestions? I am using opencv version 4.5.5

koksyuen commented 2 years ago

@cmanore25 Thanks, I tried your fork with ROS Noetic with Ubuntu 20.04, and it works well.

Have you tried to save and load the Atlas map, with your fork?

curtesian commented 2 years ago

Sorry I haven't been monitoring this much, I transitioned to a different project and am not using ORB-SLAM3 anymore.

@Pipiaaaa I did not encounter that error, but if I had to guess, it looks like an Eigen version problem. I would check to see if you have multiple conflicting Eigen versions installed or if the Eigen version you are using is incompatible with Sophus.

@koksyuen I have not tried to save and load the Atlas map with my fork. I did not utilize the Atlas map in my project.

I figured I would put this out there too in case anyone finds it useful. Here is my ORB-SLAM3 fork that I used with this wrapper. It corrected a lot of the V1.0 ORB-SLAM3 errors when running with Ubuntu 20.04.

Orbslam-3 Fork here

Srijal97 commented 1 year ago

@cmanore25 Thank you, I was able to run it on Ubuntu 20 as well. I had sophus header file not found errors during build which I circumvented by changing all instances of #include "sophus/*.hpp" to #include "Thirdparty/Sophus/sophus/*.hpp" in ORB_SLAM3/include before building it. Further, I removed -march=native tag from CMakeLists.txt for ORB_SLAM3, ORB_SLAM3/Thirdparty/DBoW2 and ORB_SLAM3/Thirdparty/g2o.

Also I had to add export LD_LIBRARY_PATH=/root/ORB_SLAM3/lib:/root/ORB_SLAM3/Thirdparty/g2o/lib:/root/ORB_SLAM3/Thirdparty/DBoW2/lib:$LD_LIBRARY_PATH to .bashrc to get rid of symbol not found errors while running the orb_slam3_ros_wrapper node

thien94 commented 1 year ago

Hi @Srijal97 and @viveksood97 and others,

Sorry for the late reply and update. I have updated the repo to work with ORB-SLAM3 V1.0 and Ubuntu 20.04. There are also other changes to remove unnecessary stuffs.

If you are still interested, please use the latest version and let me know if the problem persists.

Thank you and hope this helps.

zoldaten commented 1 year ago

i failed with building on Ubuntu 20,04 odroid xu4:

[  5%] Linking CXX executable /home/odroid/catkin_ws/devel/lib/orb_slam3_ros_wrapper/orb_slam3_ros_wrapper_mono
/usr/bin/ld: /usr/lib/arm-linux-gnueabihf/libEGL.so: .dynsym local symbol at index 3 (>= sh_info of 3)
/usr/bin/ld: /usr/lib/arm-linux-gnueabihf/libEGL.so: .dynsym local symbol at index 4 (>= sh_info of 3)
/usr/bin/ld: /usr/lib/arm-linux-gnueabihf/libEGL.so: .dynsym local symbol at index 5 (>= sh_info of 3)
/usr/bin/ld: /usr/lib/arm-linux-gnueabihf/libEGL.so: .dynsym local symbol at index 6 (>= sh_info of 3)
/usr/bin/ld: /usr/lib/arm-linux-gnueabihf/libEGL.so: .dynsym local symbol at index 7 (>= sh_info of 3)
/usr/bin/ld: /usr/lib/arm-linux-gnueabihf/libEGL.so: .dynsym local symbol at index 8 (>= sh_info of 3)
/usr/bin/ld: /usr/lib/arm-linux-gnueabihf/libEGL.so: .dynsym local symbol at index 9 (>= sh_info of 3)
/usr/bin/ld: CMakeFiles/orb_slam3_ros_wrapper_mono.dir/src/mono_node.cc.o: in function `unsigned long long fmt::v6::internal::width_checker<fmt::v6::internal::error_handler>::operator()<bool, 0>(bool)':
/usr/include/fmt/format.h:1977: undefined reference to `fmt::v6::internal::error_handler::on_error(char const*)'
/usr/bin/ld: CMakeFiles/orb_slam3_ros_wrapper_mono.dir/src/mono_node.cc.o: in function `unsigned long long fmt::v6::internal::precision_checker<fmt::v6::internal::error_handler>::operator()<bool, 0>(bool)':
/usr/include/fmt/format.h:1997: undefined reference to `fmt::v6::internal::error_handler::on_error(char const*)'
/usr/bin/ld: CMakeFiles/orb_slam3_ros_wrapper_mono.dir/src/mono_node.cc.o: in function `void fmt::v6::print<Sophus::SO3Base<Sophus::SO3<float, 0> >::normalize()::{lambda()#1}::operator()() const::str, Eigen::Transpose<Sophus::SO3Base<Sophus::SO3<float, 0> >::normalize()::{lambda()#1}::operator()() const::str::Matrix<float, 4, 1, 0, 4, 1> >, 0>(Sophus::SO3Base<Sophus::SO3<float, 0> >::normalize()::{lambda()#1}::operator()() const::str const&, Eigen::Transpose<Sophus::SO3Base<Sophus::SO3<float, 0> >::normalize()::{lambda()#1}::operator()() const::str::Matrix<float, 4, 1, 0, 4, 1> >&&)':
/usr/include/fmt/core.h:1514: undefined reference to `fmt::v6::vprint(fmt::v6::basic_string_view<char>, fmt::v6::format_args)'
/usr/bin/ld: CMakeFiles/orb_slam3_ros_wrapper_mono.dir/src/mono_node.cc.o: in function `void fmt::v6::print<char [2], , 0>(char const (&) [2])':
/usr/include/fmt/core.h:1514: undefined reference to `fmt::v6::vprint(fmt::v6::basic_string_view<char>, fmt::v6::format_args)'
/usr/bin/ld: CMakeFiles/orb_slam3_ros_wrapper_mono.dir/src/mono_node.cc.o: in function `std::make_unsigned<int>::type fmt::v6::internal::to_unsigned<int>(int)':
/usr/include/fmt/core.h:266: undefined reference to `fmt::v6::internal::assert_fail(char const*, int, char const*)'
/usr/bin/ld: /usr/include/fmt/core.h:266: undefined reference to `fmt::v6::internal::assert_fail(char const*, int, char const*)'
/usr/bin/ld: CMakeFiles/orb_slam3_ros_wrapper_mono.dir/src/mono_node.cc.o: in function `fmt::v6::basic_format_context<std::back_insert_iterator<fmt::v6::internal::buffer<char> >, char>::on_error(char const*)':
/usr/include/fmt/core.h:1169: undefined reference to `fmt::v6::internal::error_handler::on_error(char const*)'
/usr/bin/ld: CMakeFiles/orb_slam3_ros_wrapper_mono.dir/src/mono_node.cc.o: in function `int fmt::v6::internal::get_dynamic_spec<fmt::v6::internal::width_checker, fmt::v6::basic_format_arg<fmt::v6::basic_format_context<std::back_insert_iterator<fmt::v6::internal::buffer<char> >, char> >, fmt::v6::internal::error_handler>(fmt::v6::basic_format_arg<fmt::v6::basic_format_context<std::back_insert_iterator<fmt::v6::internal::buffer<char> >, char> >, fmt::v6::internal::error_handler)':
/usr/include/fmt/format.h:2118: undefined reference to `fmt::v6::internal::error_handler::on_error(char const*)'
/usr/bin/ld: CMakeFiles/orb_slam3_ros_wrapper_mono.dir/src/mono_node.cc.o: in function `unsigned long long fmt::v6::internal::width_checker<fmt::v6::internal::error_handler>::operator()<int, 0>(int)':
/usr/include/fmt/format.h:1971: undefined reference to `fmt::v6::internal::error_handler::on_error(char const*)'
/usr/bin/ld: CMakeFiles/orb_slam3_ros_wrapper_mono.dir/src/mono_node.cc.o: in function `int fmt::v6::internal::get_dynamic_spec<fmt::v6::internal::width_checker, fmt::v6::basic_format_arg<fmt::v6::basic_format_context<std::back_insert_iterator<fmt::v6::internal::buffer<char> >, char> >, fmt::v6::internal::error_handler>(fmt::v6::basic_format_arg<fmt::v6::basic_format_context<std::back_insert_iterator<fmt::v6::internal::buffer<char> >, char> >, fmt::v6::internal::error_handler)':
/usr/include/fmt/format.h:2118: undefined reference to `fmt::v6::internal::error_handler::on_error(char const*)'
/usr/bin/ld: CMakeFiles/orb_slam3_ros_wrapper_mono.dir/src/mono_node.cc.o: in function `unsigned long long fmt::v6::internal::width_checker<fmt::v6::internal::error_handler>::operator()<int, 0>(int)':
/usr/include/fmt/format.h:1971: undefined reference to `fmt::v6::internal::error_handler::on_error(char const*)'
/usr/bin/ld: CMakeFiles/orb_slam3_ros_wrapper_mono.dir/src/mono_node.cc.o: in function `decltype ({parm#1}(0)) fmt::v6::visit_format_arg<fmt::v6::internal::width_checker<fmt::v6::internal::error_handler>, fmt::v6::basic_format_context<std::back_insert_iterator<fmt::v6::internal::buffer<char> >, char> >(fmt::v6::internal::width_checker<fmt::v6::internal::error_handler>&&, fmt::v6::basic_format_arg<fmt::v6::basic_format_context<std::back_insert_iterator<fmt::v6::internal::buffer<char> >, char> > const&)':
/usr/include/fmt/core.h:1012: undefined reference to `fmt::v6::internal::assert_fail(char const*, int, char const*)'
/usr/bin/ld: /usr/include/fmt/core.h:1012: undefined reference to `fmt::v6::internal::assert_fail(char const*, int, char const*)'
/usr/bin/ld: CMakeFiles/orb_slam3_ros_wrapper_mono.dir/src/mono_node.cc.o: in function `std::make_unsigned<int>::type fmt::v6::internal::to_unsigned<int>(int)':
/usr/include/fmt/core.h:266: undefined reference to `fmt::v6::internal::assert_fail(char const*, int, char const*)'
/usr/bin/ld: CMakeFiles/orb_slam3_ros_wrapper_mono.dir/src/mono_node.cc.o: in function `void fmt::v6::internal::format_value<char, Eigen::Transpose<Eigen::Matrix<float, 4, 1, 0, 4, 1> > >(fmt::v6::internal::buffer<char>&, Eigen::Transpose<Eigen::Matrix<float, 4, 1, 0, 4, 1> > const&, fmt::v6::internal::locale_ref)':
/usr/include/fmt/ostream.h:96: undefined reference to `std::locale fmt::v6::internal::locale_ref::get<std::locale>() const'
/usr/bin/ld: CMakeFiles/orb_slam3_ros_wrapper_mono.dir/src/mono_node.cc.o: in function `unsigned long long fmt::v6::internal::precision_checker<fmt::v6::internal::error_handler>::operator()<int, 0>(int)':
/usr/include/fmt/format.h:1991: undefined reference to `fmt::v6::internal::error_handler::on_error(char const*)'
/usr/bin/ld: CMakeFiles/orb_slam3_ros_wrapper_mono.dir/src/mono_node.cc.o: in function `unsigned long long fmt::v6::internal::precision_checker<fmt::v6::internal::error_handler>::operator()<long long, 0>(long long)':
/usr/include/fmt/format.h:1991: undefined reference to `fmt::v6::internal::error_handler::on_error(char const*)'
/usr/bin/ld: CMakeFiles/orb_slam3_ros_wrapper_mono.dir/src/mono_node.cc.o: in function `int fmt::v6::internal::get_dynamic_spec<fmt::v6::internal::precision_checker, fmt::v6::basic_format_arg<fmt::v6::basic_format_context<std::back_insert_iterator<fmt::v6::internal::buffer<char> >, char> >, fmt::v6::internal::error_handler>(fmt::v6::basic_format_arg<fmt::v6::basic_format_context<std::back_insert_iterator<fmt::v6::internal::buffer<char> >, char> >, fmt::v6::internal::error_handler)':
/usr/include/fmt/format.h:2118: undefined reference to `fmt::v6::internal::error_handler::on_error(char const*)'
/usr/bin/ld: CMakeFiles/orb_slam3_ros_wrapper_mono.dir/src/mono_node.cc.o: in function `unsigned long long fmt::v6::internal::precision_checker<fmt::v6::internal::error_handler>::operator()<long long, 0>(long long)':
/usr/include/fmt/format.h:1991: undefined reference to `fmt::v6::internal::error_handler::on_error(char const*)'
/usr/bin/ld: CMakeFiles/orb_slam3_ros_wrapper_mono.dir/src/mono_node.cc.o: in function `unsigned long long fmt::v6::internal::precision_checker<fmt::v6::internal::error_handler>::operator()<int, 0>(int)':
/usr/include/fmt/format.h:1991: undefined reference to `fmt::v6::internal::error_handler::on_error(char const*)'
/usr/bin/ld: CMakeFiles/orb_slam3_ros_wrapper_mono.dir/src/mono_node.cc.o: in function `decltype ({parm#1}(0)) fmt::v6::visit_format_arg<fmt::v6::internal::precision_checker<fmt::v6::internal::error_handler>, fmt::v6::basic_format_context<std::back_insert_iterator<fmt::v6::internal::buffer<char> >, char> >(fmt::v6::internal::precision_checker<fmt::v6::internal::error_handler>&&, fmt::v6::basic_format_arg<fmt::v6::basic_format_context<std::back_insert_iterator<fmt::v6::internal::buffer<char> >, char> > const&)':
/usr/include/fmt/core.h:1012: undefined reference to `fmt::v6::internal::assert_fail(char const*, int, char const*)'
/usr/bin/ld: /usr/include/fmt/core.h:1012: undefined reference to `fmt::v6::internal::assert_fail(char const*, int, char const*)'
/usr/bin/ld: CMakeFiles/orb_slam3_ros_wrapper_mono.dir/src/mono_node.cc.o: in function `int fmt::v6::internal::get_dynamic_spec<fmt::v6::internal::precision_checker, fmt::v6::basic_format_arg<fmt::v6::basic_format_context<std::back_insert_iterator<fmt::v6::internal::buffer<char> >, char> >, fmt::v6::internal::error_handler>(fmt::v6::basic_format_arg<fmt::v6::basic_format_context<std::back_insert_iterator<fmt::v6::internal::buffer<char> >, char> >, fmt::v6::internal::error_handler)':
/usr/include/fmt/format.h:2118: undefined reference to `fmt::v6::internal::error_handler::on_error(char const*)'
/usr/bin/ld: CMakeFiles/orb_slam3_ros_wrapper_mono.dir/src/mono_node.cc.o: in function `void fmt::v6::internal::check_string_type_spec<char, fmt::v6::internal::error_handler>(char, fmt::v6::internal::error_handler&&)':
/usr/include/fmt/format.h:1285: undefined reference to `fmt::v6::internal::error_handler::on_error(char const*)'
/usr/bin/ld: CMakeFiles/orb_slam3_ros_wrapper_mono.dir/src/mono_node.cc.o: in function `fmt::v6::basic_format_parse_context<char, fmt::v6::internal::error_handler>::on_error(char const*)':
/usr/include/fmt/core.h:532: undefined reference to `fmt::v6::internal::error_handler::on_error(char const*)'
/usr/bin/ld: CMakeFiles/orb_slam3_ros_wrapper_mono.dir/src/mono_node.cc.o: in function `std::make_unsigned<int>::type fmt::v6::internal::to_unsigned<int>(int)':
/usr/include/fmt/core.h:266: undefined reference to `fmt::v6::internal::assert_fail(char const*, int, char const*)'
/usr/bin/ld: CMakeFiles/orb_slam3_ros_wrapper_mono.dir/src/mono_node.cc.o: in function `fmt::v6::basic_format_parse_context<char, fmt::v6::internal::error_handler>::on_error(char const*)':
/usr/include/fmt/core.h:532: undefined reference to `fmt::v6::internal::error_handler::on_error(char const*)'
/usr/bin/ld: /usr/include/fmt/core.h:532: undefined reference to `fmt::v6::internal::error_handler::on_error(char const*)'
/usr/bin/ld: /usr/include/fmt/core.h:532: undefined reference to `fmt::v6::internal::error_handler::on_error(char const*)'
/usr/bin/ld: /usr/include/fmt/core.h:532: undefined reference to `fmt::v6::internal::error_handler::on_error(char const*)'
/usr/bin/ld: CMakeFiles/orb_slam3_ros_wrapper_mono.dir/src/mono_node.cc.o: in function `std::make_unsigned<int>::type fmt::v6::internal::to_unsigned<int>(int)':
/usr/include/fmt/core.h:266: undefined reference to `fmt::v6::internal::assert_fail(char const*, int, char const*)'
/usr/bin/ld: /usr/include/fmt/core.h:266: undefined reference to `fmt::v6::internal::assert_fail(char const*, int, char const*)'
/usr/bin/ld: /usr/include/fmt/core.h:266: undefined reference to `fmt::v6::internal::assert_fail(char const*, int, char const*)'
/usr/bin/ld: /usr/include/fmt/core.h:266: undefined reference to `fmt::v6::internal::assert_fail(char const*, int, char const*)'
/usr/bin/ld: CMakeFiles/orb_slam3_ros_wrapper_mono.dir/src/mono_node.cc.o: in function `void fmt::v6::internal::check_string_type_spec<char, fmt::v6::internal::error_handler&>(char, fmt::v6::internal::error_handler&)':
/usr/include/fmt/format.h:1285: undefined reference to `fmt::v6::internal::error_handler::on_error(char const*)'
/usr/bin/ld: CMakeFiles/orb_slam3_ros_wrapper_mono.dir/src/mono_node.cc.o: in function `fmt::v6::basic_format_parse_context<char, fmt::v6::internal::error_handler>::on_error(char const*)':
/usr/include/fmt/core.h:532: undefined reference to `fmt::v6::internal::error_handler::on_error(char const*)'
/usr/bin/ld: /usr/include/fmt/core.h:532: undefined reference to `fmt::v6::internal::error_handler::on_error(char const*)'
/usr/bin/ld: /usr/include/fmt/core.h:532: undefined reference to `fmt::v6::internal::error_handler::on_error(char const*)'
collect2: error: ld returned 1 exit status
make[2]: *** [orb_slam3_ros_wrapper/CMakeFiles/orb_slam3_ros_wrapper_mono.dir/build.make:261: /home/odroid/catkin_ws/devel/lib/orb_slam3_ros_wrapper/orb_slam3_ros_wrapper_mono] Error 1
make[1]: *** [CMakeFiles/Makefile2:1654: orb_slam3_ros_wrapper/CMakeFiles/orb_slam3_ros_wrapper_mono.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
Invoking "make -j1" failed

but i have original ORB_SLAM3 working on it. fmt i installed with: sudo apt install libfmt-dev

zoldaten commented 1 year ago

ok. seems i fix it: nano orb_slam3_ros_wrapper/include/common.h put there: #define FMT_HEADER_ONLY

built successfully.

thien94 commented 1 year ago

Thanks for letting us know the solution!