Custom Action Message does not compile

I am trying to create a custom action message and have made all the necessary changes in CMakeLists.txt file. I don’t believe I need to change anything in the package.xml file.
When I try to compile the messages using catkin_make it does not generate any messages. This problem had happened once when creating a custom service message and it fixed when I removed the package and started again, unfortunately it didn’t fix this when I did the same.

Below is the CustomActionMsg.action and CMakeLists.txt file as well.

image

I really am not sure why this occurs. Please help. I redid the package about two times and still hasn’t fixed it.

Hi @mamojiz97 ,

Could you also post your package.xml file contents?
Because this will help cross verify if the dependencies match with the packages specified in CMakeLists.txt file.

– Girish

Yes. Here you go:
image

Hi @mamojiz97 ,

Thanks for sharing the details.

Make these changes and let me know if it works:

  1. Replace rospy in generate_messages() with std_msgs in CMakeLists.txt.
  2. Add std_msgs under build_depend, build_export_depend and exec_depend in package.xml.

Everything else looks fine to me.

Regards,
Girish

Hi @girishkumar.kannan

I did as suggested and it did not solve the problem.
Thanks

Hi @girishkumar.kannan

I saw a post where it was suggested to type rm -rf build/ devel/ and then run catkin_make. It worked but could you please explain what it did?
Thank You

Hi @mamojiz97 ,

So deleting the build and devel folders will just get rid of (or clear up) any previously built packages using catkin_make.
Why it worked for you after deleting those folders, is that, the pre-built packages had cached the package configuration from earlier builds that was not conflicting with newer builds. Therefore, when you build packages again, they do not get replaced in the devel and build folders efficiently. Thus, deleting those folders resets the workspace for fresh clean package builds - which in turn makes newly built packages run correctly.

I hope I explained it clear enough. Let me know if you cannot understand my explanation.

Regards,
Girish

1 Like