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

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 this issue Jan 28, 2024 · 32 comments

Comments

@jierui778
Copy link

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
Copy link
Owner

geturin commented Jan 28, 2024

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
Copy link
Author

jierui778 commented Jan 29, 2024

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
Copy link
Owner

geturin commented Jan 29, 2024

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
Copy link
Author

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

@jierui778
Copy link
Author

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
Copy link
Owner

geturin commented Jan 30, 2024

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

@jierui778
Copy link
Author

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
Copy link
Author

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 jierui778 reopened this Jan 30, 2024
@jierui778
Copy link
Author

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
Copy link
Author

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

@geturin
Copy link
Owner

geturin commented Jan 30, 2024

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
Copy link
Author

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
Copy link
Owner

geturin commented Jan 30, 2024

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
Copy link
Author

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

@geturin
Copy link
Owner

geturin commented Feb 5, 2024

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
Copy link
Author

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

@geturin
Copy link
Owner

geturin commented Feb 7, 2024

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
Copy link
Author

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
Copy link
Owner

geturin commented Feb 11, 2024

In ROS, if you execute catkin_make or catkin 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
Copy link
Author

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
Copy link
Author

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

@geturin
Copy link
Owner

geturin commented Feb 12, 2024

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
Copy link
Author

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
Copy link
Owner

geturin commented Feb 13, 2024

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.
thien94/orb_slam3_ros_wrapper#18 (comment)

@jierui778
Copy link
Author

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
Copy link
Owner

geturin commented Feb 14, 2024

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 using catkin build?

@jierui778
Copy link
Author

jierui778 commented Feb 14, 2024

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
Copy link
Owner

geturin commented Feb 14, 2024

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
Copy link
Author

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
Copy link
Owner

geturin commented Feb 14, 2024

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
Copy link
Author

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
Copy link
Owner

geturin commented Feb 15, 2024

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 ?

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

2 participants