Problems with Exercise 8.4 C++ - header libraries not recognized

I am stuck on this exercise because the compiler doesn’t recognize the library of ardrone_as/ArdroneAction.h.
There are red marks anytime a variable of this type is called and therefore I can’t run this package. What am I doing wrong? I followed everything that the course says and made the right CMake changes. Help would be greatly appreciated.

Do you have the ardrone_as package listed in the CMake find_package() call as well as within the package.xml <build_depend> and <exec_depend> tags? If so, have you catkin built your package and ran into issues? Sometimes the IDE just highlights some things red, but there are no errors during catkin build.

I do have ardrone_as in find_package(). When I do catkin_make, I don’t get any errors, but then I get errors when I try to launch the launch file I made for this exercise.

Is this what I should write inside of package.xml?

<build_depend>ardrone_as</build_depend>
<build_export_depend>ardrone_as</build_export_depend>
<exec_depend>ardrone_as</exec_depend>

Am I going to make some changes in the add_action_files() portion of CMakeLists.txt?

Yeah, all of that looks fine. The <build_export_depend> line is not needed but doesn’t hurt to have it there. You can leave the add_action_files() call commented for this exercise.
Can you share a screenshot of the errors you get when launching?

1 Like

I’m trying to get you that screen shot but now there isn’t an error and the client seems to be running. Except that nothing is happening.
Another question, I made a change to catkin_package(), is that okay?
image

Here is what I’m seeing on the client side
image

And here is the action server launch

image

@danieldlrio9 , the catkin_package() call specifies catkin-specific information to the build system which then generates pkg-config and CMake files. For instance, if you were creating custom messages then you would put message_runtime in there along with CATKIN_DEPENDS. However, since we are not doing anything like that for this exercise, nothing is needed inside that call. So, just leave it empty as catkin_package(). That being said, since your client executable is running, this might not be your issue. If you typed up the code yourself, make sure you have the action server name correct as ardrone_action_server. It is case sensitive and if that is incorrect, the client will just keep on waiting for a server that does not exist, and you’ll get an output like you are seeing. Besides that, it’s difficult to speculate what’s happening without looking at your code. If you are still having issues, I would suggest posting a screenshot of the client cpp, the CMake file, the package.xml, and the launch file. That would give me a full picture.

1 Like