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

Required package not found while building 'mav_trajectory_generation' during catkin build. #14

Open
wpower12 opened this issue Nov 15, 2022 · 3 comments
Labels
question Further information is requested

Comments

@wpower12
Copy link

I'm trying to get the example described in the main README file working. I'm inside a docker container on ubuntu 20.02 focal. I'm using the ros-noetic-robot container file to start with. After getting catkin working, and all prereqs installed, i manged to get through the build process, up until the 'mav_trajectory_generation' step. Then I get a somewhat unhelpful message about a missing package;

...
Starting  >>> eigen_checks                                                                         
Finished  <<< geo_controller                           [ 0.3 seconds ]                             
Finished  <<< eigen_checks                             [ 0.2 seconds ]                             
Starting  >>> mav_trajectory_generation                                                            
___________________________________________________________________________________________________
Errors     << mav_trajectory_generation:cmake /catkin_ws/logs/mav_trajectory_generation/build.cmake.004.log
CMake Warning (dev) at CMakeLists.txt:2 (project):
  Policy CMP0048 is not set: project() command manages VERSION variables.
  Run "cmake --help-policy CMP0048" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  The following variable(s) would be set to empty:

    CMAKE_PROJECT_VERSION
    CMAKE_PROJECT_VERSION_MAJOR
    CMAKE_PROJECT_VERSION_MINOR
    CMAKE_PROJECT_VERSION_PATCH
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at /usr/share/cmake-3.16/Modules/FindPkgConfig.cmake:463 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/share/cmake-3.16/Modules/FindPkgConfig.cmake:643 (_pkg_check_modules_internal)
  CMakeLists.txt:19 (pkg_check_modules)


cd /catkin_ws/build/mav_trajectory_generation; catkin build --get-env mav_trajectory_generation | catkin env -si  /usr/bin/cmake /catkin_ws/src/mav_trajectory_generation/mav_trajectory_generation --no-warn-unused-cli -DCATKIN_DEVEL_PREFIX=/catkin_ws/devel/.private/mav_trajectory_generation -DCMAKE_INSTALL_PREFIX=/catkin_ws/install; cd -

...................................................................................................
Failed     << mav_trajectory_generation:cmake          [ Exited with code 1 ]                      
Failed    <<< mav_trajectory_generation                [ 1.0 seconds ]                             
Abandoned <<< multi_uav_simulator                      [ Unrelated job failed ]                    
[build] Summary: 8 of 10 packages succeeded.                                                       
[build]   Ignored:   7 packages were skipped or are skiplisted.                                    
[build]   Warnings:  None.                                                                         
[build]   Abandoned: 1 packages were abandoned.                                                    
[build]   Failed:    1 packages failed.                                                            
[build] Runtime: 3.1 seconds total.     

Up to this point, I was getting the occasional dependency errors (libtools), but they were easy to resolve. The error message made me think it was an issue with pulling/merging the dependency mentioned in the walkthrough, so I reran those steps, but the error persisted.

@malintha
Copy link
Owner

malintha commented Nov 17, 2022

This is interesting.
When I initialized with wstool this seems to work perfectly (on Ubuntu 20.04). However, for the sake of reproduction, I followed this [1]; first installed rosdep (sudo apt install python3-rosdep2) and then initialized the directory with rosdep by running rosdep install --from-paths . --ignore-src --rosdistro noetic -yr. This led me to exactly the same error, and some additional complaints about it not being able to find tf and rospy. I then had to install using sudo apt-get install ros-noetic-rospy and sudo apt-get install ros-noetic-tf.

This led me to think rosdep resolve dependencies in a different way (it seems to check system-wide) than wstool [2]. To me it seems like this problem only occur if you have initialized using rosdep and dependencies are not installed system-wide, in which case you'll have to install the dependencies using apt-get. But, I doubt all the packages do have apt-get installations, e.g., rosdep couldn't find glog_catkin, which is a dependency to mav_trajectory_generation. Which might be the reason it's failing mav_trajectory_generation and not saying what exactly is missing.

[1] https://answers.ros.org/question/354964/cmake-error-a-required-package-was-not-found/
[2] https://answers.ros.org/question/267067/difference-between-wstool-and-rosdep/

@malintha malintha added the question Further information is requested label Nov 17, 2022
@malintha
Copy link
Owner

malintha commented Nov 23, 2022

@wpower12 Can you confirm this on a clean catkin_ws on Ubuntu 20.04 + Ros Noetic?

@matteovidali
Copy link
Contributor

I also encountered this issue on Ubuntu 20.04, and simply installing the tf package using sudo apt install ros-noetic-tf solved this issue for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants