JakobEngel / dso_ros

ROS wrapper for dso
GNU General Public License v3.0
320 stars 210 forks source link

variable DSO_LIBRARY not found #38

Closed squashking closed 6 years ago

squashking commented 6 years ago

Hi guys, I downloaded the catkin branch. I am trying to compile it using catkin_make (ROS Lunar), and I got the following error:

CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: DSO_LIBRARY linked by target "dso_live" in directory /**/catkin_ws/src/dso_ros-catkin

Could you give me any suggestions? Thank you very much!

NikolausDemmel commented 6 years ago

It means the dso library wasn't found in $DSO_PATH/build/lib. https://github.com/JakobEngel/dso_ros/blob/47f2fb718e95125c7afd20989dd57d35c3234d5f/CMakeLists.txt#L25

Make sure you set DSO_PATH correct and that the dso build can be found in the according subdirectory.

Otherwise, I generally recommend to use the following branches from my fork:

If you drop both in a catkin workspace, you should be able to build them with catkin_tools (i.e. catkin build command) without specifying any paths manually (make sure to unset DSO_PATH if you have already set it permanently).

squashking commented 6 years ago

@NikolausDemmel Thank you very much Nikolaus. Sorry to ask a newbie question, but how to set DSO_PATH ?

NikolausDemmel commented 6 years ago

Before calling cmake, in the terminal type something like

export DSO_PATH=/absolute/path/to/your/dso/directory

Remember it expects build/lib subdirectory inside DSO_PATH and also src and thirdparty/Sophus.

squashking commented 6 years ago

@NikolausDemmel Thanks for the reply. I am using catkin_make not cmake, and I see there is only src subdirectory. Shall I add the above subdirectories as you mentioned?

squashking commented 6 years ago

@NikolausDemmel I have just given it a try. But I got another error: DSO_LIBRARY not found. Then I followed your suggestions (not sure if I did correctly): I created a build/lib folder and export DSO_LIBRARY=/absolute/path/to/the/lib/folder, but I still got the same error. Could you elaborate a bit about your previous answer?

NikolausDemmel commented 6 years ago

DSO_PATH is supposed to be the directory of dso and the build directory inside needs to be the directory where u ran cmake and make to compile dso.

squashking commented 6 years ago

@NikolausDemmel Sorry I'm not using the cmake branch, I'm using the catkin branch: https://github.com/NikolausDemmel/dso_ros/tree/catkin As I'm a newbie, I only know how to compile it using catkin_make. After downloading the code, the is no build/lib subdirectories, so I created them. And then export DSO_LIBRARY=/absolute/path/to/the/lib/folder. And then I just used the catkin_make command. Did I do something wrong? Thank you!

NikolausDemmel commented 6 years ago

DSO_PATH (not DSO_LIBRARY) needs to point to the dso (not dso_ros) directory which you got from https://github.com/JakobEngel/dso. This you need to build with cmake inside a subfolder called build as per it's readme. You cannot use catkin_make to build dso. Then you can build dso_ros with catkin_make.

I'm sorry, but I seriously suggest you first do some basic cmake and catkin_make tutorials to learn the basic workflow of these tools. This will make things much easier.

squashking commented 6 years ago

@NikolausDemmel Thanks, I was confused at the beginning. Now I understand the two branches are correlated. I have installed DSO using cmake. But when trying the dataset (sequence02) from your website I got the error message and no visualization dialogue displaying:

reading Photometric Calibration from file ../../sequence_02/pcalib.txt Reading Vignette Image from ../../vignette.png cv::imread could not read image ../../vignette.png! this may segfault. cv::imread could not read image ../../vignette.png! this may segfault. PhotometricUndistorter: Invalid vignette image got 3500 images and 3500 timestamps and 3500 exposures.! ImageFolderReader: got 3500 files in ../../sequence_02/images.zip! using pyramid levels 0 to 3. coarsest resolution: 80 x 60!

Any suggestions? Thank you!

NikolausDemmel commented 6 years ago

You are running DSO now without dos_ros? For one thing, looks like the path to the vignette is wrong.

squashking commented 6 years ago

@NikolausDemmel Yes, I'm running DSO alone. The path does not seem to be wrong and I can see the vignette image file. Also, if you look at the first part of the log, the images and calibration files are found:

loading data from ../../sequence_02/images.zip! loading calibration from ../../sequence_02/camera.txt! loading gammaCalib from ../../sequence_02/pcalib.txt! loading vignette from ../../vignette.png!

=============== PRESET Settings: =============== DEFAULT settings:

And this is how I ran it: ./dso_dataset files=../../sequence_02/images.zip calib=../../sequence_02/camera.txt gamma=../../sequence_02/pcalib.txt vignette=../../vignette.png preset=0 mode=0 So if the path to vignette.png is wrong, the path to other files should also be wrong. I don't know what went wrong here.

NikolausDemmel commented 6 years ago

I don't know. You'll have to debug into the code and see which path it is taking...

squashking commented 6 years ago

Thank you Nikolaus, It turns out I forgot to add /sequence_02 to the vignette path...sorry about the mistake.