[Bug] Grader not detecting quiz packages - actions_quiz

This is an error report.


Screenshot of the error


Error details

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.

This indicates that the grader could not compile your actions quiz packages without external dependencies.

I see you have spent 4 trials already on this, before contacting us. You should contact us after the 2nd trial max…

You should be able to do this successfully, before trying to submit again:

cd ~/ros2_ws
rm -rf build/ install/ log/
colcon build --packages-select actions_quiz actions_quiz_msg

The idea of the quiz is that:

  • 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.

I believe that no external dependencies are being used.

The only dependency that I’m using in “actions_quiz_msg” is “rosidl_default_generators”.

In the “actions_quiz” package, I’m using the following dependencies:

  • “rclcpp”
  • “rclcpp_action”
  • “nav_msgs”
  • “std_msgs”
  • “actions_quiz_msg”

When I execute your command:

cd ~/ros2_ws
rm -rf build/ install/ log/
colcon build --packages-select actions_quiz actions_quiz_msg

I encounter the following error:

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

Short version: what we must fix

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.

Decided to delete the “actions_quiz” package and create it again with all the dependencies and I was able to overcome the problem.

After analyzing the new files and old files I found that “actions_quiz_msg” was missing from my package.xml

Thank you for your help :slight_smile:

1 Like

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