ros2 / ros2_documentation

ROS 2 docs repository
https://docs.ros.org/en/rolling
Creative Commons Attribution 4.0 International
535 stars 1.06k forks source link

"Using colcon to build packages" beginner tutorial don't work for me #4731

Closed LucaMIMOUNI closed 2 weeks ago

LucaMIMOUNI commented 2 weeks ago

Hello everyone,

I am trying to follow this basic tutorial : https://docs.ros.org/en/humble/Tutorials/Beginner-Client-Libraries/Colcon-Tutorial.html

I find trouble when trying to colcon build --symlink-install in the root of my ros2_ws, and get this error :

`--- stderr: examples_rclcpp_async_client CMake Error at CMakeLists.txt:14 (find_package): By not providing "Findexample_interfaces.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "example_interfaces", but CMake did not find one.

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

example_interfacesConfig.cmake
example_interfaces-config.cmake

Add the installation prefix of "example_interfaces" to CMAKE_PREFIX_PATH or set "example_interfaces_DIR" to a directory containing one of the above files. If "example_interfaces" provides a separate development package or SDK, be sure it has been installed. 1 package failed: examples_rclcpp_async_client`

I've try with and without sourcing /opt/ros/humble/setup.bash in the terminal. Moreover, "example_interface" is already in the async_client package.xml :

<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format2.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="2">
  <name>examples_rclcpp_async_client</name>
  <version>0.15.2</version>
  <description>Example of an async service client</description>
  <maintainer email="sloretz@openrobotics.org">Shane Loretz</maintainer>
  <maintainer email="aditya.pande@openrobotics.org">Aditya Pande</maintainer>
  <license>Apache License 2.0</license>
  <author email="ivanpauno@ekumenlabs.com">Ivan Paunovic</author>
  <author email="william@osrfoundation.org">William Woodall</author>

  <buildtool_depend>ament_cmake</buildtool_depend>

  <build_depend>rclcpp</build_depend>
  <build_depend>example_interfaces</build_depend>

  <exec_depend>rclcpp</exec_depend>
  <exec_depend>example_interfaces</exec_depend>

  <test_depend>ament_lint_auto</test_depend>
  <test_depend>ament_lint_common</test_depend>

  <export>
    <build_type>ament_cmake</build_type>
  </export>
</package>

So that I do not understand the error I got when colcon building.

I am working with ros humble distribution on ubuntu 22.04. If you need any other information, feel free to tell me.

Thnaks !

clalancette commented 2 weeks ago

Please open questions like this on https://robotics.stackexchange.com/questions/tagged/ros, which is our central Question and Answer site. You'll get a better answer there, and it will be searchable for the future.

Make sure to include a lot of information on what platform you are using, which ROS distribution you are using, and the exact steps you took.