robofit / but_velodyne

ROS packages for Velodyne 3D LIDARs provided by Robo@FIT group.
GNU Lesser General Public License v3.0
142 stars 98 forks source link

cmake error while building ROS workspace #12

Closed chukcha2 closed 4 years ago

chukcha2 commented 7 years ago

Hello, I cloned but_velodyne, added it to a ROS workspace and tried to build it and got the following error:

CMake Error at but_velodyne/but_velodyne_odom/CMakeLists.txt:33 (find_package):
  By not providing "Findbut_velodyne.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "but_velodyne", but CMake did not find one.

I am not very familiar with cmake but is cmake saying that but_velodyne_odom requires but_velodyne. If so, isn't it a circular dependency (I am building but_velodyne).

martin-velas commented 7 years ago

Hello! Have you already built but_velodyne_lib? This library is required in order to build ROS package but_velodyne. I have just added this into into the readme (sry for missing info).

rebellojason7 commented 7 years ago

Hi, I am experiencing the same error. I did install the but_velodyne_lib. with a sudo make install as the final step. However there isnt a package named but_velodyne. Should something be changed ? After installing the library I see a libbut_velodyne.so in my /usr/local/lib.

This is the entire error

CMake Error at /home/jrebello/catkin_ws/src/but_velodyne/but_velodyne_odom/CMakeLists.txt:33 (find_package): By not providing "Findbut_velodyne.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "but_velodyne", but CMake did not find one.

Could not find a package configuration file provided by "but_velodyne" with any of the following names:

but_velodyneConfig.cmake
but_velodyne-config.cmake

Add the installation prefix of "but_velodyne" to CMAKE_PREFIX_PATH or set "but_velodyne_DIR" to a directory containing one of the above files. If "but_velodyne" provides a separate development package or SDK, be sure it has been installed.

martin-velas commented 7 years ago

Hi, try to set CMake property but_velodyne_DIR to /usr/local/lib/cmake/but_velodyne-0.1. Hope it helps, Martin.

ModiGit commented 7 years ago

Hello, I had the exact same issue. The fix was to download the but_velodyne_lib from robofit/but_velodyne_lib instead of the one from martin-velas/but_velodyne_lib which seems to be missing the required files.

Thanks!!

martin-velas commented 7 years ago

Thanks for pointing this out! The link to but_velodyne_lib was fixed in my answer above.

I have not noticed this error - of course - my fork is quite under the construction ...

ModiGit commented 7 years ago

No problem, thanks for sharing these great libraries and for all the support!

saesaem commented 7 years ago

I don't know what's mean " Hi, try to set CMake property but_velodyne_DIR to /usr/local/lib/cmake/but_velodyne-0.1. Hope it helps, Martin. " Could you explain in detail?

martin-velas commented 7 years ago

Catkin project is actually CMake project. In order to build and link it properly, sometimes you need to specify the paths to libraries explicitly. Run this within the build directory of your catkin workspace: ivelas@ivelas-pc:~/catkin_ws/build$ ccmake ../src Find the line of property but_velodyne_DIR and set it to: /usr/local/lib/cmake/but_velodyne-0.1 (or whatever location you have used for installation of but_velodyne_lib)

image

Hope it helps. Cheers!

saesaem commented 7 years ago

Thank you for help! I followed your comment. However, it didn't work. 53 54

martin-velas commented 7 years ago

It seems that you did not installed but_velodyne_lib into /home/saesaem/local/lib/cmake/but_velodyne-0.1- this is necessary requirement as Readme says. Check, if this directory actually exists.

saesaem commented 7 years ago

my but_velodyne_lib is in here. home/QuanergySystems/catkin_ws/src/but_velodyne_lib So I retried and then the result was same.... 55 56

saesaem commented 7 years ago

Thank you for help! I think I solved this one. I found the location where but_velodyne-config.cmake is and set it to but_velodyne_DIR Thank you so much! 57

saesaem commented 7 years ago

Could you explain this problem? 62 my CMakeLists.txt and package.xml are below 60 61

saesaem commented 7 years ago

I solved it Thank you so much! I just modified like this

include <but_velodyne/VelodynePointCloud.h> -> #include <header file's location/VelodynePointCloud.h>

and then, I met a new problem. I hope someone know this solution. 63

martin-velas commented 7 years ago

You should not set "header file's location" into #include <...>. The fact, that neither but_velodyne/VelodynePointCloud.h nor -lbut_velodyne can be found means, that the but_velodyne_DIR is not correctly set. I suggest:

saesaem commented 7 years ago

Thank you martin-velas!

my step was :

  1. mkdir -p ~/QuanergySystems/catkin_ws/src

  2. cd ~/QuanergySystems/catkin_ws/src

  3. catkin_init_workspace

  4. git clone https://github.com/robofit/but_velodyne.git

  5. cd ~/QuanergySystems/catkin_ws

  6. catkin_make

  7. issue 68

  8. cd build; ccmake ../src 69 press [c] to configure

  9. issue 70

  10. back to number 8th change but_velodyne_DIR -> /home/saesaem/QuanergySystems/catkin_ws/src/but_velodyne_lib/bin 71

  11. catkin_make

  12. issue 72

  13. change CMAKE_INSTALL_PREFIX -> /home/saesaem/local 73

  14. catkin_make

  15. same issue 74

I am confused how to build the package. In case of but_velodyne_lib, I did $cd but_velodyne_lib $mkdir bin; cd bin $cmake .. $make

In case of but_velodyne $mkdir -p ~/QuanergySystems/catkin_ws/src $cd ~/QuanergySystems/catkin_ws/src $catkin_init_workspace $git clone https://github.com/QuanergySystems/quanergy_client_ros.git $cd ~/QuanergySystems/catkin_ws $catkin_make

anyway, I met same issue I am not sure where I shoud fix.

martin-velas commented 7 years ago

but_velodyne_lib is dependency of but_velodyne ROS package. You need to set CMAKE_INSTALL_PREFIX for but_velodyne_lib (not for but_velodyne). run "make install" and then set "~/local/blablabla..." to property "but_velodyne_DIR" of but_velodyne ROS package.

2amour commented 5 years ago

Hi, @martin-velas I meet some errors when I use catkin_make. CMake Warning at /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:76 (find_package): Could not find a package configuration file provided by "velodyne_pointcloud" with any of the following names:

velodyne_pointcloudConfig.cmake
velodyne_pointcloud-config.cmake

Add the installation prefix of "velodyne_pointcloud" to CMAKE_PREFIX_PATH or set "velodyne_pointcloud_DIR" to a directory containing one of the above files. If "velodyne_pointcloud" provides a separate development package or SDK, be sure it has been installed. Call Stack (most recent call first): but_velodyne/but_calibration_camera_velodyne/CMakeLists.txt:5 (find_package)

-- Could not find the required component 'velodyne_pointcloud'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found. CMake Error at /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package): Could not find a package configuration file provided by "velodyne_pointcloud" with any of the following names:

velodyne_pointcloudConfig.cmake
velodyne_pointcloud-config.cmake

Add the installation prefix of "velodyne_pointcloud" to CMAKE_PREFIX_PATH or set "velodyne_pointcloud_DIR" to a directory containing one of the above files. If "velodyne_pointcloud" provides a separate development package or SDK, be sure it has been installed. Call Stack (most recent call first): but_velodyne/but_calibration_camera_velodyne/CMakeLists.txt:5 (find_package)

-- Configuring incomplete, errors occurred! See also "/home/xiao/catkin_but_velodyne/build/CMakeFiles/CMakeOutput.log". See also "/home/xiao/catkin_but_velodyne/build/CMakeFiles/CMakeError.log". Invoking "cmake" failed

And I use ccmake ../src within build, and could not find but_velodyne_DIR, what's the problem?

junzhang2016 commented 4 years ago

Hi, @martin-velas I meet some errors when I use catkin_make. CMake Warning at /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:76 (find_package): Could not find a package configuration file provided by "velodyne_pointcloud" with any of the following names:

velodyne_pointcloudConfig.cmake
velodyne_pointcloud-config.cmake

Add the installation prefix of "velodyne_pointcloud" to CMAKE_PREFIX_PATH or set "velodyne_pointcloud_DIR" to a directory containing one of the above files. If "velodyne_pointcloud" provides a separate development package or SDK, be sure it has been installed. Call Stack (most recent call first): but_velodyne/but_calibration_camera_velodyne/CMakeLists.txt:5 (find_package)

-- Could not find the required component 'velodyne_pointcloud'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found. CMake Error at /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package): Could not find a package configuration file provided by "velodyne_pointcloud" with any of the following names:

velodyne_pointcloudConfig.cmake
velodyne_pointcloud-config.cmake

Add the installation prefix of "velodyne_pointcloud" to CMAKE_PREFIX_PATH or set "velodyne_pointcloud_DIR" to a directory containing one of the above files. If "velodyne_pointcloud" provides a separate development package or SDK, be sure it has been installed. Call Stack (most recent call first): but_velodyne/but_calibration_camera_velodyne/CMakeLists.txt:5 (find_package)

-- Configuring incomplete, errors occurred! See also "/home/xiao/catkin_but_velodyne/build/CMakeFiles/CMakeOutput.log". See also "/home/xiao/catkin_but_velodyne/build/CMakeFiles/CMakeError.log". Invoking "cmake" failed

And I use ccmake ../src within build, and could not find but_velodyne_DIR, what's the problem?

Hi, I got the same problem. The solution is to git clone this package velodyne into your catkin_ws/src, then compile catkin_make.

Meanwhile, you may got the problem:

home/jun/my_catkin_wses/calibration_ws/src/velodyne/velodyne_driver/include/velodyne_driver/input.h:58:18: fatal error: pcap.h: No such file or directory

Then, you should cd catkin_ws/ rosdep install --from-paths src --ignore-src --rosdistro kinetic -y (following this )

Then, compile catkin_make

martin-velas commented 4 years ago

Thanks for the answer :) - I assume this issue can be closed.