After fulfilling all the requirements and submitting the quiz, the grader is unable to locate the packages. Subsequently, when I execute the "colcon build" command, I encounter warnings and errors, as shown in the attached screenshot.
I managed to work around this issue by building some packages individually using the "colcon build --packages-select" command. After doing this, I am able to successfully run the "colcon build" command.
However, when I submit the quiz again, I find myself stuck in the same cycle.
Note: Although the screenshot suggests there are errors in my .cpp file, it compiles correctly and produces the desired outcome.
actions_quiz_msg must not have any external dependency and must be able to compile without any dependency
actions_quiz must depend on actions_quiz_msg, and must not have any other dependency.
As far as the grader is concerned, only these two packages exist in your workspace. If any of them depends on another package in your workspace, the compilation would fail.
CMake Error at CMakeLists.txt:14 (find_package):
By not providing "Findactions_quiz_msg.cmake" in CMAKE_MODULE_PATH this
project has asked CMake to find a package configuration file provided by
"actions_quiz_msg", but CMake did not find one.
Could not find a package configuration file provided by "actions_quiz_msg"
with any of the following names:
actions_quiz_msgConfig.cmake
actions_quiz_msg-config.cmake
Add the installation prefix of "actions_quiz_msg" to CMAKE_PREFIX_PATH or
set "actions_quiz_msg_DIR" to a directory containing one of the above
files. If "actions_quiz_msg" provides a separate development package or
SDK, be sure it has been installed.
However, if I execute the following commands separately:
colcon build --packages-select actions_quiz_msg
And then:
colcon build --packages-select actions_quiz
The build completes successfully. It seems that when I compile both packages simultaneously, “actions_quiz” does not find the “actions_quiz_msg” package.
I would like to add that the warnings below that I get when compiling:
[0.571s] 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.572s] 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.572s] 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.572s] WARNING:colcon.colcon_ros.prefix_path.ament:The path '/home/user/ros2_ws/install/logs_test' in the environment variable AMENT_PREFIX_PATH doesn't exist
[0.572s] WARNING:colcon.colcon_ros.prefix_path.ament:The path '/home/user/ros2_ws/install/actions_quiz_msg' in the environment variable AMENT_PREFIX_PATH doesn't exist
[0.572s] WARNING:colcon.colcon_ros.prefix_path.ament:The path '/home/user/ros2_ws/install/actions_quiz' in the environment variable AMENT_PREFIX_PATH doesn't exist
[0.572s] 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.572s] 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.572s] 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.572s] WARNING:colcon.colcon_ros.prefix_path.catkin:The path '/home/user/ros2_ws/install/logs_test' in the environment variable CMAKE_PREFIX_PATH doesn't exist
[0.572s] WARNING:colcon.colcon_ros.prefix_path.catkin:The path '/home/user/ros2_ws/install/actions_quiz_msg' in the environment variable CMAKE_PREFIX_PATH doesn't exist
[0.572s] WARNING:colcon.colcon_ros.prefix_path.catkin:The path '/home/user/ros2_ws/install/actions_quiz' in the environment variable CMAKE_PREFIX_PATH doesn't exist
Both packages have to be compiled together. The grader does not compile them one after the other. Making this work is a major point of the quiz.
Long version: pointers from the error and suggestions for fixing it
The error message you are getting when compiling both packages suggests that actions_quiz_msg was not properly included as a dependency of actions_quiz. Something is missing somewhere in the Cmake files.
How did you include the dependency? To avoid headaches like this, I recommend including dependencies during package creation as this automatically adds the right entries in CMakeLists.txt and package.xml. Modifying these files by hand is error-prone.
One way to check for correct includes is to create a dummy package using actions_quiz_msg as a dependency, including it at the point of creation. Then compare the automatic includes in its CMakeLists.txt and package.xml to what you have for actions_quiz.