Error Trying to find custom actions message on quiz


I am trying to make the quiz exercise on the section Actions, but I am getting an rare error when I try to compile. I have create the custom actions message and the ROS2 is able to find it.

But when I trying to add to the action server cpp file, the building system (colcon) give me an error.

The irony here it is that VCode recognize the include file directive.

In the image I show CMake and XML file configuration, the error, the proof that ROS2 recognize my custom actions msg and VCode recognize also the include file.

Any explain about this problem?


Hello @JCRisquez ,

The include line is wrong. Why are you putting actions_quiz_msg 2 times?

#include "actions_quiz_msg/actions_quiz_msg/action/distance.hpp"

The correct way is like this:

#include "actions_quiz_msg/action/distance.hpp"

Hello albertoezquerro,

The reason for #include “actions_quiz_msg/actions_quiz_msg/action/distance.hpp” is that is the VCode give me with autocompletion.

In any case, I have try use: #include “actions_quiz_msg/action/distance.hpp”, but I get the same error.


Hello @JCRisquez ,

It’s not building because now you have commented the actions_quiz_msg dependencies from CMakeLists.txt:

find_package(actions_quiz_msg REQUIRED)
ament_target_dependencies(actions_quiz_server rclcpp rclcpp_action t3_action_msg geometry_msgs actions_quiz_msg)

You have to keep these dependencies for the package to be able to find the interface.

1 Like

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