Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to run ORB-SLAM2 ROS RGBD #8

Closed
Shengshu-Liu opened this issue Jul 12, 2022 · 7 comments
Closed

Failed to run ORB-SLAM2 ROS RGBD #8

Shengshu-Liu opened this issue Jul 12, 2022 · 7 comments

Comments

@Shengshu-Liu
Copy link
Owner

Shengshu-Liu commented Jul 12, 2022

Screenshot from 2022-07-12 20-00-53
As the figure shown above, after resolving #1, I ran into another problem which might be using the wrong version of OpenCV.

@Shengshu-Liu
Copy link
Owner Author

Shengshu-Liu commented Jul 13, 2022

According to https://github.com/Shengshu-Liu/ORB_SLAM2_sparse_map_saving/blob/master/README.md, the author said the project was tested with OpenCV 2.4.11 and OpenCV 3.2, therefore:

Actions:

Changed the version of OpenCV from 2.4.13 to 3.2.0.
Changed
find_package(OpenCV 2.4.13 EXACT)
to
find_package(OpenCV 3.2.0 EXACT)

Outcomes:

Compilation failed, outputted the same results as #1 (comment)
Screenshot from 2022-07-13 14-23-28

@Shengshu-Liu
Copy link
Owner Author

Actions:

Reverted action #8 (comment), changed
find_package(OpenCV 3.2.0 EXACT)
to
find_package(OpenCV 2.4.13 EXACT)

@Shengshu-Liu
Copy link
Owner Author

Shengshu-Liu commented Jul 13, 2022

Actions:

After reading https://blog.csdn.net/CH_monsy/article/details/124671155, in D435i.yaml, I changed
Viewer.PointSize:2
Screenshot from 2022-07-13 15-12-23
to
Viewer.PointSize: 2
Screenshot from 2022-07-13 15-13-13

Outcomes:

Failed, gave the same output as #8 (comment)

@Shengshu-Liu
Copy link
Owner Author

Actions:

Reverted action #8 (comment)

@Shengshu-Liu
Copy link
Owner Author

Actions:

  1. Commented
    #include <unistd.h>
    in the top include folder
  2. In .bashrc, changed
export PATH=/usr/local/cuda-11.5/bin:/opt/ros/melodic/bin:/home/zimo/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

to

export PATH=/opt/ros/melodic/bin:/home/zimo/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

Outcomes:

Failed, gave the same output as #8 (comment)

@Shengshu-Liu
Copy link
Owner Author

Shengshu-Liu commented Jul 18, 2022

Conclusions:

After loads of debugging, used the same version of OpenCV in all three CMakeLists.txt located in
path_to_ORB-SLAM2/CMakeLists.txt
path_to_ORB-SLAM2/Examples/ROS/ORB_SLAM2/CMakeLists.txt
path_to_ORB-SLAM2/Thirdparty/DBoW2/CMakeLists.txt
and tried three different versions of OpenCV.
I found out that:

  1. All three projects (original, dense map saving, sparse map saving) could be compiled successfully with OpenCV-2.4.13, but gave Failed to run ORB-SLAM2 ROS RGBD #8 (comment) at runtime. According to some tutorials online, the reasons were the incompatibility between Eigen-3.1.0 and OpenCV-2.4.13, and using Eigen-3.2.0 can solve the problem, but I never tried it.
  2. When complied with the newly installed OpenCV-3.4.0 (with full path given explicitly)
    find_package(OpenCV 3.4.0 EXACT PATHS "/home/zimo/Work/opencv-3.4.0")
    all three projects worked fine.
  3. When compiled with OpenCV-3.2.0, all three projects gave the same results as Failed to run ORB-SLAM2 ROS RGBD #8 (comment). Even after I installed another OpenCV-3.2.0 in home directory and gave the full path in find_package,
    find_package(OpenCV 3.2.0 EXACT PATHS "/home/zimo/Work/opencv-3.2.0")
    the system still detected the old one whose libs are in /usr/lib/x86_64-linux-gnu and just ignored the new one, which is kind of bizzare.
  4. OpenCV-2.4.13 was installed in
/usr/local/lib
/usr/local/include/opencv
/usr/local/include/opencv2
/usr/local/share/OpenCV

The old OpenCV-3.2.0 was installed in

/usr/lib/x86_64-linux-gnu
/usr/include/opencv
/usr/include/opencv2
/usr/share/OpenCV

Another OpenCV-3.2.0 was installed in a designated folder.
OpenCV-3.4.0 was installed in a designated folder.
(1) Compilation with OpenCV-2.4.13 succeeded but runtime error occured #8 (comment)
(2) Compilation with the old OpenCV-3.2.0 failed and gave error #1 (comment)
(3) Compilation with the new OpenCV-3.2.0 still failed since the system still detected the old OpenCV-3.2.0
(4) Everything worked fine with OpenCV-3.4.0

@Shengshu-Liu
Copy link
Owner Author

I want to see if OpenCV-2.4.11 works so I tried to install OpenCV-2.4.11 but an error occurred Shengshu-Liu/opencv#2 (comment)
And I gave up on more attempts with different version of OpenCV and sticked with OpenCV-3.4.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant