geturin / OAFD_Monocular

Master Thesis
MIT License
49 stars 8 forks source link

Make Error at midas_cpp/CMakeLists.txt:56 (find_package): By not providing "FindTorch.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Torch", but CMake did not find one. #3

Open jierui778 opened 10 months ago

jierui778 commented 10 months ago

I'm having trouble reproducing your project, can you help me take a look? This error occurs when midas is installed, when I run the command "./do_catkin_make.sh", it gives the following error: CMake Error at midas_cpp/CMakeLists.txt:56 (find_package): By not providing "FindTorch.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Torch", but CMake did not find one.

geturin commented 10 months ago

It seems the issue is that LibTorch in C++ was not found. I apologize for the omission of the LibTorch installation step in my project's README.

However, you can refer to the README at https://github.com/geturin/MiDaS/tree/master/ros for installation guidance. There you will find more detailed instructions on how to install it.

jierui778 commented 10 months ago

I am very happy to receive your reply, but I also encountered a problem when reproducing your project, that is, I encountered an error when I built orb_slam3_ros_wrapper, as follows: 2024-01-29 16-41-19 的屏幕截图 But I have installed eigen,I've checked some information but can't find any help.

geturin commented 10 months ago

This issue might be due to a version inconsistency.

1.Eigen Version Mismatch: ORB_SLAM3 requires a minimum Eigen version of 3.1.0. You can check the Eigen version used in your ORB_SLAM3 installation by searching through the ORB_SLAM3 issues. If you find a similar error, it could be related to your version of Eigen. However, if you were able to compile ORB_SLAM3 independently, then Eigen might not be the problem.

2.Incompatible Versions of ORB_SLAM3 and orb_slam3_ros_wrapper: In my project, I use older versions of these libraries. There have been significant changes in ORB_SLAM3 after version 1.0, making it incompatible with the older versions of orb_slam3_ros_wrapper. In the README, I have included a step to roll back ORB_SLAM3 to v0.4beta. Please ensure that you have followed this step.

jierui778 commented 10 months ago

Ok, thank you for your answer. I will roll back the orbslam3 version later and then rebuild it to verify its feasibility

jierui778 commented 10 months ago

Hey, after I have built all the packages in your project, there is still a slight issue when running the relevant Lanch file at the end, as shown in the figureHey, after I have built all the packages in your project, there is still a slight issue when running the relevant Lanch file at the end, as shown in the figure issue

geturin commented 10 months ago

I think you forgot running source ~/catkin_ws/devel/setup.bash after catkin make

jierui778 commented 10 months ago

Execute "source~/catkin_ws/level/setup. bashsource~/catkin_ws/level/setup. bash" as you said, then run "roslaunch oafd slam. launch" to output the following:; And running "roslaunch ego_tello. launch" prompts that the file cannot be found 2024-01-30 17-03-31 的屏幕截图

jierui778 commented 10 months ago

I ensure that I have configured according to your project steps, but when I run "roslaunch oafd slam. launch" in the end, I will crash and run "roslaunch ego"_ I couldn't find the file when trying to 'tell. launch'

jierui778 commented 10 months ago

I ensure that I have configured according to your project steps, but when I run "roslaunch oafd slam. launch" in the end, I will crash and run "roslaunch ego"_ Error reported during 'tell. launch' 2024-01-30 18-02-10 的屏幕截图 2024-01-30 18-04-46 的屏幕截图

jierui778 commented 10 months ago

But I make sure there is already the file "ego_tello. launch" 2024-01-30 18-06-37 的屏幕截图

geturin commented 10 months ago

I apologize for another unclear section in my README. In ROS, if you are already in the directory containing the target launch file, you can directly use roslaunch xxx.launch. However, the recommended and standard practice is to use roslaunch package_name file.launch. Therefore, when you are in the catkin_ws directory, the correct command to enter is roslaunch oafd ego_tello.launch

jierui778 commented 10 months ago

But when I run the "roslaunch oafd slam. launch" command, it seems like I will crash. Is this normal.The error screenshot has been sent above.

geturin commented 10 months ago

There are various reasons that could lead to this error, including dependency version mismatches and hardware issues. To diagnose the problem, it's recommended to run a demo following the instructions in the ORB SLAM3 README. Try running the provided configuration files from the official source to determine the source of the issue.

jierui778 commented 9 months ago

There is "catkinws" and catkin build two workspaces, do they refer to the same one? 2024-02-05 23-51-12屏幕截图

geturin commented 9 months ago

No, they refer to the same workspace. In ROS, there are two tools used for compiling packages,catkin_make and catkin build. Each requires a separate workspace.

orb_slam3_ros_wrapper is a package that needs to be compiled with catkin build and should be located in the catkin_build workspace.

jierui778 commented 9 months ago

Hey, after completing all the steps, the drone did not respond after running. I have no clue about these errors. final-err

geturin commented 9 months ago

Regarding the error with orb_slam3_ros_wrapper, the reason is that ORBvoc.txt cannot be found. Please check the operations about this part in the README again.

Regarding the error with ego_planner, it's because you have not switched to the ego_planner's workspace. You should first execute source [your_ego_planner_workspace]/devel/setup.bash in the terminal running ego_planner to switch the workspace.

jierui778 commented 9 months ago

If I run"roslaunch oafd ego_tello.launch"in the ego-planner workspace, it will prompt that the file cannot be found. "ego_tello.launch"is located in /catkin_ws/src/OAFD_Monocular/launch. Shouldn't it be run under catkin_ws? Or can you describe to me the storage location of each source code? ego Another old mistake is that when running "roslaunch oafd slam",an error occurs and crashes when launching. orbslam3

geturin commented 9 months ago

In ROS, if you executecatkin_make orcatkin build in a folder, that folder becomes a workspace. If you follow the instructions in the README exactly, your ego-planner folder should also be a catkin_make workspace. To let ROS know about this workspace, you need to source ego-planner/devel/setup.bash in the terminal, or add it to your ~/.bashrc file.

the error with ORB_SLAM3, without detailed information, there are too many possibilities. Can you start ORB_SLAM3 independently?

jierui778 commented 9 months ago

Orbslam3 has no problem running the test data set independently orbslam3_success I have placed the catkin_ws and ego-planner folders in the home directory. Is this no problem? 111 The command I executed under the catkin_ws workspace is as shown in the figure. 222 The error is reported as shown in the figure. 333 The log file is that: roslaunch-ROG-Strix-G533ZM-21080.log rviz-4-stdout.log

jierui778 commented 9 months ago

Or you can record a GIF or video of the running steps for me

geturin commented 9 months ago

about ROS not recognizing multiple workspaces, you can check https://answers.ros.org/question/205976/sourcing-from-multiple-workspaces/ https://www.guyuehome.com/43346

I reproduced your issue and then entered the command; it works

source ~/catkin_ws/devel/setup.bash
cd ~/ego-planner
rm -r devel/
catkin_make
source ~/ego-planner/devel/setup.bash
jierui778 commented 9 months ago

Yes, your method is feasible, but running "roslaunch oafd slam.launch" still exits abnormally. My ROS version is noetic, may I ask if it is running normally on your end? Or you can record a short video for me to refer to

geturin commented 9 months ago

I can run it normally, and I can also record the startup operation for you. https://www.youtube.com/watch?v=tMDTlucJaaE

but i think that the orb_slam3 process is died not related to how you launch this file. This situation is more likely caused by changes in the versions of various dependencies.

First, you can check if there's an issue with the configuration file of my project. You should run the example in the orb_slam3_ros_wrapper README.

# In one terminal
roslaunch orb_slam3_ros_wrapper orb_slam3_mono_inertial_euroc.launch
# In another terminal
rosbag play MH_01_easy.bag

If running the example also results in an error, you should refer to similar issues in the orb_slam3_ros_wrapper repository to check. https://github.com/search?q=repo%3Athien94%2Forb_slam3_ros_wrapper+exit+code+-11&type=issues

there is mentioned here that the issue might be related to the version of OpenCV. https://github.com/thien94/orb_slam3_ros_wrapper/issues/18#issuecomment-1431095157

jierui778 commented 9 months ago

It seems that this error will also appear when running MH_01_easy.bag, and mapviewer will crash. My opencv version is 4.5.5. The specific demonstration is as follows. ORBSLAM3_ERR

geturin commented 9 months ago

My OpenCV version is 4.5.3. Although I can't be sure if the issue is related to the OpenCV version, perhaps you could try reinstalling OpenCV and recompiling ORB_SLAM3.

Then, from the folder picture you provided earlier, it seems you only have two workspaces, catkin_ws and ego-planner. Did you compile your orb_slam3_ros_wrapper usingcatkin build?

jierui778 commented 9 months ago

As you mentioned before, "catkin_ws" and "catkin_build" are the same workspace. Do you mean that normally there should be three workspaces: "catkin_ws", "catkin_build" and "ego-planner"? It seems that I don't have a good solution for this error.

geturin commented 9 months ago

Perhaps my previous answer was not clear enough. Yes, if you follow the README exactly, you will need three workspaces. catkin_make and catkin build are different compile tools, and they cannot share a workspace. Here is the documentation on catkin build, including how to install and create a workspace https://catkin-tools.readthedocs.io/en/latest/installing.html

jierui778 commented 9 months ago

As described in the README file of your project, the directory of the final project file is as follows. Is it correct? gtree ws_tree build_tree Finally, an error occurred when running roslaunch slam.launch. err1

geturin commented 9 months ago

The directory structure seems to be fine, so the issue is likely due to differences in the versions of some dependencies.

I have no clue about this, as I've never encountered a similar error in my environment. There are some issues in the original repository of orb_slam3_ros_wrapper that are similar to your situation. You can refer to their methods to solve the problem. They managed to eliminate the error by changing the versions of OpenCV, Pangolin, or ORB_SLAM3.

Two operations are mentioned frequently in the issues:

  1. Add the parameter <param name="enable_pangolin" type="bool" value="false"/>to the orb_slam3_mono node in slam.launch to disable Pangolin.
  2. Change the version of OpenCV and then recompile ORB_SLAM3.

I might try changing the dependency to ORB_SLAM3 V1.0 or building a Docker image to avoid environmental issues. However, I can only work on this in my spare time.

jierui778 commented 9 months ago

I tried some methods and successfully ran roslaunch slam.launch. However, runroslaunch midas_cpp midas_cpp. launch modelname:="model small tracked. pt" inputtopic:="/camera/imageraw" outputtopic:="/camera/depth" out_orig_size:="true" and roslaunch ego_tello.launch. It seems to have exited abnormally, as shown in the picture 888

geturin commented 9 months ago

I didn't see any errors in the picture, there's a WARNING about not initializing Did you connect to Tello's WiFi before roslaunch ego_tello.launch ?