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

add rosdep install to Setup instruction for resolving dependencies #105

Merged
merged 2 commits into from
Feb 8, 2024

Conversation

takasehideki
Copy link
Contributor

When I tried to use this awesome repository, I found ament-cmake-vendor-package is needed to build this package.
I tested this behavior by using both iron and rolling images on Docker Official Image for ros, but it seems that this package is not installed by default.

% docker run -it ros:rolling              
# sudo apt update && sudo apt install curl
# curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# source "$HOME/.cargo/env"
# mkdir -p ws/src && cd ws/src/
# git clone https://github.com/ros2/rmw_zenoh
# cd ..
# colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
Starting >>> zenoh_c_vendor
--- stderr: zenoh_c_vendor                         
CMake Error at CMakeLists.txt:11 (find_package):
  By not providing "Findament_cmake_vendor_package.cmake" in
  CMAKE_MODULE_PATH this project has asked CMake to find a package
  configuration file provided by "ament_cmake_vendor_package", but CMake did
  not find one.

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

    ament_cmake_vendor_packageConfig.cmake
    ament_cmake_vendor_package-config.cmake

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


---
Failed   <<< zenoh_c_vendor [0.11s, exited with code 1]

Summary: 0 packages finished [0.41s]
  1 package failed: zenoh_c_vendor
  1 package had stderr output: zenoh_c_vendor
  1 package not processed

Of course, those familiar with ROS will quickly realize that they can just operate apt install ros-<DISTRO>-ament-cmake-vendor-package to fix this issue. But there are others who don't. I think it would be not good to waste time before trying out this wonderful package. Also, I understand that it is also possible that this operation may not be necessary in the future.
However, I want to suggest adding a note about this solution for now.

Copy link
Member

@Yadunund Yadunund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR to improve the build experience. I think right way to resolve this issue (and other dependency related issues that may arise in the future), is to add a rosdep install step to the Setup instructions.

mkdir ~/ws_rmw_zenoh/src -p && cd ~/ws_rmw_zenoh/src
git clone https://github.com/ros2/rmw_zenoh.git
cd ~/ws_rmw_zenoh
+ rosdep install --from-paths src --ignore-src --rosdistro <DISTRO> -y # replace <DISTRO> with ROS 2 distro of choice
source /opt/ros/<DISTRO>/setup.bash # replace <DISTRO> with ROS 2 distro of choice
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release

This way rosdep can help install other dependency packages too that may not be present on the user's system.

Do you mind updating this PR to include that line?

@takasehideki takasehideki changed the title add note to install ament_cmake_vendor_package add rosdep install to Setup instruction for resolving dependencies Feb 8, 2024
@takasehideki
Copy link
Contributor Author

@Yadunund Thank you for reviewing!
Yes, that way is smarter. I added the commit to add the instruction and changed the PR title.

Copy link
Member

@Yadunund Yadunund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick change.

@Yadunund Yadunund merged commit 1b4a717 into ros2:rolling Feb 8, 2024
5 checks passed
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

Successfully merging this pull request may close these issues.

2 participants