[Bug] Could not find services_quiz package

Hello,
I am having trouble launching the launch file for the services quiz. I am not sure where or what could cause the error. I have looked at other posts and only one stood out, but their solution did not help me. I have tried the rm -rf build install log command to build the packages again. A warning pops up but they still compile.

Hi @damart35 ,

From your attached images, I understand what you have done is correct.

The error that you are seeing at this point, I believe, is due to something glitching in the course environment.

Here are a few solutions that you can try:

  1. Restart the terminal (by clicking on the circular arrow button on the right end of the terminal tab) and re-launch your programs.
  2. If step 1 does not work, refresh the page and repeat step 1.
  3. If step 2 does not work, close the webpage, clear your browser history and cookies, restart the browser, open the course and repeat step 1.

One of the steps should solve your problem. If the problem still persists after these attempts, let us know!

Regards,
Girish

Hi Girish,

I tried all three steps, but it is still giving me the same error. What can I do now?

Sincerely,

Hi @damart35 ,

There are few other things that needs to be checked now.

  1. Did you create the package using ros2 pkg create ... command?
  2. Where did you create your services_quiz package? Did you create it inside ~/ros2_ws/src? Or somewhere else like ~/ or ~/ros2_ws?
  3. Did your package compile successfully with colcon build command?

The thing is, if the services_quiz package is not created inside ~/ros2_ws/src using the ros2 pkg create ... command, then colcon will not find your package.

Here are the steps to make sure that your package services_quiz is a valid package:

  1. Package created using ros2 pkg create ... command.
  2. Package created inside ~/ros2_ws/src directory.
  3. setup.py (for Python) or CMakeLists.txt (for C++) file is updated properly.
  4. package.xml file contains properly defined dependencies.
  5. Package is built/compiled using colcon build or colcon build --packages-select ....
  6. install directory is sourced after compilation.

If all the above 6 steps are done properly and you still get the same issue, then there is some glitch in your course environment.

Please let me know after trying out these steps.

Regards,
Girish

Hello,

I remember doing all of these steps when creating the services_quiz package. So, I decided to make another package in the ~/ros2_ws/src directory. However, I noticed that I did not include the services_quiz_srv package as a dependency the first time so maybe that was causing the problem. I was lazy and decided to just copy and paste from the old services_quiz into the new one and use colcon build within ~/ros2_ws directory. I ran the command to launch the server and it worked. Now, I am working on passing the quiz. Thank you for your help!

Thanks,

Hi @damart35 ,

Glad to know that I was of help to you. I see that you have found your issue and you have fixed it!

Regards,
Girish

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.