I am stuck on the ROS services quiz exercise. it keeps failing even though I have tested the code and it works. it says it cant find my services_quiz package. I have only two attempts left. please help. i get the error below from the grader:
Feedback from the last successful autocorrection:
[20:07:21] [info] Setting up ROS2 environment (mark: 0)
[20:07:22] [info] ROS2 environment setup is okay (mark: 0)
[20:07:23] [assess] services_quiz
package not found. It was supposed to be there!
Things your can check:
Did you create it in /home/user/ros2_ws/src
?
Did you run colcon build
after creating it?
Was the compilation successful?
Did you run source install/setup.bash
after compiling?
Did you find it in ros2 pkg list
? (mark: 0)
[20:07:29] [assess] services_quiz_srv
package not found. What do you take me for?
Please check these and try again.
Did you create it in /home/user/ros2_ws/src
?
Did you run colcon build
after creating it?
Was the compilation successful?
Did you run source install/setup.bash
after compiling?
Did you find it in ros2 pkg list
? (mark: 0)
ralves
July 17, 2024, 12:15pm
2
Hi @abdulbasityekeen61 ,
When our system first tries to compile the first packages:
rm -rf build install log
colcon build --packages-select services_quiz services_quiz_srv
I see the following error message:
--- stderr: services_quiz_srv
failed to create symbolic link '/home/user/ros2_ws/build/services_quiz_srv/ament_cmake_python/services_quiz_srv/services_quiz_srv' because existing path cannot be removed: Is a directory
gmake[2]: *** [CMakeFiles/ament_cmake_python_symlink_services_quiz_srv.dir/build.make:70: CMakeFiles/ament_cmake_python_symlink_services_quiz_srv] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:421: CMakeFiles/ament_cmake_python_symlink_services_quiz_srv.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
---
Failed <<< services_quiz_srv [4.95s, exited with code 2]
Aborted <<< topic_subscriber_pkg [4.97s]
Aborted <<< custom_interfaces [5.17s]
Aborted <<< executors_exercises_pkg [7.40s]
Summary: 4 packages finished [7.72s]
1 package failed: services_quiz_srv
3 packages aborted: custom_interfaces executors_exercises_pkg topic_subscriber_pkg
2 packages had stderr output: custom_interfaces services_quiz_srv
3 packages not processed
Then the script tries again,
rm -rf build install log
colcon build --packages-select services_quiz services_quiz_srv
the following errors come:
Starting >>> services_quiz_srv
[0.400s] WARNING:colcon.colcon_ros.prefix_path.ament:The path '/home/user/quiz_ws/Quizes/ros2_ws/install/ros2_quizzes' in the environment variable AMENT_PREFIX_PATH doesn't exist
[0.401s] 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
[0.401s] WARNING:colcon.colcon_ros.prefix_path.ament:The path '/home/user/ros2_ws/install/topic_publisher_pkg' in the environment variable AMENT_PREFIX_PATH doesn't exist
[0.401s] 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
[0.401s] WARNING:colcon.colcon_ros.prefix_path.ament:The path '/home/user/ros2_ws/install/services_quiz' in the environment variable AMENT_PREFIX_PATH doesn't exist
[0.401s] WARNING:colcon.colcon_ros.prefix_path.ament:The path '/home/user/ros2_ws/install/my_package' in the environment variable AMENT_PREFIX_PATH doesn't exist
[0.401s] 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
[0.401s] 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
[0.402s] WARNING:colcon.colcon_ros.prefix_path.ament:The path '/home/user/ros2_ws/install/executors_exercises_pkg' in the environment variable AMENT_PREFIX_PATH doesn't exist
[0.402s] 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
[0.402s] 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
[0.402s] WARNING:colcon.colcon_ros.prefix_path.catkin:The path '/home/user/ros2_ws/install/topics_quiz' in the environment variable CMAKE_PREFIX_PATH doesn't exist
[0.402s] WARNING:colcon.colcon_ros.prefix_path.catkin:The path '/home/user/ros2_ws/install/topic_subscriber_pkg' in the environment variable CMAKE_PREFIX_PATH doesn't exist
[0.402s] WARNING:colcon.colcon_ros.prefix_path.catkin:The path '/home/user/ros2_ws/install/topic_publisher_pkg' in the environment variable CMAKE_PREFIX_PATH doesn't exist
[0.402s] 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
[0.402s] WARNING:colcon.colcon_ros.prefix_path.catkin:The path '/home/user/ros2_ws/install/services_quiz' in the environment variable CMAKE_PREFIX_PATH doesn't exist
[0.402s] WARNING:colcon.colcon_ros.prefix_path.catkin:The path '/home/user/ros2_ws/install/my_package' in the environment variable CMAKE_PREFIX_PATH doesn't exist
[0.402s] WARNING:colcon.colcon_ros.prefix_path.catkin:The path '/home/user/ros2_ws/install/movement_pkg' in the environment variable CMAKE_PREFIX_PATH doesn't exist
[0.402s] WARNING:colcon.colcon_ros.prefix_path.catkin:The path '/home/user/ros2_ws/install/exercise42_pkg' in the environment variable CMAKE_PREFIX_PATH doesn't exist
[0.403s] WARNING:colcon.colcon_ros.prefix_path.catkin:The path '/home/user/ros2_ws/install/executors_exercises_pkg' in the environment variable CMAKE_PREFIX_PATH doesn't exist
[0.403s] 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
[0.403s] WARNING:colcon.colcon_ros.prefix_path.catkin:The path '/home/user/ros2_ws/install/client_pkg' in the environment variable CMAKE_PREFIX_PATH doesn't exist
Starting >>> services_quiz
[0.423s] ERROR:colcon.colcon_cmake.task.cmake.build:Failed to find the following files:
- /home/user/ros2_ws/install/custom_interfaces/share/custom_interfaces/package.sh
Check that the following packages have been built:
- custom_interfaces
Failed <<< services_quiz [0.02s, exited with code 1]
Aborted <<< services_quiz_srv [0.04s]
Summary: 0 packages finished [0.26s]
1 package failed: services_quiz
1 package aborted: services_quiz_srv
I hope this helps you better understand why your scripts are failing.
@abdulbasityekeen61
Building on what @ralves pointed out, here is a hint for you. As indicated in the quiz’s instructions:
services_quiz_srv
must not depend on any other package. You must create the custom message from scratch (do not copy another package and then modify the files).
services_quiz
must only depend on services_quiz_srv
. You should also create this package from scratch.
It seems you have included some external dependencies in those packages, or you copy-pasted from another package.
system
Closed
July 22, 2024, 12:24pm
4
This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.