ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Fix package installation files

asked 2022-08-28 16:09:41 -0600

Asmox gravatar image

Hello, I'm new into ROS2 and many of concepts are still unclear for me. Once I noticed that I cannot rebuild custom definition of service. Disregarding the reason, I followed some guidelines to remove log install and build directories within workspace. And then my package has totally broken - I'm unable to build it. Everytime I try, I'm getting error:

$ colcon build
Starting >>> cpp_pubsub
Starting >>> yoctoservice
Finished <<< cpp_pubsub [0.95s]                                                             
--- stderr: yoctoservice                         
CMake Error at CMakeLists.txt:8 (find_package):
  By not providing "Findyoctoservice.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "yoctoservice", but CMake did not find one.

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


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

Failed   <<< yoctoservice [3.80s, exited with code 1]

Summary: 1 package finished [4.59s]
  1 package failed: yoctoservice
  1 package had stderr output: yoctoservice

I tried to use sourcing opt/ros/humble/setup.bash, . install/setup.bash, but no result. I have my yoctoservice package files stored in workspace/src/yoctoservice. Can I fix installation of this package somehow?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2022-08-29 03:22:32 -0600

ravijoshi gravatar image

I highly suspect the commands and paths you have mentioned.

  1. opt/ros/humble/setup.bash should be /opt/ros/humble/setup.bash
  2. . install/setup.bash should be install/local_setup.bash

Finally, please make sure that you can see your workspace by executing printenv | grep PATH as shown below:

$ printenv | grep PATH






This is how my workspace is structured:

├── Desktop
├── Documents
├── Downloads
├── Music
├── Pictures
├── Public
├── ros2_ws
│   ├── build
│   ├── install
│   ├── log
│   └── src
│       └── minimal_publisher
├── Templates
└── Videos
edit flag offensive delete link more

Question Tools

1 follower


Asked: 2022-08-28 16:09:41 -0600

Seen: 184 times

Last updated: Aug 29 '22