Custom Action Quiz

I’m trying to complete the Action Quiz. I’m getting an error related to importing the custom message:

I have read places suggesting to include a line in CMakeLists to add_dependencies. I have done that. I’d appreciate any suggestions. I’m including the files below.

CMakeLists.txt

package.xml

action_quiz_cpp.cpp

Quick one: is this preventing your code from compiling? If not, please move on as this is just an IDE issue.

Yes, it is preventing the code from compiling.

I see.

Did you create the custom message and make all that is required in CMakeList.txt and package.xml, for the message and for the C++ file? Have you been following the previous chapters? This quiz tests the material covered in previous chapters and exercises.

Yes. I was able to compile the custom message by itself and see it in rosmsg list. My CMakelist.txt and package.xml files are pasted in the original post. If you can find a mistake in them, I’d be appreciative. I followed the instructions to the best of my knowledge when making them.

Yes, I have completed the material in the other chapters.

A few things to check:

  • (Aside) Your package should be named actions_quiz. Of course, this is not the reason why the message is not working, but you need to name your files and folders as instructed or the autograder will get angry.
  • What name comes up for the message when you run rosmsg list? I think the name you import in your code should have Action at the end.

Thanks! Having “Action” and the end of the name was the problem.

And I’ll also add the “s” to the end of the package name. Thanks for noticing that!

Glad it worked!

Heads up: please note that merely renaming the package folder will most likely not work - you’ll need to change a bunch of other things. I’ll advise you create a new package called actions_quiz and move your files over.

It was pretty easy to ctl-f to find the name in the various files. Thanks for the suggestion.