6.4 Services Quiz => Packages "services_quiz" not found in the workspace

When I run
catkin_make --only-pkg-with-deps services_quiz

Terminal show this

I don’t know how to fix this problem. Help me.

Hi @e79901ad11b04cca ,

Welcome to this Community!

Where exactly have you created your services_quiz package?
It must be inside this path: /home/user/catkin_ws/src/.
If you have created it somewhere else by mistake, then move it to the above path.
Then run catkin_make --only-pkg-with-deps services_quiz inside /home/user/catkin_ws directory.
Do not forget to source your workspace after compilation: source devel/setup.bash inside catkin_ws folder.

Let me know if this helped you.

In case, you have followed all these steps and still you have problems, then delete build and devel folders inside catkin_ws directory and rebuild the package.
In case, the above also fails, then post a screenshot of your entire package expanded in your IDE left panel.

Regards,
Girish

I created services_quiz package in src

Then run catkin_make --only-pkg-with-deps services_quiz inside /home/user/catkin_ws directory. But it did not work.

then delete build and devel folders inside catkin_ws directory and rebuild the package. But it did not work too.

And this is my package expanded.

Regards,
Sitthinon

Hi @e79901ad11b04cca ,

I see that you have three very new files, that I believe, does not belong inside a ROS package.
What are mainpage.dox, Makefile and manifest.xml?
Which version of ROS are you using? Noetic does not make these files.

You are missing package.xml - the main file to build a package.
That is the reason why you are getting this error:
Packages “services_quiz” not found in the workspace

Did you create your package using catkin_create_pkg?

Could you please post the contents of your CMakeLists.txt file and manifest.xml file as code-block?
Refer this link to know about code-block: Extended Syntax | Markdown Guide

Regards,
Girish

1 Like

Hello @e79901ad11b04cca

you are in the Python course section so I believe catkin make is only needed for the srv part.
Probably you should have created a seperate package for the services_quiz_srv ?

Regards,

1 Like

I created package services_quiz with the commands catkin_create_pkg but it not generated package.xml

This is inside the file CMakeLists.txt

cmake_minimum_required(VERSION 2.4.6)
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)

# Set the build type.  Options are:
#  Coverage       : w/ debug symbols, w/o optimization, w/ code-coverage
#  Debug          : w/ debug symbols, w/o optimization
#  Release        : w/o debug symbols, w/ optimization
#  RelWithDebInfo : w/ debug symbols, w/ optimization
#  MinSizeRel     : w/o debug symbols, w/ optimization, stripped binaries
#set(ROS_BUILD_TYPE RelWithDebInfo)

rosbuild_init()

#set the default path for built executables to the "bin" directory
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
#set the default path for built libraries to the "lib" directory
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)

#uncomment if you have defined messages
#rosbuild_genmsg()
#uncomment if you have defined services
#rosbuild_gensrv()

#common commands for building c++ executables and libraries
#rosbuild_add_library(${PROJECT_NAME} src/example.cpp)
#target_link_libraries(${PROJECT_NAME} another_library)
#rosbuild_add_boost_directories()
#rosbuild_link_boost(${PROJECT_NAME} thread)
#rosbuild_add_executable(example examples/example.cpp)
#target_link_libraries(example ${PROJECT_NAME})

find_package(catkin REQUIRED COMPONENTS
  std_msgs
  message_generation
)

add_service_files(
  FILES
  BB8CustomServiceMessage.srv
)

generate_messages(
  DEPENDENCIES
  std_msgs
)

catkin_package(
      CATKIN_DEPENDS
      rospy
)

include_directories(
# include
  ${catkin_INCLUDE_DIRS}
)

This is inside the file manifest.xml

<package>
  <description brief="services_quiz">

     services_quiz

  </description>
  <author>user</author>
  <license>BSD</license>
  <review status="unreviewed" notes=""/>
  <url>http://ros.org/wiki/services_quiz</url>
  <depend package="rospy"/>
  <depend package="std_msgs"/>

  <buildtool_depend>catkin</buildtool_depend>
  <build_depend>rospy</build_depend>
  <build_depend>message_generation</build_depend>
  <build_export_depend>rospy</build_export_depend>
  <build_export_depend>message_runtime</build_export_depend>
  <exec_depend>message_runtime</exec_depend>
  <exec_depend>rospy</exec_depend>

</package>

Hi @e79901ad11b04cca ,

Thanks for posting the file contents.

Just looking at your file contents that you posted, I understand that you have a completely different version of ROS. That is why your package build is failing.
The contents of CMakeLists.txt file and package.xml file are structured quite differently.

Is it just this package or do all the packages fail during build time?

Also, is this the only package with manifest.xml file or does all your packages have manifest.xml file?

Honestly, I have not worked on the version that you are using.

In my opinion, you must probably re-create your package from scratch. I am assuming that the course currently uses ROS Noetic and the build method is completely different - requiring a package.xml file instead of manifest.xml file.

Perhaps, The Construct team can look into this issue and provide a fix.

Regards,
Girish

1 Like

→ It has problems only packages services_quiz and it can’t build this packages

→ I attempted to recreate the packages, and they worked!!!

Thank you so much for your help.

Regards,
Sitthinon

1 Like