Problems with launch files

Hi all guys. i’m having trouble completing the ros2 services quiz in 5 days (python). Specifically , until a few days ago my workspace was working and now i can’t seem to compile or find the various dependencies anymore, solutions?

user:~/ros2_ws$ ros2 launch services_quiz service_quiz_client.launch.py
Package ‘services_quiz’ not found: “package ‘services_quiz’ not found, searching: [‘/home/simulations/ros2_sims_ws/install/turtlebot3’, ‘/home/simulations/ros2_sims_ws/install/turtlebot3_teleop’, ‘/home/simulations/ros2_sims_ws/install/turtlebot3_simulations’, ‘/home/simulations/ros2_sims_ws/install/turtlebot3_navigation2’, ‘/home/simulations/ros2_sims_ws/install/turtlebot3_example’, ‘/home/simulations/ros2_sims_ws/install/turtlebot3_msgs’, ‘/home/simulations/ros2_sims_ws/install/turtlebot3_gazebo’, ‘/home/simulations/ros2_sims_ws/install/turtlebot3_bringup’, ‘/home/simulations/ros2_sims_ws/install/turtlebot3_description’, ‘/home/simulations/ros2_sims_ws/install/turtlebot3_cartographer’, ‘/home/simulations/ros2_sims_ws/install/turtlebot3_as’, ‘/home/simulations/ros2_sims_ws/install/t3_action_msg’, ‘/home/simulations/ros2_sims_ws/install/services_pkg’, ‘/home/simulations/ros2_sims_ws/install/dynamixel_sdk’, ‘/home/user/ros2_ws/install/topics_quiz’, ‘/home/user/ros2_ws/install/services_quiz_srv’, ‘/home/user/ros2_ws/install/movement_pkg’, ‘/home/user/ros2_ws/install/exercise42_pkg’, ‘/home/user/ros2_ws/install/custom_interfaces’, ‘/home/user/ros2_ws/install/client_pkg’, ‘/opt/ros/humble’, ‘/home/user/ros2_ws/install’, ‘/home/user/ros2_ws/install’]”
user:~/ros2_ws$ ros2 launch services_quiz service_quiz_server.launch.py
Package ‘services_quiz’ not found: “package ‘services_quiz’ not found, searching: [‘/home/simulations/ros2_sims_ws/install/turtlebot3’, ‘/home/simulations/ros2_sims_ws/install/turtlebot3_teleop’, ‘/home/simulations/ros2_sims_ws/install/turtlebot3_simulations’, ‘/home/simulations/ros2_sims_ws/install/turtlebot3_navigation2’, ‘/home/simulations/ros2_sims_ws/install/turtlebot3_example’, ‘/home/simulations/ros2_sims_ws/install/turtlebot3_msgs’, ‘/home/simulations/ros2_sims_ws/install/turtlebot3_gazebo’, ‘/home/simulations/ros2_sims_ws/install/turtlebot3_bringup’, ‘/home/simulations/ros2_sims_ws/install/turtlebot3_description’, ‘/home/simulations/ros2_sims_ws/install/turtlebot3_cartographer’, ‘/home/simulations/ros2_sims_ws/install/turtlebot3_as’, ‘/home/simulations/ros2_sims_ws/install/t3_action_msg’, ‘/home/simulations/ros2_sims_ws/install/services_pkg’, ‘/home/simulations/ros2_sims_ws/install/dynamixel_sdk’, ‘/home/user/ros2_ws/install/topics_quiz’, ‘/home/user/ros2_ws/install/services_quiz_srv’, ‘/home/user/ros2_ws/install/movement_pkg’, ‘/home/user/ros2_ws/install/exercise42_pkg’, ‘/home/user/ros2_ws/install/custom_interfaces’, ‘/home/user/ros2_ws/install/client_pkg’, ‘/opt/ros/humble’, ‘/home/user/ros2_ws/install’, ‘/home/user/ros2_ws/install’]”
user:~/ros2_ws$

Please try:

cd ~/ros2_ws
rm -rf build/ install/ log/
colcon build
source install/setup.bash  # run this on every web shell

Thank you, Bayodesegun.

I tried what you suggested (I had already tried removing the folders directly from VS), but nothing works. Here is the current situation:

