Compilation error of package unit_5_services in Unit 6 terminals o

when i compile unit_5_services package in the Unit 6 terminals it is showing error , but no errors showing when i compiled in Unit 5 terminals using catkin build.

Hello @nayakluckykant01 ,

I’ve done some modifications that should fix this error you showed.

Thanks @albertoezquerro

Hello,

I am also having the same error after entering unit 6:

-- +++ processing catkin package: 'my_robot_arm'
-- ==> add_subdirectory(my_robot_arm)
-- Could NOT find iri_wam_reproduce_trajectory (missing: iri_wam_reproduce_trajectory_DIR)
-- Could not find the required component 'iri_wam_reproduce_trajectory'. 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/noetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
  Could not find a package configuration file provided by
  "iri_wam_reproduce_trajectory" with any of the following names:

    iri_wam_reproduce_trajectoryConfig.cmake
    iri_wam_reproduce_trajectory-config.cmake

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


-- Configuring incomplete, errors occurred!
See also "/home/user/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/user/catkin_ws/build/CMakeFiles/CMakeError.log".
make: *** [Makefile:1216: cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed

The package my_robot_arm is the one created in response to Exercise 5.2

The same also holds for the service_client_pkg package created in response to Exercise 5.1:

-- +++ processing catkin package: 'service_client_pkg'
-- ==> add_subdirectory(service_client_pkg)
-- Could NOT find trajectory_by_name_srv (missing: trajectory_by_name_srv_DIR)
-- Could not find the required component 'trajectory_by_name_srv'. 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/noetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
  Could not find a package configuration file provided by
  "trajectory_by_name_srv" with any of the following names:

    trajectory_by_name_srvConfig.cmake
    trajectory_by_name_srv-config.cmake

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


-- Configuring incomplete, errors occurred!
See also "/home/user/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/user/catkin_ws/build/CMakeFiles/CMakeError.log".
make: *** [Makefile:1216: cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed

Could you please reinstate them?

Regards,
Arnab

Are you using this package in the packages that are failing? If not, please remove the from the CMakeLists.txt and package.xml of these packages.

Also, it looks like you created some of your packages using copy and paste. If you did, please don’t. You should always create packages from scratch using catkin_create_pkg.

Hello bayodesegun,

The package trajectory_by_name_srv was used and was accessible in Unit 5.
Since the lessons progress by carrying over the user-generated packages, made in the previous units, over to the next unit, then the dependent packages, that were needed by them, need to be made available for cmake to function in the new-unit.

Is it intended for the user to delete user-created packages from the previous unit when progressing over to the next unit? If so, then that is highly inconvenient for end-users as they might need to refer back to old-working code to see how they had overcome a problem before. I know I did.

Also, could you please elaborate how you are able to conclude that I had copied and reused a previously-generated package again instead of creating it from scratch? I know that I have not done something like that since it is tedious to go through the cmake, and what-not, to track-down the mentioning of the last package-name used and change it to the new one.

Regards,
Arnab

What exactly do you mean by “carrying over”? Can you give an example?

No, users are not expected to delete those packages.

However, you must create a new package where you are told to, and you should avoid copying setup files from old packages into new packages.

  • Specifically, never copy CMakeLists.txt and package.xml from old packages.
  • If you copy other files (like Python/C++ sources and launch files), make sure you customize them for the new package.

That said,

  • If it’s the same package you created in the previous unit, and we asked you to use it in a new exercise, then it’s on us because the trajectory_by_name_srv is accessible in the previous unit but not this one.
  • It it’s a new package you created in this unit, then you have probably copied over some things you should not copy from the previous package.

In any case the solution is to remove the package from CMakeLists.txt and package.xml.

I didn’t conclude. I said it “looks like” because I have seen it happen. Note that I also added: