geturin / OAFD_Monocular

Master Thesis
MIT License
38 stars 6 forks source link

Encountered an error while executing 'catkin build' in orb_slam3_ros_wrapper #14

Open ZhangZhangZhangzzz opened 4 days ago

ZhangZhangZhangzzz commented 4 days ago

Hello author, I encountered an error while executing the catkin build. The error is as follows:

2024-07-04 13-09-53屏幕截图

This is the overall result. Below, I will take some screenshots of the main error messages, as follows:

  1. /usr/local/include/sophus/types.hpp:237:8: error: redefinition of default argument for ‘class’ 237 | struct IsFixedSizeVector : std::true_type {}; | ^~~~~
2./usr/local/include/sophus/rotation_matrix.hpp:16:18: error: redefinition of ‘template bool Sophus::isOrthogonal(const Eigen::MatrixBase&)’ 16 SOPHUS_FUNC bool isOrthogonal(Eigen::MatrixBase const& R) {

3.usr/local/include/sophus/rotation_matrix.hpp:32:18: error: redefinition of ‘template bool Sophus::isScaledOrthogonalAndPositive(const Eigen::MatrixBase&)’ 32 | SOPHUS_FUNC bool isScaledOrthogonalAndPositive(Eigen::MatrixBase const& sR) { | ^~~~~~~~~

4./usr/local/include/sophus/rotation_matrix.hpp:61:1: error: redefinition of ‘template Sophus::enable_if_t<std::is_floating_point::value, Eigen::Matrix<typename D::Scalar, D::RowsAtCompileTime, D::RowsAtCompileTime, (Eigen::AutoAlign | (((D::RowsAtCompileTime == 1) && (D::RowsAtCompileTime != 1)) ? Eigen::RowMajor : (((D::RowsAtCompileTime == 1) && (D::RowsAtCompileTime != 1)) ? Eigen::ColMajor : Eigen::ColMajor))), D::RowsAtCompileTime, D::RowsAtCompileTime> > Sophus::makeRotationMatrix(const Eigen::MatrixBase&)’ 61 | makeRotationMatrix(Eigen::MatrixBase const& R) { | ^~~~~~

5./usr/local/include/sophus/so2.hpp:17:7: error: redefinition of default argument for ‘int Options’ 17 | class SO2;

6./usr/local/include/sophus/so2.hpp:26:8: error: redefinition of ‘struct Eigen::internal::traits<Sophus::SO2<Scalar, Options> >’ 26 | struct traits<Sophus::SO2<Scalar, Options>> { | ^~~~~~~~~~

The above are some specific error messages that I have selected, but I have not finished selecting them yet. I personally think that there was an error in a certain step, but I don't know which step it was. I have already completed the compilation of ORB-SLAM3 before, and libORB-SLAM3.so also appeared. Just as I was continuing to work, this situation occurred. I would greatly appreciate it if you could see it

geturin commented 4 days ago

From the error message, it's hard to pinpoint the exact cause, but common issues with orb_slam3_ros_wrapper include:

1.Ensure your project is located in a catkin build workspace, as this is determined during workspace initialization and cannot be changed. I noticed your path is commonly used with catkin_ws/, so you might be mixing it with a catkin_make workspace.

2.This project uses ORB_SLAM3 V0.4. You need to follow the README, fetch the latest ORB_SLAM3 code from git, roll back to version 0.4, and then compile. Also, use my forked orb_slam3_ros_wrapper repository instead of the original one.

ZhangZhangZhangzzz commented 3 days ago

I'm very happy to receive your reply. I followed your advice and downloaded ORB_SLAM3 according to your "README" again. But contrary to expectations, I have been unable to complete the compilation of ORB_SLAM3.

2024-07-05 19-26-30屏幕截图

I noticed that your fork mentioned improvements about Ubuntu20.04, because I am also an Ubuntu20.04. Following the steps in the fork, I completed the compilation. But I noticed that there is a missing code "git reset --hard a80b4677009e673b9939a7e91e6ea7bcb5090294" for the ORB_SLAM3 structure in the fork. I learned that this code rolls ORB_SLAM3 back to V0.4. Do I need to do this step again in the fork? If it's not needed, then I've successfully completed the compilation. If it is still needed, then I have a problem that is difficult to solve

2024-07-05 19-32-41屏幕截图

geturin commented 3 days ago

You need to roll back the ORB_SLAM3 version to V0.4. The orb_slam3_ros_wrapper repository I forked is also an old version, corresponding to ORB_SLAM3 V0.4, which is why the rollback wasn't specifically mentioned. If you encounter compilation failures after rolling back to ORB_SLAM3 V0.4, it might be due to your OpenCV version being too new. You can find answers to this issue in other discussions.

Finally, if you find compiling the old version too troublesome, you can get the latest version of orb_slam3_ros_wrapper from the original repository to match the latest version of ORB_SLAM3. This is feasible as someone recently successfully reproduced the project using the latest versions. However, you will need to make some modifications to the latest version of orb_slam3_ros_wrapper. You will need to change the publish topic name and add a scaling factor for the coordinate system and point cloud publication, as shown in the commit below. https://github.com/geturin/orb_slam3_ros_wrapper/commit/4f1aaffa1c4eae9ad9680047bd867650f673989e

ZhangZhangZhangzzz commented 1 day ago

Hello, I recently completed the construction of the ORB-SLAM3 V0.4 version, but I encountered an error when executing orb_slam3_ros_wrapper. I checked my opencv version and eigen version, they are opencv4.2.0 and eigen3.3.7 respectively. All seem to meet the requirements. I suspected that my ORBSLAM3 was not installed properly, so I reinstalled it (making sure to roll back to v0.4) but it still didn't work. The orb_slam3_ros_wrapper package I use is this 2024-07-07 23-09-04屏幕截图 2024-07-07 23-10-43屏幕截图 2024-07-07 23-14-38屏幕截图

How should I troubleshoot the error?

geturin commented 1 day ago

here doesn’t seem to be any critical error information in the picture. However, it looks like the dependencies are not found at all, especially if the error occurs at the very beginning of the compilation. If your ORB_SLAM3 installation directory is not ‘~/ORB_SLAM3’, you need to modify the path in the CMakeLists.txt file. Then, ensure your workspace is a catkin build workspace.

If the error persists after confirming these two points, I have no other ideas. You might want to compile the latest versions of ORB_SLAM3 and orb_slam3_ros_wrapper and then modify some parts, as this could be faster.

ZhangZhangZhangzzz commented 1 day ago

I'm sure it's a catkin workspace, and the error doesn't happen in the first place, but starts to report after compiling for about 10 seconds. It seems faster to compile the latest versions of ORB_SLAM3 and orb_slam3_ros_wrapper. Because I have successfully compiled the latest versions of ORB_SLAM3 and orb_slam3_ros_wrapper before. Since I'm just a beginner and don't know what parts to change, you know it's best for newbies to follow the standard process as it is, so I deleted the latest version that had already been compiled and followed your tutorial again, it didn't seem like an easy path. I'm going to run it with the latest version now, and I'll probably have a lot more to ask you later, including how to modify certain files. Thank you for your answer! you help me a lot !

ZhangZhangZhangzzz commented 5 hours ago

2024-07-08 20-22-10 的屏幕截图

2024-07-08 20-24-52 的屏幕截图

Hi, I would like to ask whether the downloaded things from this interface need to be placed somewhere for use. In addition, when I compiled MiDas with "./do_catkin_make.sh", the following error was displayed. How should I solve it? 2024-07-08 20-24-23 的屏幕截图

geturin commented 5 hours ago

It looks like the issue is that the CUDA dependencies are not found in the environment. You need to install CUDA first, as it is essential for running almost any AI-related project.