user:~$ cd ~/ros2_ws
user:~/ros2_ws$ rm -rf build/ install/ log/
user:~/ros2_ws$ colcon build
[4.064s] WARNING:colcon.colcon_ros.prefix_path.ament:The path ‘/home/user/ros2_ws/install/topics_quiz’ in the environment variable AMENT_PREFIX_PATH doesn’t exist
[4.065s] WARNING:colcon.colcon_ros.prefix_path.ament:The path ‘/home/user/ros2_ws/install/services_quiz_srv’ in the environment variable AMENT_PREFIX_PATH doesn’t exist
[4.065s] WARNING:colcon.colcon_ros.prefix_path.ament:The path ‘/home/user/ros2_ws/install/movement_pkg’ in the environment variable AMENT_PREFIX_PATH doesn’t exist
[4.065s] WARNING:colcon.colcon_ros.prefix_path.ament:The path ‘/home/user/ros2_ws/install/exercise42_pkg’ in the environment variable AMENT_PREFIX_PATH doesn’t exist
[4.065s] WARNING:colcon.colcon_ros.prefix_path.ament:The path ‘/home/user/ros2_ws/install/custom_interfaces’ in the environment variable AMENT_PREFIX_PATH doesn’t exist
[4.065s] WARNING:colcon.colcon_ros.prefix_path.ament:The path '/home/user/ros2_ws/install/client_pkg’in the environment variable AMENT_PREFIX_PATH doesn’t exist
[4.065s] WARNING:colcon.colcon_ros.prefix_path.ament:The path ‘/home/user/ros2_ws/install’ in the environment variable AMENT_PREFIX_PATH doesn’t contain any ‘local_setup.*’ files.
[4.066s] WARNING:colcon.colcon_ros.prefix_path.catkin:The path ‘/home/user/ros2_ws/install/services_quiz_srv’ in the environment variable CMAKE_PREFIX_PATH doesn’t exist
[4.066s] WARNING:colcon.colcon_ros.prefix_path.catkin:The path ‘/home/user/ros2_ws/install/custom_interfaces’ in the environment variable CMAKE_PREFIX_PATH doesn’t exist
Starting >>> custom_interfaces
Starting >>> client_pkg
Starting >>> exercise42_pkg
Starting >>> services_quiz
Starting >>> services_quiz_srv
Starting >>> topics_quiz
Finished <<< services_quiz [5.27s]
Finished <<< exercise42_pkg [5.32s]
Finished <<< client_pkg [5.42s]
Finished <<< topics_quiz [5.35s]
Finished <<< custom_interfaces [26.3s]
Starting >>> movement_pkg
Finished <<< services_quiz_srv [26.3s]
Finished <<< movement_pkg [1.66s]

Summary: 7 packages finished [31.6s]

and in the other terminal

user:~/ros2_ws$ ros2 launch [tab][tab]
services_services_pkg services_quiz_srv

However, “service_quiz” is missing

Hi @Albin ,

You must also source your workspace in this new terminal.

So do the following (in your other terminal):

cd ~/ros2_ws && source install/setup.bash   # run this on all new terminal

ros2 launch [tab][tab]   # will now also show services_quiz package

ros2 launch services_quiz <launch_file>

That should fix your problem.

Regards,
Girish

Hi @girishkumar.kannan

Thank you for the reply. Unfortunately, it doesn’t work.

I even tried to build only the package under consideration with this command:
user:~/ros2_ws$ colcon build --packages-select service_quiz
But I received the following warning:
[1.007s] WARNING:colcon.colcon_core.package_selection:ignoring unknown package ‘service_quiz’ in --packages-select

Summary: 0 packages finished [0.59s]
user:~/ros2_ws$

This issue appeared after I tried to submit my code for the quiz.

Hi @Albin ,

Your package name is services_quiz and not service_quiz. That is probably the issue.

From your first post:

From your most recent post:

You are trying to compile a package that does not even exist!
service_quiz does not exist in your system.
services_quiz exists on your system!

Please pay attention! The error clearly says the issue:

colcon does not know that you intended to say services_quiz instead of service_quiz.
If the package of the specified name is not found, then to colcon, it is non-existent in your system.

I hope this helps.

Regards,
Girish

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